libyui-qt-pkg  2.45.15.2
YQPkgSecondaryFilterView.h
1 /**************************************************************************
2 Copyright (C) 2018 SUSE LLC
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 #ifndef YQPkgSecondaryFilterView_h
23 #define YQPkgSecondaryFilterView_h
24 
25 #include "YQZypp.h"
26 #include <QWidget>
27 
28 class QY2ComboTabWidget;
32 
33 
34 /**
35  * This is a base class for filter views containing a secondary filter
36  */
37 class YQPkgSecondaryFilterView : public QWidget
38 {
39  Q_OBJECT
40 
41 public:
42 
43  /**
44  * Constructor
45  * Because of the circular dependencies you have to call the init()
46  * method later with the new subclassed object.
47  **/
48  YQPkgSecondaryFilterView( QWidget * parent );
49 
50  /**
51  * Destructor
52  **/
53  virtual ~YQPkgSecondaryFilterView();
54 
55  /**
56  * Initialize the primary widget
57  * @param primary_widget the primary widget to which the secondary views
58  * will be added. It should be a subclass of YQPkgSecondaryFilterView.
59  */
60  void init(QWidget * primary_widget);
61 
62 signals:
63 
64  /**
65  * Emitted when the filtering starts. Use this to clear package lists
66  * etc. prior to adding new entries.
67  **/
68  void filterStart();
69 
70  /**
71  * Emitted during filtering for each pkg that matches the filter
72  * and the candidate package comes from the respective repository
73  **/
74  void filterMatch( ZyppSel selectable,
75  ZyppPkg pkg );
76 
77  /**
78  * Emitted during filtering for each pkg that matches the filter
79  * and the candidate package does not come from the respective repository
80  **/
81  void filterNearMatch( ZyppSel selectable,
82  ZyppPkg pkg );
83 
84  /**
85  * Emitted when filtering is finished.
86  **/
87  void filterFinished();
88 
89 public slots:
90 
91  /**
92  * Filter according to the view's rules and current selection.
93  * Emits those signals:
94  * filterStart()
95  * filterMatch() for each pkg that matches the filter
96  * filterFinished()
97  **/
98  void filter();
99 
100  /**
101  * Same as filter(), but only if this widget is currently visible.
102  **/
103  void filterIfVisible();
104 
105 
106 protected slots:
107 
108  /**
109  * Propagate a filter match from the primary filter
110  * and appy any selected secondary filter(s) to it
111  **/
112  void primaryFilterMatch( ZyppSel selectable,
113  ZyppPkg pkg );
114 
115  /**
116  * Propagate a filter near match from the primary filter
117  * and appy any selected secondary filter(s) to it
118  **/
119  void primaryFilterNearMatch( ZyppSel selectable,
120  ZyppPkg pkg );
121 
122 protected:
123 
124  /**
125  * Widget layout for the secondary filters
126  **/
127  QWidget * layoutSecondaryFilters( QWidget * parent, QWidget * primary_widget );
128 
129  /**
130  * Check if pkg matches the the currently selected secondary filter
131  **/
132  bool secondaryFilterMatch( ZyppSel selectable,
133  ZyppPkg pkg );
134 
135  virtual void primaryFilter() {}
136  virtual void primaryFilterIfVisible() {}
137 
138 
139  // Data members
140  QY2ComboTabWidget * _secondaryFilters;
141  QWidget * _allPackages;
142  QWidget *_unmaintainedPackages;
143  YQPkgRpmGroupTagsFilterView * _rpmGroupTagsFilterView;
144  YQPkgSearchFilterView * _searchFilterView;
145  YQPkgStatusFilterView * _statusFilterView;
146 };
147 
148 #endif // ifndef YQPkgSecondaryFilterView_h
void filterNearMatch(ZyppSel selectable, ZyppPkg pkg)
Emitted during filtering for each pkg that matches the filter and the candidate package does not come...
RPM group tags filter view: Display the RPM group tags tree and emit signals if any group tag is sele...
void filter()
Filter according to the view&#39;s rules and current selection.
This is a base class for filter views containing a secondary filter.
QWidget * layoutSecondaryFilters(QWidget *parent, QWidget *primary_widget)
Widget layout for the secondary filters.
void primaryFilterNearMatch(ZyppSel selectable, ZyppPkg pkg)
Propagate a filter near match from the primary filter and appy any selected secondary filter(s) to it...
void init(QWidget *primary_widget)
Initialize the primary widget.
void primaryFilterMatch(ZyppSel selectable, ZyppPkg pkg)
Propagate a filter match from the primary filter and appy any selected secondary filter(s) to it...
void filterIfVisible()
Same as filter(), but only if this widget is currently visible.
Filter view for searching within packages.
void filterStart()
Emitted when the filtering starts.
void filterFinished()
Emitted when filtering is finished.
YQPkgSecondaryFilterView(QWidget *parent)
Constructor Because of the circular dependencies you have to call the init() method later with the ne...
Filter view for packages that made problems during update.
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
Emitted during filtering for each pkg that matches the filter and the candidate package comes from th...
bool secondaryFilterMatch(ZyppSel selectable, ZyppPkg pkg)
Check if pkg matches the the currently selected secondary filter.
virtual ~YQPkgSecondaryFilterView()
Destructor.