xref: /haiku/src/apps/debugger/user_interface/gui/teams_window/TeamsWindow.h (revision 365840af1c80fd7fd2f761b66001f0b212126724)
1 /*
2  * Copyright 2009-2010, Philippe Houdoin, phoudoin@haiku-os.org. All rights reserved.
3  * Copyright 2016, Rene Gollent, rene@gollent.com.
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef TEAMS_WINDOW_H
7 #define TEAMS_WINDOW_H
8 
9 
10 #include <Window.h>
11 
12 #include <util/DoublyLinkedList.h>
13 
14 
15 class BButton;
16 class BListView;
17 class BFile;
18 class BFilePanel;
19 class BMenuField;
20 class BMessage;
21 class SettingsManager;
22 class TargetHostInterface;
23 class TeamsListView;
24 
25 
26 class TeamsWindow : public BWindow {
27 public:
28 	class Listener;
29 
30 								TeamsWindow(SettingsManager* settingsManager);
31 	virtual						~TeamsWindow();
32 
33 	static	TeamsWindow*		Create(SettingsManager* settingsManager);
34 									// throws
35 
36 	virtual	void				Zoom(BPoint origin, float width, float height);
37 	virtual void				MessageReceived(BMessage* message);
38 	virtual bool				QuitRequested();
39 
40 			void				AddListener(Listener* listener);
41 			void				RemoveListener(Listener* listener);
42 
43 private:
44 			typedef DoublyLinkedList<Listener> ListenerList;
45 
46 private:
47 			void				_Init();
48 			status_t			_OpenSettings(BFile& file, uint32 mode);
49 			status_t			_LoadSettings(BMessage& settings);
50 			status_t			_SaveSettings();
51 
52 			void				_NotifySelectedInterfaceChanged(
53 									TargetHostInterface* interface);
54 
55 private:
56 			team_id				fCurrentTeam;
57 			TargetHostInterface* fTargetHostInterface;
58 			TeamsListView*		fTeamsListView;
59 			BButton*			fAttachTeamButton;
60 			BButton*			fCreateTeamButton;
61 			BButton*			fCreateConnectionButton;
62 			BButton*			fLoadCoreButton;
63 			BMenuField*			fConnectionField;
64 			BFilePanel*			fCoreSelectionPanel;
65 			SettingsManager*	fSettingsManager;
66 			ListenerList		fListeners;
67 };
68 
69 
70 class TeamsWindow::Listener : public DoublyLinkedListLinkImpl<Listener>
71 {
72 public:
73 	virtual						~Listener();
74 
75 	virtual	void				SelectedInterfaceChanged(
76 									TargetHostInterface* interface) = 0;
77 };
78 
79 
80 #endif	// TEAMS_WINDOW_H
81