1 /* 2 * Copyright 2011, Rene Gollent, rene@gollent.com. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef GUI_TEAM_UI_SETTINGS_H 6 #define GUI_TEAM_UI_SETTINGS_H 7 8 9 #include <Message.h> 10 #include <String.h> 11 12 #include <ObjectList.h> 13 14 #include "Setting.h" 15 #include "TeamUiSettings.h" 16 17 18 class GuiTeamUiSettings : public TeamUiSettings { 19 public: 20 GuiTeamUiSettings(); 21 GuiTeamUiSettings(const char* settingsID); 22 GuiTeamUiSettings(const GuiTeamUiSettings& 23 other); 24 // throws std::bad_alloc 25 ~GuiTeamUiSettings(); 26 27 virtual team_ui_settings_type Type() const; 28 virtual const char* ID() const; 29 virtual status_t SetTo(const BMessage& archive); 30 virtual status_t WriteTo(BMessage& archive) const; 31 virtual TeamUiSettings* Clone() const; 32 33 bool AddSettings(const char* settingID, 34 const BMessage& data); 35 status_t Settings(const char* settingID, 36 BMessage& data) const; 37 38 const BMessage& Values() const; 39 40 GuiTeamUiSettings& operator=(const GuiTeamUiSettings& other); 41 // throws std::bad_alloc 42 43 private: 44 45 status_t _SetTo(const GuiTeamUiSettings& other); 46 void _Unset(); 47 48 BMessage fValues; 49 BString fID; 50 }; 51 52 53 #endif // GUI_TEAM_UI_SETTINGS_H 54