libyui-qt-pkg
YQPkgClassFilterView.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: YQPkgClassFilterView.h
35 
36  Authors: Duncan Mac-Vicar Prett <duncan@suse.de>
37  Stefan Hundhammer <shundhammer.de>
38 
39 /-*/
40 
41 
42 #ifndef YQPkgClassFilterView_h
43 #define YQPkgClassFilterView_h
44 
45 #include "YQZypp.h"
46 #include <QTreeWidget>
47 
48 
49 typedef enum
50 {
51  YQPkgClassNone, // Not listed in the widget
52  YQPkgClassSuggested,
53  YQPkgClassRecommended,
54  YQPkgClassOrphaned,
55  YQPkgClassUnneeded,
56  YQPkgClassMultiversion,
57  YQPkgClassRetracted,
58  YQPkgClassRetractedInstalled,
59  YQPkgClassAll,
60 } YQPkgClass;
61 
62 
63 class YQPkgClassItem;
64 
65 
70 class YQPkgClassFilterView : public QTreeWidget
71 {
72  Q_OBJECT
73 
74 public:
75 
79  YQPkgClassFilterView( QWidget * parent );
80 
84  virtual ~YQPkgClassFilterView();
85 
92  bool check( ZyppSel selectable, ZyppPkg pkg );
93 
98  bool checkMatch( ZyppSel selectable, ZyppPkg pkg );
99 
103  YQPkgClass selectedPkgClass() const;
104 
108  void showPkgClass( YQPkgClass pkgClass );
109 
110 
111 public slots:
112 
120  void filter();
121 
125  void filterIfVisible();
126 
127 
128 signals:
129 
134  void filterStart();
135 
139  void filterMatch( ZyppSel selectable, ZyppPkg pkg );
140 
144  void filterFinished();
145 
146 
147 protected slots:
148 
149  void slotSelectionChanged( QTreeWidgetItem * newSelection );
150 
151 
152 protected:
153 
154  void fillPkgClasses();
155 
156 };
157 
158 
159 class YQPkgClassItem: public QTreeWidgetItem
160 {
161 public:
162 
163  YQPkgClassItem( YQPkgClassFilterView * parentFilterView,
164  YQPkgClass pkgClass );
165 
166  virtual ~YQPkgClassItem();
167 
168  YQPkgClass pkgClass() const { return _pkgClass; }
169 
170  virtual bool operator< ( const QTreeWidgetItem & otherListViewItem ) const;
171 
172 
173 private:
174 
175  // Data members
176 
177  YQPkgClass _pkgClass;
178 };
179 
180 
181 #endif // ifndef YQPkgClassFilterView_h
Definition: YQPkgClassFilterView.h:70
bool check(ZyppSel selectable, ZyppPkg pkg)
Definition: YQPkgClassFilterView.cc:226
YQPkgClassFilterView(QWidget *parent)
Definition: YQPkgClassFilterView.cc:98
Definition: YQPkgClassFilterView.h:159
void filter()
Definition: YQPkgClassFilterView.cc:144
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
void showPkgClass(YQPkgClass pkgClass)
Definition: YQPkgClassFilterView.cc:280
YQPkgClass selectedPkgClass() const
Definition: YQPkgClassFilterView.cc:263
bool checkMatch(ZyppSel selectable, ZyppPkg pkg)
Definition: YQPkgClassFilterView.cc:238
void filterIfVisible()
Definition: YQPkgClassFilterView.cc:136
virtual ~YQPkgClassFilterView()
Definition: YQPkgClassFilterView.cc:113