xref: /haiku/src/preferences/mail/FilterConfigView.h (revision d26fee1afb9b3f3fdee2ca569b4944c3ad377d39)
1 /*
2  * Copyright 2007-2011, 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 <Box.h>
14 #include <Button.h>
15 #include <image.h>
16 #include <ListView.h>
17 #include <Message.h>
18 #include <MenuField.h>
19 
20 #include "FilterAddonList.h"
21 #include "MailSettings.h"
22 
23 
24 class FilterConfigBox;
25 
26 
27 class FiltersConfigView : public BBox {
28 public:
29 								FiltersConfigView(BRect rect,
30 									BMailAccountSettings& account);
31 								~FiltersConfigView();
32 
33 			void				AttachedToWindow();
34 			void				DetachedFromWindow();
35 			void				MessageReceived(BMessage *msg);
36 
37 private:
38 			MailAddonSettings*	_GetCurrentMailSettings();
39 			FilterAddonList*	_GetCurrentFilterAddonList();
40 
41 			void				_SelectFilter(int32 index);
42 			void				_SetDirection(direction direction);
43 			void				_SaveConfig(int32 index);
44 
45 			BMailAccountSettings&	fAccount;
46 			direction			fDirection;
47 
48 			FilterAddonList		fInboundFilters;
49 			FilterAddonList		fOutboundFilters;
50 
51 			BMenuField*			fChainsField;
52 			BListView*			fListView;
53 			BMenuField*			fAddField;
54 			BButton*			fRemoveButton;
55 			FilterConfigBox*	fFilterView;
56 
57 			int32				fCurrentIndex;
58 };
59 
60 #endif //FILTER_CONFIG_VIEW_H
61