]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/pkg/YQPkgStatusFilterView.h
c7d4413911236c7a04903c7d37225701468a706d
[duncan/yast2-qt4.git] / src / pkg / YQPkgStatusFilterView.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       YQPkgStatusFilterView.h
14
15   Author:     Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19
20 #ifndef YQPkgStatusFilterView_h
21 #define YQPkgStatusFilterView_h
22
23 #include "YQZypp.h"
24 #include <q3vbox.h>
25 #include <qregexp.h>
26 //Added by qt3to4:
27 #include <qpixmap.h>
28
29
30 class QComboBox;
31 class QCheckBox;
32 class QPushButton;
33
34
35 /**
36  * @short Filter view for packages that made problems during update
37  **/
38 class YQPkgStatusFilterView : public Q3VBox
39 {
40     Q_OBJECT
41
42 public:
43
44     /**
45      * Constructor
46      **/
47     YQPkgStatusFilterView( QWidget * parent );
48
49     /**
50      * Destructor
51      **/
52     virtual ~YQPkgStatusFilterView();
53
54     /**
55      * Returns the minimum size required for this widget.
56      * Inherited from QWidget.
57      **/
58     virtual QSize minimumSizeHint() const;
59
60     /**
61      * Check if pkg matches the filter criteria.
62      **/
63     bool check( ZyppSel selectable,
64                 ZyppObj         pkg );
65
66
67 public slots:
68
69     /**
70      * Filter according to the view's rules and current selection.
71      * Emits those signals:
72      *    filterStart()
73      *    filterMatch() for each pkg that matches the filter
74      *    filterFinished()
75      **/
76     void filter();
77
78     /**
79      * Same as filter(), but only if this widget is currently visible.
80      **/
81     void filterIfVisible();
82
83
84     /**
85      * Reset all check boxes (set them all to "off")
86      **/
87     void clear();
88     
89     /**
90      * Set up the check boxes so all pending transactions are displayed.
91      **/
92     void showTransactions();
93
94     /**
95      * Set up the check boxes so pending manual transactions (no "auto" states)
96      * are displayed.
97      **/
98     void showManualTransactions();
99     
100     /**
101      * Set up the check boxes so pending automatic transactions (the "auto" states)
102      * are displayed.
103      **/
104     void showAutoTransactions();
105
106     /**
107      * Set the check boxes for locked packages ("Taboo" and "Protected") to "on".
108      **/
109     void showLocks();
110
111     /**
112      * Set the check box for installed packages to "on".
113      **/
114     void showInstalled();
115
116     /**
117      * Set the check box for not installed packages to "on".
118      **/
119     void showNotInstalled();
120
121     
122 signals:
123
124     /**
125      * Emitted when the filtering starts. Use this to clear package lists
126      * etc. prior to adding new entries.
127      **/
128     void filterStart();
129
130     /**
131      * Emitted during filtering for each pkg that matches the filter.
132      **/
133     void filterMatch( ZyppSel   selectable,
134                       ZyppPkg   pkg );
135
136     /**
137      * Emitted when filtering is finished.
138      **/
139     void filterFinished();
140
141
142 protected:
143
144     /**
145      * Add a check box
146      **/
147     QCheckBox * addStatusCheckBox( QWidget *            parent,
148                                    const QString &      label,
149                                    const QPixmap &      icon,
150                                    bool                 initiallyChecked );
151
152     // Data members
153
154     QCheckBox *         _showAutoDel;
155     QCheckBox *         _showAutoInstall;
156     QCheckBox *         _showAutoUpdate;
157     QCheckBox *         _showDel;
158     QCheckBox *         _showInstall;
159     QCheckBox *         _showKeepInstalled;
160     QCheckBox *         _showNoInst;
161     QCheckBox *         _showTaboo;
162     QCheckBox *         _showProtected;
163     QCheckBox *         _showUpdate;
164
165     QPushButton *       _refreshButton;
166 };
167
168
169
170 #endif // ifndef YQPkgStatusFilterView_h