xref: /haiku/src/apps/icon-o-matic/IconEditorApp.h (revision 61ee19d10fcc38e93a80a29b90efe6e4e15604df)
1 /*
2  * Copyright 2006, 2011, Stephan Aßmus <superstippi@gmx.de>.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef ICON_EDITOR_APP_H
6 #define ICON_EDITOR_APP_H
7 
8 
9 #include <Application.h>
10 #include <String.h>
11 
12 
13 class BFilePanel;
14 class MainWindow;
15 class SavePanel;
16 
17 
18 enum {
19 	MSG_NEW							= 'newi',
20 	MSG_SAVE_AS						= 'svas',
21 	MSG_EXPORT_AS					= 'xpas',
22 	MSG_WINDOW_CLOSED				= 'wndc',
23 };
24 
25 
26 enum {
27 	EXPORT_MODE_MESSAGE = 0,
28 	EXPORT_MODE_FLAT_ICON,
29 	EXPORT_MODE_SVG,
30 	EXPORT_MODE_BITMAP_16,
31 	EXPORT_MODE_BITMAP_32,
32 	EXPORT_MODE_BITMAP_64,
33 	EXPORT_MODE_BITMAP_SET,
34 	EXPORT_MODE_ICON_ATTR,
35 	EXPORT_MODE_ICON_MIME_ATTR,
36 	EXPORT_MODE_ICON_RDEF,
37 	EXPORT_MODE_ICON_SOURCE,
38 };
39 
40 
41 typedef enum {
42 	LAST_PATH_OPEN = 0,
43 	LAST_PATH_SAVE,
44 	LAST_PATH_EXPORT,
45 } path_kind;
46 
47 
48 class IconEditorApp : public BApplication {
49 public:
50 								IconEditorApp();
51 	virtual						~IconEditorApp();
52 
53 	// BApplication interface
54 	virtual	bool				QuitRequested();
55 	virtual	void				MessageReceived(BMessage* message);
56 	virtual	void				ReadyToRun();
57 	virtual	void				RefsReceived(BMessage* message);
58 	virtual	void				ArgvReceived(int32 argc, char** argv);
59 
60 	// IconEditorApp
61 
62 private:
63 			MainWindow*			_NewWindow();
64 
65 			void				_SyncPanels(BFilePanel* from,
66 											BFilePanel* to);
67 
68 			const char*			_LastFilePath(path_kind which);
69 
70 			void				_StoreSettings();
71 			void				_RestoreSettings();
72 			void				_InstallDocumentMimeType();
73 
74 private:
75 			int32				fWindowCount;
76 			BMessage			fLastWindowSettings;
77 			BRect				fLastWindowFrame;
78 
79 			BFilePanel*			fOpenPanel;
80 			SavePanel*			fSavePanel;
81 
82 			BString				fLastOpenPath;
83 			BString				fLastSavePath;
84 			BString				fLastExportPath;
85 };
86 
87 
88 #endif // ICON_EDITOR_APP_H
89