From 397e25f2b71347c7c83495fe5b25496ff3b02b75 Mon Sep 17 00:00:00 2001 From: Philip Schell Date: Sat, 19 Oct 2013 13:05:02 +0000 Subject: WinterSpeak: ticket:269 WinterSpeak now rewritten git-svn-id: http://svn.miranda-ng.org/main/trunk@6532 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/WinterSpeak/src/ConfigDatabase.h | 79 ++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 plugins/WinterSpeak/src/ConfigDatabase.h (limited to 'plugins/WinterSpeak/src/ConfigDatabase.h') diff --git a/plugins/WinterSpeak/src/ConfigDatabase.h b/plugins/WinterSpeak/src/ConfigDatabase.h new file mode 100644 index 0000000000..5682abf0f0 --- /dev/null +++ b/plugins/WinterSpeak/src/ConfigDatabase.h @@ -0,0 +1,79 @@ +#pragma once + +#include +#include "voice_desc.h" +#include "Subject.h" + +class ConfigDatabase : public Subject +{ +public: + ConfigDatabase(void); + ~ConfigDatabase(void); + + enum ActiveFlag + { + ActiveFlag_Online = 1, + ActiveFlag_Away, + ActiveFlag_Dnd, + ActiveFlag_Na, + ActiveFlag_Occupied, + ActiveFlag_FreeForChat, + ActiveFlag_Invisible + }; + + struct act { + bool status; + bool message; + }; + + typedef std::map ActiveUsersMap; + + //-------------------------------------------------------------------------- + // Description : get/set the voice description + //-------------------------------------------------------------------------- + VoiceDesc getVoiceDesc() const { return m_voice_desc; } + void setVoiceDesc(const VoiceDesc &desc) { m_voice_desc = desc; } + + //-------------------------------------------------------------------------- + // Description : get/set the welcome message + //-------------------------------------------------------------------------- + const std::wstring & getWelcomeMessage() const { return m_welcome_msg; } + void setWelcomeMessage(const std::wstring &msg) { m_welcome_msg = msg; } + + //-------------------------------------------------------------------------- + // Description : get/set an status flags + //-------------------------------------------------------------------------- + bool getActiveFlag(ActiveFlag flag) const; + void setActiveFlag(ActiveFlag flag, bool state); + + //-------------------------------------------------------------------------- + // Description : get/set the user active flag + //-------------------------------------------------------------------------- + act getActiveUser(HANDLE user) const; + void setActiveUser(HANDLE user, act state); + ActiveUsersMap getActiveUsers() const { return m_active_users; } + + //-------------------------------------------------------------------------- + // Description : load/save the settings from the miranda database + //-------------------------------------------------------------------------- + void load(); + void save(); + + private: + //-------------------------------------------------------------------------- + // Description : For some reason this isn't implemented in miranda yet + // Just get a string from the db + // Parameters : szModule - the entrys' module + // szSetting - the entrys' setting + // def - default string if entry doesn't exist + //-------------------------------------------------------------------------- + static std::wstring DBGetContactSettingString(const char *szModule, + const char *szSetting, const WCHAR *def); + + VoiceDesc m_voice_desc; + unsigned int m_active_flags; + std::wstring m_welcome_msg; + //std::string m_welcome_msg; + ActiveUsersMap m_active_users; +}; + -- cgit v1.2.3