1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQPkgSearchFilterView.h
15 Author: Stefan Hundhammer <sh@suse.de>
20 #ifndef YQPkgSearchFilterView_h
21 #define YQPkgSearchFilterView_h
40 * @short Filter view for searching within packages
42 class YQPkgSearchFilterView : public Q3VBox
51 YQPkgSearchFilterView( QWidget * parent );
56 virtual ~YQPkgSearchFilterView();
59 * Returns the minimum size required for this widget.
60 * Inherited from QWidget.
62 virtual QSize minimumSizeHint() const;
65 * Check one ResObject against the currently selected values.
66 * Returns true if the package matches, false if not.
68 bool check( ZyppSel selectable,
75 * Filter according to the view's rules and current selection.
76 * Emits those signals:
78 * filterMatch() for each pkg that matches the filter
84 * Same as filter(), but only if this widget is currently visible.
86 void filterIfVisible();
89 * Set the keyboard focus into this view's input field.
97 * Emitted when the filtering starts. Use this to clear package lists
98 * etc. prior to adding new entries.
103 * Emitted during filtering for each pkg that matches the filter.
105 void filterMatch( ZyppSel selectable,
109 * Emitted when filtering is finished.
111 void filterFinished();
114 * Send a short message about unsuccessful searches.
116 void message( const QString & text );
121 // Caution: Enum order must match corresponding message strings in combo box!
122 typedef enum SearchMode
133 * Check if pkg matches the search criteria.
135 bool check( ZyppSel selectable,
137 const QRegExp & regexp );
140 * Check if a single pkg attribute matches the search criteria.
142 bool check( const string & attribute, const QRegExp & regexp );
145 * Check capability like
146 * zypp::Resolvable::dep( zypp::Dep::PROVIDES ),
147 * zypp::Resolvable::dep( zypp::Dep::REQUIRES )
149 bool check( const zypp::CapSet & capSet, const QRegExp & regexp );
152 * Key press event: Execute search upon 'Return'
153 * Reimplemented from QVBox / QWidget.
155 virtual void keyPressEvent( QKeyEvent * event );
160 QComboBox * _searchText;
161 QPushButton * _searchButton;
163 QCheckBox * _searchInName;
164 QCheckBox * _searchInSummary;
165 QCheckBox * _searchInDescription;
166 QCheckBox * _searchInRequires;
167 QCheckBox * _searchInProvides;
169 QComboBox * _searchMode;
170 QCheckBox * _caseSensitive;
177 #endif // ifndef YQPkgSearchFilterView_h