libyui-qt-pkg  2.45.6
YQPkgDependenciesView.h
1 /**************************************************************************
2 Copyright (C) 2000 - 2010 Novell, Inc.
3 All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 
19 **************************************************************************/
20 
21 
22 /*---------------------------------------------------------------------\
23 | |
24 | __ __ ____ _____ ____ |
25 | \ \ / /_ _/ ___|_ _|___ \ |
26 | \ V / _` \___ \ | | __) | |
27 | | | (_| |___) || | / __/ |
28 | |_|\__,_|____/ |_| |_____| |
29 | |
30 | core system |
31 | (C) SuSE GmbH |
32 \----------------------------------------------------------------------/
33 
34  File: YQPkgDependenciesView.h
35 
36  Author: Stefan Hundhammer <sh@suse.de>
37 
38 /-*/
39 
40 
41 #ifndef YQPkgDependenciesView_h
42 #define YQPkgDependenciesView_h
43 
44 #include "YQZypp.h"
45 #include "YQPkgGenericDetailsView.h"
46 
47 using std::string;
48 
49 
50 /**
51  * @short Display technical details ( very much like 'rpm -qi' ) for a zypp::Package
52  * object - the installed instance, the candidate instance or both ( in two
53  * columns ) if both exist. All other available instances are ignored.
54  **/
56 {
57  Q_OBJECT
58 
59 public:
60 
61  /**
62  * Constructor
63  **/
64  YQPkgDependenciesView( QWidget * parent );
65 
66 
67  /**
68  * Destructor
69  **/
70  virtual ~YQPkgDependenciesView();
71 
72 
73 protected:
74 
75  /**
76  * Show details for the specified selectable:
77  * In this case technical data, very much like "rpm -qi".
78  * Overwritten from YQPkgGenericDetailsView.
79  **/
80  virtual void showDetails( ZyppSel selectable );
81 
82  /**
83  * Returns a string containing a HTML table for technical details for one
84  * package.
85  **/
86  QString simpleTable( ZyppObj pkg );
87 
88 
89  /**
90  * Returns a string containing a HTML table for technical details for two
91  * package instances: The installed instance and an alternate instance.
92  * (usually the candidate instance).
93  **/
94  QString complexTable( ZyppObj installed,
95  ZyppObj candidate );
96 
97  /**
98  * Format a zypp::CapSet (describing zypp::Dep::REQUIRES etc.)
99  * with a heading in HTML lines.
100  *
101  * Returns an empty string if capSet is empty.
102  **/
103  static QString row( const QString & heading,
104  const zypp::Capabilities & capSet );
105 
106 
107  /**
108  * Format two zypp::Capabilities (describing zypp::Dep::REQUIRES etc.)
109  * with a heading in HTML lines.
110  *
111  * Returns an empty string both capSets are empty.
112  **/
113  static QString row( const QString & heading,
114  const zypp::Capabilities & capSet1,
115  const zypp::Capabilities & capSet2 );
116 
117  /**
118  * Returns a string containing a HTML table row with 'contents'.
119  *
120  * Required here to avoid inheritance ambiguities.
121  **/
122  static QString row( const QString & contents )
123  { return YQPkgGenericDetailsView::row( contents ); }
124 
125  /**
126  * Format a zypp::Capabilities (describing zypp::Dep::REQUIRES etc.)
127  * in HTML lines, separated with <BR>.
128  * Returns an empty string if capSet is empty.
129  **/
130  static QString htmlLines( const zypp::Capabilities & capSet );
131 };
132 
133 
134 #endif // ifndef YQPkgDependenciesView_h
static QString row(const QString &heading, const zypp::Capabilities &capSet)
Format a zypp::CapSet (describing zypp::Dep::REQUIRES etc.) with a heading in HTML lines...
YQPkgDependenciesView(QWidget *parent)
Constructor.
Abstract base class for details views.
QString simpleTable(ZyppObj pkg)
Returns a string containing a HTML table for technical details for one package.
static QString row(const QString &contents)
Returns a string containing a HTML table row with &#39;contents&#39;.
virtual ~YQPkgDependenciesView()
Destructor.
static QString htmlLines(const zypp::Capabilities &capSet)
Format a zypp::Capabilities (describing zypp::Dep::REQUIRES etc.) in HTML lines, separated with ...
static QString row(const QString &contents)
Returns a string containing a HTML table row with &#39;contents&#39;.
QString complexTable(ZyppObj installed, ZyppObj candidate)
Returns a string containing a HTML table for technical details for two package instances: The install...
Display technical details ( very much like &#39;rpm -qi&#39; ) for a zypp::Package object - the installed ins...
virtual void showDetails(ZyppSel selectable)
Show details for the specified selectable: In this case technical data, very much like "rpm -qi"...