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