FileConfigView.h revision 715bf3d1
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
15class BTextControl;
16class BButton;
17
18
19namespace BPrivate {
20
21
22class FileControl : public BView {
23public:
24								FileControl(const char* name, const char* label,
25									const char* pathOfFile = NULL,
26									uint32 flavors = B_DIRECTORY_NODE);
27	virtual						~FileControl();
28
29	virtual	void				AttachedToWindow();
30	virtual	void				MessageReceived(BMessage* message);
31
32			void				SetText(const char* pathOfFile);
33			const char*			Text() const;
34
35			void				SetEnabled(bool enabled);
36
37private:
38			BTextControl*		fText;
39			BButton*			fButton;
40
41			BFilePanel*			fPanel;
42
43			uint32				_reserved[5];
44};
45
46
47class MailFileConfigView : public FileControl {
48public:
49								MailFileConfigView(const char* label,
50									const char* name, bool useMeta = false,
51									const char* defaultPath = NULL,
52									uint32 flavors = B_DIRECTORY_NODE);
53
54			void				SetTo(const BMessage* archive,
55									BMessage* metadata);
56	virtual	status_t			Archive(BMessage* into, bool deep = true) const;
57
58private:
59			BMessage*			fMeta;
60			bool				fUseMeta;
61			const char*			fName;
62
63			uint32				_reserved[5];
64};
65
66
67}	// namespace BPrivate
68
69
70#endif	// _FILE_CONFIG_VIEW_H
71