xref: /haiku/headers/private/debugger/settings/TeamSettings.h (revision fce4895d1884da5ae6fb299d23c735c598e690b1)
1 /*
2  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Copyright 2013-2015, Rene Gollent, rene@gollent.com.
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef TEAM_SETTINGS_H
7 #define TEAM_SETTINGS_H
8 
9 
10 #include <String.h>
11 
12 #include <ObjectList.h>
13 
14 
15 class BMessage;
16 class BreakpointSetting;
17 class Team;
18 class TeamFileManagerSettings;
19 class TeamSignalSettings;
20 class TeamUiSettings;
21 class TeamUiSettingsFactory;
22 
23 
24 class TeamSettings {
25 public:
26 								TeamSettings();
27 								TeamSettings(const TeamSettings& other);
28 									// throws std::bad_alloc
29 								~TeamSettings();
30 
31 			status_t			SetTo(Team* team);
32 			status_t			SetTo(const BMessage& archive,
33 									const TeamUiSettingsFactory& factory);
34 			status_t			WriteTo(BMessage& archive) const;
35 
TeamName()36 			const BString&		TeamName() const	{ return fTeamName; }
37 
38 			int32				CountBreakpoints() const;
39 			const BreakpointSetting* BreakpointAt(int32 index) const;
40 
41 			int32				CountUiSettings() const;
42 			const TeamUiSettings*	UiSettingAt(int32 index) const;
43 			const TeamUiSettings*	UiSettingFor(const char* id) const;
44 			status_t			AddUiSettings(TeamUiSettings* settings);
45 
46 			TeamSettings&		operator=(const TeamSettings& other);
47 									// throws std::bad_alloc
48 
49 			TeamFileManagerSettings*
50 								FileManagerSettings() const;
51 			status_t			SetFileManagerSettings(
52 									TeamFileManagerSettings* settings);
53 
54 			TeamSignalSettings* SignalSettings() const;
55 			status_t			SetSignalSettings(
56 									TeamSignalSettings* settings);
57 
58 private:
59 			typedef BObjectList<BreakpointSetting> BreakpointList;
60 			typedef BObjectList<TeamUiSettings> UiSettingsList;
61 
62 private:
63 			void				_Unset();
64 
65 private:
66 			BreakpointList		fBreakpoints;
67 			UiSettingsList		fUiSettings;
68 			TeamFileManagerSettings*
69 								fFileManagerSettings;
70 			TeamSignalSettings*	fSignalSettings;
71 			BString				fTeamName;
72 };
73 
74 
75 #endif	// TEAM_SETTINGS_H
76