1 /* 2 * Copyright 2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef FILE_TYPES_WINDOW_H 6 #define FILE_TYPES_WINDOW_H 7 8 9 #include <Alert.h> 10 #include <Mime.h> 11 #include <Window.h> 12 13 class BBox; 14 class BButton; 15 class BListView; 16 class BMenuField; 17 class BMimeType; 18 class BOutlineListView; 19 class BSplitView; 20 class BTextControl; 21 22 class AttributeListView; 23 class ExtensionListView; 24 class MimeTypeListView; 25 class StringView; 26 class TypeIconView; 27 28 29 class FileTypesWindow : public BWindow { 30 public: 31 FileTypesWindow(const BMessage& settings); 32 virtual ~FileTypesWindow(); 33 34 virtual void MessageReceived(BMessage* message); 35 virtual bool QuitRequested(); 36 37 void PlaceSubWindow(BWindow* window); 38 39 private: 40 BRect _Frame(const BMessage& settings) const; 41 void _ShowSnifferRule(bool show); 42 void _UpdateExtensions(BMimeType* type); 43 void _AdoptPreferredApplication(BMessage* message, bool sameAs); 44 void _UpdatePreferredApps(BMimeType* type); 45 void _UpdateIcon(BMimeType* type); 46 void _SetType(BMimeType* type, int32 forceUpdate = 0); 47 48 private: 49 BMimeType fCurrentType; 50 51 BSplitView* fMainSplitView; 52 53 MimeTypeListView* fTypeListView; 54 BButton* fRemoveTypeButton; 55 56 BBox* fIconBox; 57 TypeIconView* fIconView; 58 59 BBox* fRecognitionBox; 60 StringView* fExtensionLabel; 61 ExtensionListView* fExtensionListView; 62 BButton* fAddExtensionButton; 63 BButton* fRemoveExtensionButton; 64 BTextControl* fRuleControl; 65 66 BBox* fDescriptionBox; 67 StringView* fInternalNameView; 68 BTextControl* fTypeNameControl; 69 BTextControl* fDescriptionControl; 70 71 BBox* fPreferredBox; 72 BMenuField* fPreferredField; 73 BButton* fSelectButton; 74 BButton* fSameAsButton; 75 76 BBox* fAttributeBox; 77 AttributeListView* fAttributeListView; 78 BButton* fAddAttributeButton; 79 BButton* fRemoveAttributeButton; 80 81 BWindow* fNewTypeWindow; 82 }; 83 84 static const uint32 kMsgSelectNewType = 'slnt'; 85 static const uint32 kMsgNewTypeWindowClosed = 'ntwc'; 86 87 #endif // FILE_TYPES_WINDOW_H 88