summaryrefslogtreecommitdiff
path: root/plugins/HistoryStats/src/mirandahistory.h
blob: 4acb356f750493b7eb1fae60606cb6b5a9de7a62 (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
35
36
37
38
39
40
#if !defined(HISTORYSTATS_GUARD_MIRANDAHISTORY_H)
#define HISTORYSTATS_GUARD_MIRANDAHISTORY_H

#include "stdafx.h"

#include <vector>

#include "mirandacontact.h"
#include "settings.h"

class MirandaHistory
	: private pattern::NotCopyable<MirandaHistory>
{
private:
	typedef std::map<ext::a::string, ext::string> ProtocolMap;
	typedef std::vector<MirandaContact*> ContactList;

private:
	const Settings& m_Settings;
	ProtocolMap m_Protocols;
	ext::string m_DefaultProtocol;
	bool m_bContactsAvailable;
	ContactList m_Contacts;

private:
	void populateProtocols();
	const ext::string& getProtocol(const ext::a::string& protocol) const;
	void makeContactsAvailable();
	void readContacts();
	void mergeContacts();

public:
	explicit MirandaHistory(const Settings& settings);
	~MirandaHistory();

	int getContactCount();
	MirandaContact& getContact(int index);
};

#endif // HISTORYSTATS_GUARD_MIRANDAHISTORY_H