libyui-qt-pkg  2.42.5
 All Classes Functions Variables Enumerations
YQPkgStatusFilterView.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: YQPkgStatusFilterView.h
35 
36  Author: Stefan Hundhammer <sh@suse.de>
37 
38 /-*/
39 
40 
41 #ifndef YQPkgStatusFilterView_h
42 #define YQPkgStatusFilterView_h
43 
44 #include "YQZypp.h"
45 #include <QWidget>
46 #include <QRegExp>
47 #include <QPixmap>
48 
49 
50 class QComboBox;
51 class QCheckBox;
52 class QPushButton;
53 
54 
55 /**
56  * @short Filter view for packages that made problems during update
57  **/
58 class YQPkgStatusFilterView : public QWidget
59 {
60  Q_OBJECT
61 
62 public:
63 
64  /**
65  * Constructor
66  **/
67  YQPkgStatusFilterView( QWidget * parent );
68 
69  /**
70  * Destructor
71  **/
72  virtual ~YQPkgStatusFilterView();
73 
74  /**
75  * Returns the minimum size required for this widget.
76  * Inherited from QWidget.
77  **/
78  virtual QSize minimumSizeHint() const;
79 
80  /**
81  * Check if pkg matches the filter criteria.
82  **/
83  bool check( ZyppSel selectable,
84  ZyppObj pkg );
85 
86 
87 public slots:
88 
89  /**
90  * Filter according to the view's rules and current selection.
91  * Emits those signals:
92  * filterStart()
93  * filterMatch() for each pkg that matches the filter
94  * filterFinished()
95  **/
96  void filter();
97 
98  /**
99  * Same as filter(), but only if this widget is currently visible.
100  **/
101  void filterIfVisible();
102 
103 
104  /**
105  * Reset all check boxes (set them all to "off")
106  **/
107  void clear();
108 
109  /**
110  * Set up the check boxes so all pending transactions are displayed.
111  **/
112  void showTransactions();
113 
114  /**
115  * Set up the check boxes so pending manual transactions (no "auto" states)
116  * are displayed.
117  **/
118  void showManualTransactions();
119 
120  /**
121  * Set up the check boxes so pending automatic transactions (the "auto" states)
122  * are displayed.
123  **/
124  void showAutoTransactions();
125 
126  /**
127  * Set the check boxes for locked packages ("Taboo" and "Protected") to "on".
128  **/
129  void showLocks();
130 
131  /**
132  * Set the check box for installed packages to "on".
133  **/
134  void showInstalled();
135 
136  /**
137  * Set the check box for not installed packages to "on".
138  **/
139  void showNotInstalled();
140 
141 
142 signals:
143 
144  /**
145  * Emitted when the filtering starts. Use this to clear package lists
146  * etc. prior to adding new entries.
147  **/
148  void filterStart();
149 
150  /**
151  * Emitted during filtering for each pkg that matches the filter.
152  **/
153  void filterMatch( ZyppSel selectable,
154  ZyppPkg pkg );
155 
156  /**
157  * Emitted when filtering is finished.
158  **/
159  void filterFinished();
160 
161 
162 protected:
163 
164  /**
165  * Add a check box
166  **/
167  QCheckBox * addStatusCheckBox( QWidget * parent,
168  const QString & label,
169  const QPixmap & icon,
170  bool initiallyChecked );
171 
172  // Data members
173 
174  QCheckBox * _showAutoDel;
175  QCheckBox * _showAutoInstall;
176  QCheckBox * _showAutoUpdate;
177  QCheckBox * _showDel;
178  QCheckBox * _showInstall;
179  QCheckBox * _showKeepInstalled;
180  QCheckBox * _showNoInst;
181  QCheckBox * _showTaboo;
182  QCheckBox * _showProtected;
183  QCheckBox * _showUpdate;
184 
185  QPushButton * _refreshButton;
186 };
187 
188 
189 
190 #endif // ifndef YQPkgStatusFilterView_h