libyui-qt-pkg
Loading...
Searching...
No Matches
YQPkgSearchFilterView.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 File: YQPkgSearchFilterView.h
20 Author: Stefan Hundhammer <shundhammer.de>
21*/
22
23
24#ifndef YQPkgSearchFilterView_h
25#define YQPkgSearchFilterView_h
26
27#include "YQZypp.h"
28#include <QWidget>
29#include <QRegExp>
30#include <QEvent>
31#include <QScrollArea>
32
33
34class QComboBox;
35class QCheckBox;
36class QPushButton;
37class QRadioButton;
38
39using std::list;
40using std::string;
41
42
46class YQPkgSearchFilterView : public QScrollArea
47{
48 Q_OBJECT
49
50public:
51
55 YQPkgSearchFilterView( QWidget * parent );
56
60 virtual ~YQPkgSearchFilterView();
61
66 virtual QSize minimumSizeHint() const;
67
72 bool check( ZyppSel selectable,
73 ZyppObj zyppObj );
74
75
76public slots:
77
85 void filter();
86
90 void filterIfVisible();
91
95 void setFocus();
96
97
98signals:
99
105
109 void filterMatch( ZyppSel selectable,
110 ZyppPkg pkg );
111
116
120 void message( const QString & text );
121
122
123protected:
124
125 // Caution: Enum order must match corresponding message strings in combo box!
126 enum SearchMode
127 {
128 Contains = 0,
129 BeginsWith,
130 ExactMatch,
131 UseWildcards,
132 UseRegExp
133 };
134
139 virtual void keyPressEvent( QKeyEvent * event );
140
141 // THESE SHOULD BE DEPRECATED but still used in secondary
142 // filters
146 bool check( ZyppSel selectable,
147 ZyppObj zyppObj,
148 const QRegExp & regexp );
149
153 bool check( const string & attribute, const QRegExp & regexp );
154
160 bool check( const zypp::Capabilities & capSet, const QRegExp & regexp );
161
162 // Data members
163
164 QComboBox * _searchText;
165 QPushButton * _searchButton;
166
167 QCheckBox * _searchInName;
168 QCheckBox * _searchInKeywords;
169 QCheckBox * _searchInSummary;
170 QCheckBox * _searchInDescription;
171 QCheckBox * _searchInRequires;
172 QCheckBox * _searchInProvides;
173 QCheckBox * _searchInFileList;
174
175 QComboBox * _searchMode;
176 QCheckBox * _caseSensitive;
177
178 int _matchCount;
179};
180
181
182
183#endif // ifndef YQPkgSearchFilterView_h
Filter view for searching within packages.
Definition YQPkgSearchFilterView.h:47
virtual ~YQPkgSearchFilterView()
Definition YQPkgSearchFilterView.cc:167
bool check(ZyppSel selectable, ZyppObj zyppObj)
Definition YQPkgSearchFilterView.cc:361
void setFocus()
Definition YQPkgSearchFilterView.cc:196
void message(const QString &text)
virtual QSize minimumSizeHint() const
Definition YQPkgSearchFilterView.cc:203
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
void filterIfVisible()
Definition YQPkgSearchFilterView.cc:210
void filter()
Definition YQPkgSearchFilterView.cc:218
virtual void keyPressEvent(QKeyEvent *event)
Definition YQPkgSearchFilterView.cc:174