]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/pkg/YQPkgDependenciesView.h
clicking packages work! so the package selector is now
[duncan/yast2-qt4.git] / src / pkg / YQPkgDependenciesView.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       YQPkgDependenciesView.h
14
15   Author:     Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19
20 #ifndef YQPkgDependenciesView_h
21 #define YQPkgDependenciesView_h
22
23 #include "YQZypp.h"
24 #include "YQPkgGenericDetailsView.h"
25
26 using std::string;
27
28
29 /**
30  * @short Display technical details ( very much like 'rpm -qi' ) for a zypp::Package
31  * object - the installed instance, the candidate instance or both ( in two
32  * columns ) if both exist. All other available instances are ignored.
33  **/
34 class YQPkgDependenciesView : public YQPkgGenericDetailsView
35 {
36     Q_OBJECT
37
38 public:
39
40     /**
41      * Constructor
42      **/
43     YQPkgDependenciesView( QWidget * parent );
44
45
46     /**
47      * Destructor
48      **/
49     virtual ~YQPkgDependenciesView();
50
51
52 protected:
53
54     /**
55      * Show details for the specified selectable:
56      * In this case technical data, very much like "rpm -qi".
57      * Overwritten from YQPkgGenericDetailsView.
58      **/
59     virtual void showDetails( ZyppSel selectable );
60
61     /**
62      * Returns a string containing a HTML table for technical details for one
63      * package.
64      **/
65     QString simpleTable( ZyppObj pkg );
66
67
68     /**
69      * Returns a string containing a HTML table for technical details for two
70      * package instances: The installed instance and an alternate instance.
71      * (usually the candidate instance).
72      **/
73     QString complexTable( ZyppObj installed,
74                           ZyppObj candidate );
75
76     /**
77      * Format a zypp::CapSet (describing zypp::Dep::REQUIRES etc.)
78      * with a heading in HTML lines.
79      *
80      * Returns an empty string if capSet is empty.
81      **/
82     static QString row( const QString &         heading,
83                         const zypp::CapSet &    capSet );
84
85
86     /**
87      * Format two zypp::CapSets (describing zypp::Dep::REQUIRES etc.)
88      * with a heading in HTML lines.
89      *
90      * Returns an empty string both capSets are empty.
91      **/
92     static QString row( const QString &         heading,
93                         const zypp::CapSet &    capSet1,
94                         const zypp::CapSet &    capSet2 );
95
96     /**
97      * Returns a string containing a HTML table row with 'contents'.
98      *
99      * Required here to avoid inheritance ambiguities.
100      **/
101     static QString row( const QString & contents )
102         { return YQPkgGenericDetailsView::row( contents ); }
103     
104     /**
105      * Format a zypp::CapSet (describing zypp::Dep::REQUIRES etc.)
106      * in HTML lines, separated with <BR>.
107      * Returns an empty string if capSet is empty.
108      **/
109     static QString htmlLines( const zypp::CapSet & capSet );
110 };
111
112
113 #endif // ifndef YQPkgDependenciesView_h