vfs: check userland buffers before reading them.
[haiku.git] / headers / private / mail / FileConfigView.h
blob2f436670f5b172a331e53ba77e2d16b09cb52076
1 /*
2 * Copyright 2004-2012, Haiku, Inc. All rights reserved.
3 * Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
5 * Distributed under the terms of the MIT License.
6 */
7 #ifndef _FILE_CONFIG_VIEW_H
8 #define _FILE_CONFIG_VIEW_H
11 #include <View.h>
12 #include <FilePanel.h>
15 class BButton;
16 class BMailAddOnSettings;
17 class BTextControl;
20 namespace BPrivate {
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();
30 virtual void AttachedToWindow();
31 virtual void MessageReceived(BMessage* message);
33 void SetText(const char* pathOfFile);
34 const char* Text() const;
36 void SetEnabled(bool enabled);
38 private:
39 BTextControl* fText;
40 BButton* fButton;
42 BFilePanel* fPanel;
44 uint32 _reserved[5];
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);
55 void SetTo(const BMessage* archive,
56 BMessage* metadata);
57 status_t SaveInto(BMailAddOnSettings& settings) const;
59 private:
60 BMessage* fMeta;
61 bool fUseMeta;
62 const char* fName;
64 uint32 _reserved[5];
68 } // namespace BPrivate
71 #endif // _FILE_CONFIG_VIEW_H