xref: /haiku/src/apps/activitymonitor/ActivityWindow.h (revision 4720c31bb08f5c6d1c8ddb616463c6fba9b350a1)
1 /*
2  * Copyright 2008-2009, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef ACTIVITY_WINDOW_H
6 #define ACTIVITY_WINDOW_H
7 
8 
9 #include <Messenger.h>
10 #include <Window.h>
11 
12 class BFile;
13 class BGroupLayout;
14 class BMenuItem;
15 class ActivityView;
16 
17 
18 class ActivityWindow : public BWindow {
19 public:
20 						ActivityWindow();
21 	virtual				~ActivityWindow();
22 
23 	virtual void		MessageReceived(BMessage* message);
24 	virtual bool		QuitRequested();
25 
26 			int32		ActivityViewCount() const;
27 			ActivityView* ActivityViewAt(int32 index) const;
28 			void		BroadcastToActivityViews(BMessage* message,
29 							BView* exceptToView = NULL);
30 
31 			bigtime_t	RefreshInterval() const;
32 
33 private:
34 			status_t	_OpenSettings(BFile& file, uint32 mode);
35 			status_t	_LoadSettings(BMessage& settings);
36 			status_t	_SaveSettings();
37 
38 			void		_AddDefaultView();
39 			void		_MessageDropped(BMessage *message);
40 
41 #ifdef __HAIKU__
42 	BGroupLayout*	fLayout;
43 #endif
44 	BMessenger		fSettingsWindow;
45 };
46 
47 static const uint32 kMsgRemoveView = 'rmvw';
48 
49 #endif	// ACTIVITY_WINDOW_H
50