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
39 * @short Filter view for searching within packages
41 class YQPkgSearchFilterView : public QWidget
50 YQPkgSearchFilterView( QWidget * parent );
55 virtual ~YQPkgSearchFilterView();
58 * Returns the minimum size required for this widget.
59 * Inherited from QWidget.
61 virtual QSize minimumSizeHint() const;
64 * Check one ResObject against the currently selected values.
65 * Returns true if the package matches, false if not.
67 bool check( ZyppSel selectable,
74 * Filter according to the view's rules and current selection.
75 * Emits those signals:
77 * filterMatch() for each pkg that matches the filter
83 * Same as filter(), but only if this widget is currently visible.
85 void filterIfVisible();
88 * Set the keyboard focus into this view's input field.
96 * Emitted when the filtering starts. Use this to clear package lists
97 * etc. prior to adding new entries.
102 * Emitted during filtering for each pkg that matches the filter.
104 void filterMatch( ZyppSel selectable,
108 * Emitted when filtering is finished.
110 void filterFinished();
113 * Send a short message about unsuccessful searches.
115 void message( const QString & text );
120 // Caution: Enum order must match corresponding message strings in combo box!
121 typedef enum SearchMode
132 * Check if pkg matches the search criteria.
134 bool check( ZyppSel selectable,
136 const QRegExp & regexp );
139 * Check if a single pkg attribute matches the search criteria.
141 bool check( const string & attribute, const QRegExp & regexp );
144 * Check capability like
145 * zypp::Resolvable::dep( zypp::Dep::PROVIDES ),
146 * zypp::Resolvable::dep( zypp::Dep::REQUIRES )
148 bool check( const zypp::CapSet & capSet, const QRegExp & regexp );
151 * Key press event: Execute search upon 'Return'
152 * Reimplemented from QVBox / QWidget.
154 virtual void keyPressEvent( QKeyEvent * event );
159 QComboBox * _searchText;
160 QPushButton * _searchButton;
162 QCheckBox * _searchInName;
163 QCheckBox * _searchInSummary;
164 QCheckBox * _searchInDescription;
165 QCheckBox * _searchInRequires;
166 QCheckBox * _searchInProvides;
168 QComboBox * _searchMode;
169 QCheckBox * _caseSensitive;
176 #endif // ifndef YQPkgSearchFilterView_h