1/*
2 * Copyright 2013, Stephan A��mus <superstippi@gmx.de>.
3 * Copyright 2018-2021, Andrew Lindesay <apl@lindesay.co.nz>
4 * All rights reserved. Distributed under the terms of the MIT License.
5 */
6#ifndef APP_H
7#define APP_H
8
9
10#include <Application.h>
11
12
13class BEntry;
14class MainWindow;
15
16
17class App : public BApplication {
18public:
19								App();
20	virtual						~App();
21
22	virtual	bool				QuitRequested();
23	virtual	void				ReadyToRun();
24			bool				IsFirstRun();
25
26	virtual	void				MessageReceived(BMessage* message);
27	virtual void				RefsReceived(BMessage* message);
28	virtual void				ArgvReceived(int32 argc, char* argv[]);
29
30private:
31			void				_AlertSimpleError(BMessage* message);
32			void				_Open(const BEntry& entry);
33			void				_ShowWindow(MainWindow* window);
34
35			bool				_LoadSettings(BMessage& settings);
36			void				_StoreSettings(const BMessage& windowSettings);
37
38			void				_CheckPackageDaemonRuns();
39			bool				_LaunchPackageDaemon();
40
41			bool				_CheckTestFile();
42	static	bool				_CheckIsFirstRun();
43			void				_ClearCacheOnVersionChange();
44
45private:
46			MainWindow*			fMainWindow;
47			int32				fWindowCount;
48
49			BMessage			fSettings;
50			bool				fSettingsRead;
51
52			bool				fIsFirstRun;
53};
54
55
56#endif // APP_H
57