Diffstat (limited to 'noncore/apps/tableviewer/ui/tvfilterview.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/tableviewer/ui/tvfilterview.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/noncore/apps/tableviewer/ui/tvfilterview.h b/noncore/apps/tableviewer/ui/tvfilterview.h new file mode 100644 index 0000000..5de87b9 --- a/dev/null +++ b/noncore/apps/tableviewer/ui/tvfilterview.h | |||
@@ -0,0 +1,88 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef Tvfilterview_H | ||
21 | #define Tvfilterview_H | ||
22 | |||
23 | #include "filterkeyentry.h" | ||
24 | #include "../db/common.h" | ||
25 | #include <qlist.h> | ||
26 | #include <qmap.h> | ||
27 | #include <qdialog.h> | ||
28 | |||
29 | class QListViewItem; | ||
30 | class QPushButton; | ||
31 | class QListView; | ||
32 | class TVFilterKeyEntry; | ||
33 | |||
34 | class TVFilterView : public QDialog | ||
35 | { | ||
36 | Q_OBJECT | ||
37 | |||
38 | signals: | ||
39 | void editView(); | ||
40 | void listView(); | ||
41 | void browseView(); | ||
42 | void loadFile(); | ||
43 | |||
44 | protected slots: | ||
45 | void newTerm(); | ||
46 | void deleteTerm(); | ||
47 | void clearTerms(); | ||
48 | void updateTerm(); | ||
49 | void setTerm(QListViewItem *); | ||
50 | |||
51 | public: | ||
52 | TVFilterView(TableState *t, QWidget* parent = 0, const char* name = 0, WFlags fl = 0); | ||
53 | ~TVFilterView(); | ||
54 | |||
55 | /* Access Methods */ | ||
56 | void rebuildKeys(); | ||
57 | void rebuildData(); | ||
58 | void reset(); | ||
59 | |||
60 | bool passesFilter(DataElem *d); | ||
61 | bool filterActive() const; /* return true if and only if filtering is on */ | ||
62 | |||
63 | QListView* display; | ||
64 | QPushButton* newFilterButton; | ||
65 | QPushButton* deleteFilterButton; | ||
66 | QPushButton* clearFilterButton; | ||
67 | QComboBox* keyNameCombo; | ||
68 | |||
69 | TVFilterKeyEntry* keyEntry; | ||
70 | private: | ||
71 | |||
72 | typedef struct _FilterTerm { | ||
73 | int keyIndex; | ||
74 | CmpType ct; | ||
75 | TVVariant value; | ||
76 | QListViewItem *view; | ||
77 | } FilterTerm; | ||
78 | |||
79 | QList<FilterTerm> terms; | ||
80 | FilterTerm *current; | ||
81 | bool do_filter; | ||
82 | |||
83 | TableState *ts; | ||
84 | |||
85 | QMap<int, int> keyIds; | ||
86 | }; | ||
87 | |||
88 | #endif | ||