xref: /haiku/headers/private/mail/FileConfigView.h (revision 57b305558b1c3eb23ef00d616a3458a479361732)
1 /*
2  * Copyright 2004-2012, Haiku, Inc. All rights reserved.
3  * Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
4  *
5  * Distributed under the terms of the MIT License.
6  */
7 #ifndef _FILE_CONFIG_VIEW_H
8 #define _FILE_CONFIG_VIEW_H
9 
10 
11 #include <View.h>
12 #include <FilePanel.h>
13 
14 
15 class BButton;
16 class BMailAddOnSettings;
17 class BTextControl;
18 
19 
20 namespace BPrivate {
21 
22 
23 class FileControl : public BView {
24 public:
25 								FileControl(const char* name, const char* label,
26 									const char* pathOfFile = NULL,
27 									uint32 flavors = B_DIRECTORY_NODE);
28 	virtual						~FileControl();
29 
30 	virtual	void				AttachedToWindow();
31 	virtual	void				MessageReceived(BMessage* message);
32 
33 			void				SetText(const char* pathOfFile);
34 			const char*			Text() const;
35 
36 			void				SetEnabled(bool enabled);
37 
38 private:
39 			BTextControl*		fText;
40 			BButton*			fButton;
41 
42 			BFilePanel*			fPanel;
43 
44 			uint32				_reserved[5];
45 };
46 
47 
48 class MailFileConfigView : public FileControl {
49 public:
50 								MailFileConfigView(const char* label,
51 									const char* name, bool useMeta = false,
52 									const char* defaultPath = NULL,
53 									uint32 flavors = B_DIRECTORY_NODE);
54 
55 			void				SetTo(const BMessage* archive,
56 									BMessage* metadata);
57 			status_t			SaveInto(BMailAddOnSettings& settings) const;
58 
59 private:
60 			BMessage*			fMeta;
61 			bool				fUseMeta;
62 			const char*			fName;
63 
64 			uint32				_reserved[5];
65 };
66 
67 
68 }	// namespace BPrivate
69 
70 
71 #endif	// _FILE_CONFIG_VIEW_H
72