summaryrefslogtreecommitdiff
path: root/plugins/XSoundNotify/SoundNotifyDataStorage.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/XSoundNotify/SoundNotifyDataStorage.h')
-rw-r--r--plugins/XSoundNotify/SoundNotifyDataStorage.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/XSoundNotify/SoundNotifyDataStorage.h b/plugins/XSoundNotify/SoundNotifyDataStorage.h
new file mode 100644
index 0000000000..7dbf03c494
--- /dev/null
+++ b/plugins/XSoundNotify/SoundNotifyDataStorage.h
@@ -0,0 +1,34 @@
+#ifndef _XSN_DATA_STORAGE
+#define _XSN_DATA_STORAGE
+
+#include "SoundNotifyData.h"
+#include <newpluginapi.h>
+#include <boost/function.hpp>
+
+class SoundNotifyDataStorage
+{
+public:
+ SoundNotifyDataStorage(PLUGINLINK * pl);
+
+ void init();
+ void commit();
+
+ ProtocolTable & getData();
+
+protected:
+ void addContact(HANDLE contact);
+ xsn_string getContactId(HANDLE contact, const ModuleString & module, const ProtocolString & proto);
+ void registerProtocols();
+
+private:
+ PLUGINLINK * pluginLink;
+
+ ProtocolTable _protocolTable;
+ ModuleConvertTable _moduleTable;
+
+ typedef boost::function<xsn_string (HANDLE contact, const ModuleString & module)> getContactIdFunc;
+ typedef std::unordered_map<ProtocolString, getContactIdFunc> RegisteredProtocols;
+ RegisteredProtocols _registeredProtocols;
+};
+
+#endif