xref: /haiku/src/apps/showimage/ShowImageApp.h (revision be63ec85a81119bc21734d0c4dc7f2b150433ed3)
1 /*
2  * Copyright 2003-2010, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Fernando Francisco de Oliveira
7  *		Michael Wilber
8  *		Michael Pfeiffer
9  */
10 #ifndef SHOW_IMAGE_APP_H
11 #define SHOW_IMAGE_APP_H
12 
13 
14 #include "ImageCache.h"
15 #include "ShowImageSettings.h"
16 
17 #include <Application.h>
18 #include <FilePanel.h>
19 
20 
21 enum {
22 	MSG_FILE_OPEN				= 'mFOP',
23 };
24 
25 
26 class ShowImageApp : public BApplication {
27 public:
28 								ShowImageApp();
29 	virtual						~ShowImageApp();
30 
31 	virtual	void				ArgvReceived(int32 argc, char** argv);
32 	virtual	void				ReadyToRun();
33 	virtual	void				MessageReceived(BMessage* message);
34 	virtual	void				Pulse();
35 	virtual	void				RefsReceived(BMessage* message);
36 	virtual	bool				QuitRequested();
37 
Settings()38 			ShowImageSettings* 	Settings() { return &fSettings; }
DefaultCache()39 			ImageCache& 		DefaultCache() { return fImageCache; }
40 
41 private:
42 			void				_StartPulse();
43 			void				_Open(const entry_ref& ref,
44 									const BMessenger& trackerMessenger);
45 			void				_BroadcastToWindows(BMessage* message);
46 			void				_CheckClipboard();
47 			void				_UpdateLastWindowFrame();
48 
49 private:
50 			BFilePanel*			fOpenPanel;
51 			bool				fPulseStarted;
52 			ShowImageSettings	fSettings;
53 			ImageCache			fImageCache;
54 			BRect				fLastWindowFrame;
55 };
56 
57 
58 extern const char* kApplicationSignature;
59 
60 #define my_app dynamic_cast<ShowImageApp*>(be_app)
61 
62 
63 #endif	// SHOW_IMAGE_APP_H
64