xref: /haiku/src/preferences/mail/FilterConfigView.h (revision 1deede7388b04dbeec5af85cae7164735ea9e70d)
1 /*
2  * Copyright 2007-2016, Haiku, Inc. All rights reserved.
3  * Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved.
4  * Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
5  * Distributed under the terms of the MIT License.
6  */
7 #ifndef FILTER_CONFIG_VIEW_H
8 #define FILTER_CONFIG_VIEW_H
9 
10 
11 #include <vector>
12 
13 #include <Button.h>
14 #include <GroupView.h>
15 #include <ListView.h>
16 #include <MailSettings.h>
17 #include <Message.h>
18 #include <MenuField.h>
19 
20 #include "FilterList.h"
21 
22 
23 class FilterSettingsView;
24 
25 
26 class FiltersConfigView : public BGroupView {
27 public:
28 								FiltersConfigView(
29 									BMailAccountSettings& account);
30 								~FiltersConfigView();
31 
32 			void				AttachedToWindow();
33 			void				DetachedFromWindow();
34 			void				MessageReceived(BMessage *msg);
35 
36 private:
37 			BMailProtocolSettings* _MailSettings();
38 			::FilterList*		_FilterList();
39 
40 			void				_SelectFilter(int32 index);
41 			void				_SetDirection(direction direction);
42 			void				_SaveConfig(int32 index);
43 
44 private:
45 			BMailAccountSettings& fAccount;
46 			direction			fDirection;
47 
48 			::FilterList		fInboundFilters;
49 			::FilterList		fOutboundFilters;
50 
51 			BMenuField*			fChainsField;
52 			BListView*			fListView;
53 			BMenuField*			fAddField;
54 			BButton*			fRemoveButton;
55 			FilterSettingsView*	fFilterView;
56 
57 			int32				fCurrentIndex;
58 };
59 
60 
61 #endif // FILTER_CONFIG_VIEW_H
62