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