summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_clist.h
blob: db9ba3fd6767263379a96e631ec28673372af8b4 (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*

Miranda NG: the free IM client for Microsoft* Windows*

Copyright (ñ) 2012-16 Miranda NG project (http://miranda-ng.org),
Copyright (c) 2000-08 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.

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; either version 2
of the License, or (at your option) any later version.

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, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#pragma once

#ifndef _CLIST_H_
#define _CLIST_H_

void LoadContactTree(void);
HTREEITEM GetTreeItemByHContact(MCONTACT hContact);
int GetContactInfosForSort(MCONTACT hContact, char **Proto, wchar_t **Name, int *Status);

///////////////////////////////////////////////////////////////////////////////

class CSmileyString
{
public:
	SortedList*	plText;
	int			iMaxSmileyHeight;

	CSmileyString() : plText(NULL), iMaxSmileyHeight(0) {};
	CSmileyString(const CSmileyString& ssIn)
	{
		_CopySmileyList(ssIn.plText);
		iMaxSmileyHeight = ssIn.iMaxSmileyHeight;
	}

	CSmileyString& operator= (const CSmileyString& ssIn)
	{
		DestroySmileyList();
		_CopySmileyList(ssIn.plText);
		iMaxSmileyHeight = ssIn.iMaxSmileyHeight;
		return *this;
	}

	~CSmileyString()
	{
		DestroySmileyList();
	}

	void ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, wchar_t *szText, BOOL replace_smileys);

	/**	Destroy smiley list */
	void DestroySmileyList();
	/**  Copy Smiley List */
	void _CopySmileyList(SortedList *plInput);
	void AddListeningToIcon(ClcData *dat, wchar_t *szText);

};

///////////////////////////////////////////////////////////////////////////////

struct ClcCacheEntry : public ClcCacheEntryBase
{
	int      m_bNoHiddenOffline;

	int      m_iStatus;
	char*    m_pszProto;
	bool     m_bIsSub;
	bool     m_bIsUnknown;

	int      ApparentMode;
	int      NotOnList;
	int      IdleTS;
	void*    ClcContact;
	int      IsExpanded;

	wchar_t*   szSecondLineText;
	CSmileyString ssSecondLine;

	wchar_t*   szThirdLineText;
	CSmileyString ssThirdLine;

	HANDLE   hTimeZone;
	DWORD    dwLastMsgTime;

	int __forceinline getStatus() const
	{	return m_iStatus;
	}
};

///////////////////////////////////////////////////////////////////////////////

#define CLVM_FILTER_PROTOS			1
#define CLVM_FILTER_GROUPS			2
#define CLVM_FILTER_STATUS			4
#define CLVM_FILTER_VARIABLES		8
#define CLVM_STICKY_CONTACTS		16
#define CLVM_FILTER_STICKYSTATUS	32
#define CLVM_FILTER_LASTMSG			64
#define CLVM_FILTER_LASTMSG_OLDERTHAN 128
#define CLVM_FILTER_LASTMSG_NEWERTHAN 256

#define CLVM_PROTOGROUP_OP		1
#define CLVM_GROUPSTATUS_OP		2
#define CLVM_AUTOCLEAR			4
#define CLVM_INCLUDED_UNGROUPED 8
#define CLVM_USELASTMSG			16

#define CLVM_USEGROUPS			32
#define CLVM_DONOTUSEGROUPS		64

//changes the 'use groups' flag and call CLUI    v0.8.0.16+
//wParam=newValue
//lParam=0
//returns 0 on success, nonzero on failure
//newValue is 0 to not use gruops, 1 to use groups
//or -1 to toggle the value
#define MS_CLIST_SETUSEGROUPS  "CList/SetUseGroups"


#if defined(_UNICODE)
#define CLVM_MODULE "CLVM_W"
#else
#define CLVM_MODULE "CLVM"
#endif

#define GROUPF_SHOWOFFLINE 0x40

#endif