1 /* 2 * Copyright 2006, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9 #ifndef EXPORT_SAVE_PANEL_H 10 #define EXPORT_SAVE_PANEL_H 11 12 #include <FilePanel.h> 13 #include <MenuItem.h> 14 #include <TranslationDefs.h> 15 #include <String.h> 16 17 class BButton; 18 class BMenuField; 19 class BPopUpMenu; 20 class BWindow; 21 22 class SaveItem : public BMenuItem { 23 public: 24 SaveItem(const char* name, 25 BMessage* message, 26 uint32 exportMode); 27 ExportMode()28 uint32 ExportMode() const 29 { return fExportMode; } 30 31 private: 32 uint32 fExportMode; 33 }; 34 35 class SavePanel : public BFilePanel, 36 public BHandler { 37 public: 38 SavePanel(const char* name, 39 BMessenger* target = NULL, 40 entry_ref* startDirectory = NULL, 41 uint32 nodeFlavors = 0, 42 bool allowMultipleSelection = true, 43 BMessage* message = NULL, 44 BRefFilter *filter = NULL, 45 bool modal = false, 46 bool hideWhenDone = true); 47 virtual ~SavePanel(); 48 49 // BFilePanel 50 virtual void SendMessage(const BMessenger* messenger, 51 BMessage* message); 52 // BHandler 53 virtual void MessageReceived(BMessage* message); 54 55 // SavePanel 56 // setting and retrieving settings 57 void SetExportMode(bool exportMode); 58 void SetExportMode(int32 mode); 59 int32 ExportMode() const; 60 61 void AdjustExtension(); 62 63 private: 64 SaveItem* _GetCurrentMenuItem() const; 65 void _BuildMenu(); 66 void _ExportSettings(); 67 void _EnableSettings() const; 68 69 BWindow* fConfigWindow; 70 BPopUpMenu* fFormatM; 71 BMenuField* fFormatMF; 72 73 BButton* fSettingsB; 74 75 SaveItem* fNativeMI; 76 SaveItem* fHVIFMI; 77 SaveItem* fRDefMI; 78 SaveItem* fSourceMI; 79 SaveItem* fSVGMI; 80 SaveItem* fBitmap16MI; 81 SaveItem* fBitmap32MI; 82 SaveItem* fBitmap64MI; 83 SaveItem* fBitmapSetMI; 84 SaveItem* fIconAttrMI; 85 SaveItem* fIconMimeAttrMI; 86 87 int32 fExportMode; 88 }; 89 90 #endif // EXPORT_SAVE_PANEL_H 91