xref: /haiku/src/apps/icon-o-matic/MainWindow.h (revision f75a7bf508f3156d63a14f8fd77c5e0ca4d08c42)
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 									const BMessage* settings);
51 	virtual						~MainWindow();
52 
53 	// BWindow interface
54 	virtual	void				MessageReceived(BMessage* message);
55 	virtual	bool				QuitRequested();
56 	virtual	void				WorkspaceActivated(int32 workspace,
57 												   bool active);
58 	virtual	void				WorkspacesChanged(uint32 oldWorkspaces,
59 												  uint32 newWorkspaces);
60 
61 	// Observer interface
62 	virtual	void				ObjectChanged(const Observable* object);
63 
64 	// MainWindow
65 			void				MakeEmpty();
66 			void				SetIcon(Icon* icon);
67 
68 			void				StoreSettings(BMessage* archive);
69 			void				RestoreSettings(const BMessage* archive);
70 
71  private:
72 			void				_Init();
73 			void				_CreateGUI(BRect frame);
74 			BMenuBar*			_CreateMenuBar(BRect frame);
75 
76 			void				_ImproveScrollBarLayout(BView* target);
77 
78 	IconEditorApp*				fApp;
79 	Document*					fDocument;
80 	Icon*						fIcon;
81 
82 	BMenu*						fPathMenu;
83 	BMenu*						fStyleMenu;
84 	BMenu*						fShapeMenu;
85 	BMenu*						fTransformerMenu;
86 	BMenu*						fPropertyMenu;
87 	BMenu*						fSwatchMenu;
88 
89 	BMenuItem*					fUndoMI;
90 	BMenuItem*					fRedoMI;
91 
92 	CanvasView*					fCanvasView;
93 	SwatchGroup*				fSwatchGroup;
94 	StyleView*					fStyleView;
95 
96 	IconView*					fIconPreview16Folder;
97 	IconView*					fIconPreview16Menu;
98 	IconView*					fIconPreview32Folder;
99 	IconView*					fIconPreview32Desktop;
100 	IconView*					fIconPreview48;
101 	IconView*					fIconPreview64;
102 
103 	PathListView*				fPathListView;
104 	StyleListView*				fStyleListView;
105 
106 	ShapeListView*				fShapeListView;
107 	TransformerListView*		fTransformerListView;
108 	IconObjectListView*			fPropertyListView;
109 
110 	// TODO: for testing only...
111 	MultipleManipulatorState*	fState;
112 };
113 
114 #endif // MAIN_WINDOW_H
115