libyui-qt-pkg
 
Loading...
Searching...
No Matches
YQPkgClassFilterView.h
1/*
2 Copyright (c) 2000 - 2010 Novell, Inc.
3 Copyright (c) 2021 SUSE LLC
4
5 This library is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) version 3.0 of the License. This library
9 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 License for more details. You should have received a copy of the GNU
13 Lesser General Public License along with this library; if not, write
14 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
15 Floor, Boston, MA 02110-1301 USA
16*/
17
18
19/*
20 File: YQPkgClassFilterView.h
21
22 Authors: Duncan Mac-Vicar Prett <duncan@suse.de>
23 Stefan Hundhammer <shundhammer.de>
24*/
25
26
27#ifndef YQPkgClassFilterView_h
28#define YQPkgClassFilterView_h
29
30#include "YQZypp.h"
31#include <QTreeWidget>
32
33
34typedef enum
35{
36 YQPkgClassNone, // Not listed in the widget
37 YQPkgClassSuggested,
38 YQPkgClassRecommended,
39 YQPkgClassOrphaned,
40 YQPkgClassUnneeded,
41 YQPkgClassMultiversion,
42 YQPkgClassRetracted,
43 YQPkgClassRetractedInstalled,
44 YQPkgClassAll,
45} YQPkgClass;
46
47
48class YQPkgClassItem;
49
50
55class YQPkgClassFilterView : public QTreeWidget
56{
57 Q_OBJECT
58
59public:
60
64 YQPkgClassFilterView( QWidget * parent );
65
69 virtual ~YQPkgClassFilterView();
70
77 bool check( ZyppSel selectable, ZyppPkg pkg );
78
83 bool checkMatch( ZyppSel selectable, ZyppPkg pkg );
84
88 YQPkgClass selectedPkgClass() const;
89
93 void showPkgClass( YQPkgClass pkgClass );
94
95
96public slots:
97
105 void filter();
106
110 void filterIfVisible();
111
112
113signals:
114
120
124 void filterMatch( ZyppSel selectable, ZyppPkg pkg );
125
130
131
132protected slots:
133
134 void slotSelectionChanged( QTreeWidgetItem * newSelection );
135
136
137protected:
138
139 void fillPkgClasses();
140
141};
142
143
144class YQPkgClassItem: public QTreeWidgetItem
145{
146public:
147
148 YQPkgClassItem( YQPkgClassFilterView * parentFilterView,
149 YQPkgClass pkgClass );
150
151 virtual ~YQPkgClassItem();
152
153 YQPkgClass pkgClass() const { return _pkgClass; }
154
155 virtual bool operator< ( const QTreeWidgetItem & otherListViewItem ) const;
156
157
158private:
159
160 // Data members
161
162 YQPkgClass _pkgClass;
163};
164
165
166#endif // ifndef YQPkgClassFilterView_h
Definition YQPkgClassFilterView.h:56
void filterIfVisible()
Definition YQPkgClassFilterView.cc:122
void showPkgClass(YQPkgClass pkgClass)
Definition YQPkgClassFilterView.cc:266
void filter()
Definition YQPkgClassFilterView.cc:130
bool check(ZyppSel selectable, ZyppPkg pkg)
Definition YQPkgClassFilterView.cc:212
virtual ~YQPkgClassFilterView()
Definition YQPkgClassFilterView.cc:99
YQPkgClassFilterView(QWidget *parent)
Definition YQPkgClassFilterView.cc:84
YQPkgClass selectedPkgClass() const
Definition YQPkgClassFilterView.cc:249
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
bool checkMatch(ZyppSel selectable, ZyppPkg pkg)
Definition YQPkgClassFilterView.cc:224
Definition YQPkgClassFilterView.h:145