1 /* 2 * Copyright 2006, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9 #ifndef MAIN_WINDOW_H 10 #define MAIN_WINDOW_H 11 12 #include <Entry.h> 13 #include <Window.h> 14 15 #include "Observer.h" 16 17 class BMenu; 18 class BMenuBar; 19 class BMenuItem; 20 class CanvasView; 21 class Document; 22 class IconObjectListView; 23 class IconEditorApp; 24 class IconView; 25 class PathListView; 26 class ShapeListView; 27 class StyleListView; 28 class StyleView; 29 class SwatchGroup; 30 class TransformerListView; 31 32 namespace BPrivate { 33 namespace Icon { 34 class Icon; 35 } 36 } 37 using namespace BPrivate::Icon; 38 39 class MultipleManipulatorState; 40 41 enum { 42 MSG_SET_ICON = 'sicn', 43 }; 44 45 class MainWindow : public BWindow, 46 public Observer { 47 public: 48 MainWindow(IconEditorApp* app, 49 Document* document); 50 virtual ~MainWindow(); 51 52 // BWindow interface 53 virtual void MessageReceived(BMessage* message); 54 virtual bool QuitRequested(); 55 virtual void WorkspaceActivated(int32 workspace, 56 bool active); 57 virtual void WorkspacesChanged(uint32 oldWorkspaces, 58 uint32 newWorkspaces); 59 60 // Observer interface 61 virtual void ObjectChanged(const Observable* object); 62 63 // MainWindow 64 void MakeEmpty(); 65 void SetIcon(Icon* icon); 66 67 void StoreSettings(BMessage* archive); 68 void RestoreSettings(BMessage* archive); 69 70 private: 71 void _Init(); 72 void _CreateGUI(BRect frame); 73 BMenuBar* _CreateMenuBar(BRect frame); 74 75 IconEditorApp* fApp; 76 Document* fDocument; 77 Icon* fIcon; 78 79 BMenu* fPathMenu; 80 BMenu* fStyleMenu; 81 BMenu* fShapeMenu; 82 BMenu* fTransformerMenu; 83 BMenu* fPropertyMenu; 84 BMenu* fSwatchMenu; 85 86 BMenuItem* fUndoMI; 87 BMenuItem* fRedoMI; 88 89 CanvasView* fCanvasView; 90 SwatchGroup* fSwatchGroup; 91 StyleView* fStyleView; 92 93 IconView* fIconPreview16Folder; 94 IconView* fIconPreview16Menu; 95 IconView* fIconPreview32Folder; 96 IconView* fIconPreview32Desktop; 97 IconView* fIconPreview48; 98 IconView* fIconPreview64; 99 100 PathListView* fPathListView; 101 StyleListView* fStyleListView; 102 103 ShapeListView* fShapeListView; 104 TransformerListView* fTransformerListView; 105 IconObjectListView* fPropertyListView; 106 107 // TODO: for testing only... 108 MultipleManipulatorState* fState; 109 }; 110 111 #endif // MAIN_WINDOW_H 112