TeamSettings.h revision fce4895d
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
15class BMessage;
16class BreakpointSetting;
17class Team;
18class TeamFileManagerSettings;
19class TeamSignalSettings;
20class TeamUiSettings;
21class TeamUiSettingsFactory;
22
23
24class TeamSettings {
25public:
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
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
58private:
59			typedef BObjectList<BreakpointSetting> BreakpointList;
60			typedef BObjectList<TeamUiSettings> UiSettingsList;
61
62private:
63			void				_Unset();
64
65private:
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