xref: /haiku/src/preferences/mail/ConfigViews.h (revision 24159a0c7d6d6dcba9f2a0c1a7c08d2c8167f21b)
1 #ifndef CONFIG_VIEWS_H
2 #define CONFIG_VIEWS_H
3 /* ConfigViews - config views for the account, protocols, and filters
4 **
5 ** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
6 */
7 
8 
9 #include <interface/Box.h>
10 #include <kernel/image.h>
11 
12 class BTextControl;
13 class BListView;
14 class BMenuField;
15 class BButton;
16 
17 class BMailChain;
18 
19 class Account;
20 
21 
22 class AccountConfigView : public BBox
23 {
24 	public:
25 		AccountConfigView(BRect rect,Account *account);
26 
27 		virtual void DetachedFromWindow();
28 		virtual void AttachedToWindow();
29 		virtual void MessageReceived(BMessage *msg);
30 
31 		void UpdateViews();
32 
33 	private:
34 		BTextControl	*fNameControl, *fRealNameControl, *fReturnAddressControl;
35 		BMenuField		*fTypeField;
36 		Account			*fAccount;
37 };
38 
39 
40 //--------------------------------------------------------------------------------
41 
42 class ProtocolsConfigView;
43 class FiltersConfigView;
44 
45 class FilterConfigView : public BBox
46 {
47 	public:
48 		FilterConfigView(BMailChain *chain,int32 index,BMessage *msg,entry_ref *ref);
49 		~FilterConfigView();
50 
51 		status_t InitCheck();
52 
53 		virtual void DetachedFromWindow();
54 		virtual void AttachedToWindow();
55 
56 	protected:
57 		friend class FiltersConfigView;
58 
59 		void		Load(BMessage *msg,entry_ref *ref);
60 		void		Remove(bool deleteMessage = true);
61 
62 		BView		*fConfigView;
63 
64 		BMailChain *fChain;
65 		int32		fIndex;
66 		BMessage	*fMessage;
67 		entry_ref	*fEntryRef;
68 		image_id	fImage;
69 };
70 
71 
72 //--------------------------------------------------------------------------------
73 
74 
75 class ProtocolsConfigView : public FilterConfigView
76 {
77 	public:
78 		ProtocolsConfigView(BMailChain *chain, int32 index, BMessage *msg, entry_ref *ref);
79 
80 		void AttachedToWindow();
81 		void MessageReceived(BMessage *msg);
82 
83 	private:
84 		BMenuField	*fProtocolsMenuField;
85 };
86 
87 
88 //--------------------------------------------------------------------------------
89 
90 
91 class FiltersConfigView : public BBox
92 {
93 	public:
94 		FiltersConfigView(BRect rect,Account *account);
95 		~FiltersConfigView();
96 
97 		virtual void	AttachedToWindow();
98 //		virtual void	DetachedFromWindow();
99 		virtual void	MessageReceived(BMessage *msg);
100 
101 	private:
102 		void			SelectFilter(int32 index);
103 		void			SetTo(BMailChain *chain);
104 
105 		Account				*fAccount;
106 		BMailChain			*fChain;
107 		int32				fFirst, fLast;
108 
109 		BMenuField			*fChainsField;
110 		BListView			*fListView;
111 		BMenuField			*fAddField;
112 		BButton				*fRemoveButton;
113 		FilterConfigView	*fFilterView;
114 };
115 
116 #endif	/* CONFIG_VIEWS_H */
117