summaryrefslogtreecommitdiff
path: root/plugins/XSoundNotify/SoundNotifyDataStorage.h
blob: 7dbf03c494bd016f09f0d8846288b1910b67a26d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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