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