libyui-ncurses-pkg
Loading...
Searching...
No Matches
NCPkgFilterSearch.h
1/*
2 Copyright (c) [2002-2011] 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 File: NCPkgFilterSearch.h
19 Author: Gabriele Strattner <gs@suse.de>
20
21*/
22
23
24#ifndef NCPkgFilterSearch_h
25#define NCPkgFilterSearch_h
26
27#include <iosfwd>
28#include <vector>
29#include <string>
30#include <set>
31
32#include <yui/ncurses/NCCheckBox.h>
33#include <yui/ncurses/NCComboBox.h>
34#include <yui/ncurses/NCInputField.h>
35#include <yui/ncurses/NCLabel.h>
36#include <yui/ncurses/NCLayoutBox.h>
37#include <yui/ncurses/NCPopup.h>
38#include <yui/ncurses/NCPushButton.h>
39#include <yui/ncurses/NCRichText.h>
40
41
43
45//
46// CLASS NAME : NCPkgFilterSearch
47//
48// DESCRIPTION :
49//
50class NCPkgFilterSearch : public NCLayoutBox
51{
52 NCPkgFilterSearch & operator=( const NCPkgFilterSearch & );
54
55private:
56
57 enum SearchMode
58 {
59 Contains = 0,
60 BeginsWith,
61 ExactMatch,
62 UseWildcard,
63 UseRegexp
64 };
65
66 NCInputField * searchExpr;
67 NCCheckBox * ignoreCase;
68 NCComboBox * searchMode;
69
70 NCPackageSelector * packager; // connection to the package selector
71
72 bool getCheckBoxValue( NCCheckBox * checkBox );
73
74protected:
75
76 std::string getSearchExpression() const;
77
78public:
79
80 NCPkgFilterSearch( YWidget *parent, YUIDimension dim, NCPackageSelector *pkger );
81 virtual ~NCPkgFilterSearch();
82
83 void createLayout( YWidget *parent );
84
85 virtual bool showSearchResultPackages();
86
87 bool match ( std::string s1, std::string s2, bool ignoreCase );
88
89 bool fillSearchList( std::string & expr, bool ignoreCase );
90
91 NCInputField * getSearchField() { return searchExpr; }
92
93};
94
96
97
98#endif // NCPkgFilterSearch_h
Definition NCPackageSelector.h:105
Definition NCPkgFilterSearch.h:51