source: filezilla/trunk/fuentes/src/interface/filter_conditions_dialog.h @ 130

Last change on this file since 130 was 130, checked in by jrpelegrina, 4 years ago

First release to xenial

File size: 1.8 KB
Line 
1#ifndef __FILTER_CONDITIONS_DIALOG_H__
2#define __FILTER_CONDITIONS_DIALOG_H__
3
4#include "dialogex.h"
5#include "filter.h"
6#include <set>
7
8class CFilterControls
9{
10public:
11        CFilterControls();
12
13        void Reset();
14
15        wxChoice* pType;
16        wxChoice* pCondition;
17        wxTextCtrl* pValue;
18        wxChoice* pSet;
19        wxStaticText* pLabel;
20        wxButton* pRemove;
21};
22
23class wxCustomHeightListCtrl;
24class CFilterConditionsDialog : public wxDialogEx
25{
26public:
27        CFilterConditionsDialog();
28
29        // has_foreign_type for attributes on MSW, permissions on *nix
30        // has_foreign_type for attributes on *nix, permissions on MSW
31        bool CreateListControl(int conditions);
32
33        void EditFilter(const CFilter& filter);
34        CFilter GetFilter();
35        void ClearFilter(bool disable);
36        bool ValidateFilter(wxString& error, bool allow_empty = false);
37
38private:
39        void CalcMinListWidth();
40
41        enum t_filterType GetTypeFromTypeSelection(int selection);
42        void SetSelectionFromType(wxChoice* pChoice, enum t_filterType);
43
44        void MakeControls(const CFilterCondition& condition, int i = -1);
45        void DestroyControls();
46        void UpdateConditionsClientSize();
47
48        void SetFilterCtrlState(bool disable);
49
50        bool m_has_foreign_type;
51
52        wxCustomHeightListCtrl* m_pListCtrl;
53        wxSize m_lastListSize;
54        int m_choiceBoxHeight;
55
56        std::vector<CFilterControls> m_filterControls;
57
58        CFilter m_currentFilter;
59
60        wxArrayString filterTypes;
61        std::vector<t_filterType> filter_type_map;
62
63        wxButton* m_pAdd;
64        wxSize m_button_size;
65        wxSize m_size_label_size;
66
67        void OnMore();
68        void OnRemove(int item);
69        void OnRemove(const std::set<int> &selected);
70
71        void OnListSize(wxSizeEvent& event);
72
73        DECLARE_EVENT_TABLE()
74        void OnButton(wxCommandEvent& event);
75        void OnFilterTypeChange(wxCommandEvent& event);
76        void OnConditionSelectionChange(wxCommandEvent& event);
77        void OnNavigationKeyEvent(wxNavigationKeyEvent& event);
78};
79
80#endif //__FILTER_CONDITIONS_DIALOG_H__
Note: See TracBrowser for help on using the repository browser.