xref: /haiku/headers/private/mail/FileConfigView.h (revision 95bac3fda53a4cb21880712d7b43f8c21db32a2e)
1 #ifndef FILE_CONFIG_VIEW
2 #define FILE_CONFIG_VIEW
3 /* FileConfigView - a file configuration view for filters
4 **
5 ** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
6 */
7 
8 
9 #include <View.h>
10 #include <FilePanel.h>
11 
12 class BTextControl;
13 class BButton;
14 
15 class BFileControl : public BView
16 {
17 	public:
18 		BFileControl(BRect rect,const char *name,const char *label,const char *pathOfFile = NULL,uint32 flavors = B_DIRECTORY_NODE);
19 		~BFileControl();
20 
21 		virtual void AttachedToWindow();
22 		virtual void MessageReceived(BMessage *msg);
23 
24 		void SetText(const char *pathOfFile);
25 		const char *Text() const;
26 
27 		void SetEnabled(bool enabled);
28 
29 		virtual	void GetPreferredSize(float *width, float *height);
30 
31 	private:
32 		BTextControl	*fText;
33 		BButton			*fButton;
34 
35 		BFilePanel		*fPanel;
36 
37 		uint32			_reserved[5];
38 };
39 
40 class BMailFileConfigView : public BFileControl
41 {
42 	public:
43 		BMailFileConfigView(const char *label,const char *name,bool useMeta = false,const char *defaultPath = NULL,uint32 flavors = B_DIRECTORY_NODE);
44 
45 		void SetTo(BMessage *archive,BMessage *metadata);
46 		virtual	status_t Archive(BMessage *into,bool deep = true) const;
47 
48 	private:
49 		BMessage	*fMeta;
50 		bool		fUseMeta;
51 		const char	*fName;
52 
53 		uint32			_reserved[5];
54 };
55 
56 #endif	/* FILE_CONFIG_VIEW */
57