summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src/customsmiley.h
blob: 173d3ab572cabec6743769bb22904ae39ba021c7 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
Miranda SmileyAdd Plugin
Copyright (C) 2008 - 2011 Boris Krasnovskiy All Rights Reserved

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef SMILEYADD_CUSTOMSMILEY_H_
#define SMILEYADD_CUSTOMSMILEY_H_

class SmileyCType : public SmileyType
{
public:
	SmileyCType(const CMStringW &fullpath, const wchar_t *filepath);

	bool CreateTriggerText(char *text);
};

class SmileyPackCType
{
public:
	typedef SMOBJLIST<SmileyCType> SmileyVectorType;
	typedef SMOBJLIST<SmileyLookup> SmileyLookupType;

private:
	SmileyVectorType m_SmileyList;
	SmileyLookupType m_SmileyLookup;

	MCONTACT m_id;

	void AddTriggersToSmileyLookup(void);

public:
	SmileyVectorType& GetSmileyList(void) { return m_SmileyList; }
	SmileyLookupType& GetSmileyLookup(void) { return m_SmileyLookup; }

	int SmileyCount(void) const { return m_SmileyList.getCount(); }

	SmileyCType* GetSmiley(unsigned index) { return &m_SmileyList[index]; }

	MCONTACT GetId(void) { return m_id; }
	void SetId(MCONTACT id) { m_id = id; }

	bool LoadSmiley(wchar_t *path);
	bool LoadSmileyDir(wchar_t *dir);
};


class SmileyPackCListType 
{
public:
	typedef SMOBJLIST<SmileyPackCType> SmileyPackVectorType;

private:
	SmileyPackVectorType m_SmileyPacks;

public:
	int NumberOfSmileyPacks(void) { return m_SmileyPacks.getCount(); }

	bool AddSmiley(MCONTACT hContact, wchar_t *path);
	bool AddSmileyPack(MCONTACT hContact, wchar_t *dir);

	void ClearAndFreeAll(void) { 	m_SmileyPacks.destroy(); }

	SmileyPackCType* GetSmileyPack(MCONTACT id);
};

extern SmileyPackCListType g_SmileyPackCStore;

#endif