summaryrefslogtreecommitdiff
path: root/plugins/IEView/src/Options.h
blob: 9e82daaac4185eee1e075595c734023ebb63fc3c (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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
/*

IEView Plugin for Miranda IM
Copyright (C) 2005-2010  Piotr Piastucki

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.

*/
class ProtocolSettings;
class Options;
#ifndef OPTIONS_INCLUDED
#define OPTIONS_INCLUDED
//#include "FontList.h"
#include "stdafx.h"

#define DBS_BASICFLAGS  		  	"GeneralFlags"

#define DBS_SRMM_ENABLE          	"SRMMEnable"
#define DBS_SRMM_MODE          		"SRMMMode"
#define DBS_SRMM_FLAGS          	"SRMMFlags"
#define DBS_SRMM_BACKGROUND    		"SRMMBackgroundFile"
#define DBS_SRMM_CSS         		"SRMMCSSFile"
#define DBS_SRMM_TEMPLATE         	"SRMMTemplateFile"

#define DBS_CHAT_ENABLE          	"ChatEnable"
#define DBS_CHAT_MODE          		"ChatMode"
#define DBS_CHAT_FLAGS          	"ChatFlags"
#define DBS_CHAT_BACKGROUND    		"ChatBackgroundFile"
#define DBS_CHAT_CSS         		"ChatCSSFile"
#define DBS_CHAT_TEMPLATE         	"ChatTemplateFile"

#define DBS_HISTORY_ENABLE          "HistoryEnable"
#define DBS_HISTORY_MODE          	"HistoryMode"
#define DBS_HISTORY_FLAGS          	"HistoryFlags"
#define DBS_HISTORY_BACKGROUND    	"HistoryBackgroundFile"
#define DBS_HISTORY_CSS         	"HistoryCSSFile"
#define DBS_HISTORY_TEMPLATE        "HistoryTemplateFile"

extern int IEViewOptInit(WPARAM wParam, LPARAM lParam);

class ProtocolSettings
{
	char *protocolName;
	ProtocolSettings *next;

	bool srmmEnable;
	int srmmMode;
	int srmmFlags;
	char *srmmBackgroundFilename;
	char *srmmCssFilename;
	char *srmmTemplateFilename;

	bool srmmEnableTemp;
	int srmmModeTemp;
	int srmmFlagsTemp;
	char *srmmBackgroundFilenameTemp;
	char *srmmCssFilenameTemp;
	char *srmmTemplateFilenameTemp;

	bool chatEnable;
	int chatMode;
	int chatFlags;
	char *chatBackgroundFilename;
	char *chatCssFilename;
	char *chatTemplateFilename;

	bool chatEnableTemp;
	int chatModeTemp;
	int chatFlagsTemp;
	char *chatBackgroundFilenameTemp;
	char *chatCssFilenameTemp;
	char *chatCssFilenameRtlTemp;
	char *chatTemplateFilenameTemp;

	bool historyEnable;
	int historyMode;
	int historyFlags;
	char *historyBackgroundFilename;
	char *historyCssFilename;
	char *historyCssFilenameRtl;
	char *historyTemplateFilename;

	bool historyEnableTemp;
	int historyModeTemp;
	int historyFlagsTemp;
	char *historyBackgroundFilenameTemp;
	char *historyCssFilenameTemp;
	char *historyCssFilenameRtlTemp;
	char *historyTemplateFilenameTemp;

public:
	ProtocolSettings(const char *protocolName);
	~ProtocolSettings();

	__forceinline const char* getProtocolName() { return protocolName; }

	__forceinline void setNext(ProtocolSettings *_next) {	next = _next; }
	__forceinline ProtocolSettings* getNext() {	return next; }

	__forceinline void setSRMMEnable(bool enable) { this->srmmEnable = enable; }
	__forceinline bool isSRMMEnable() { return srmmEnable; }

	__forceinline void setSRMMMode(int mode) { this->srmmMode = mode; }
	__forceinline int getSRMMMode() { return srmmMode; }

	__forceinline void setSRMMFlags(int flags) { this->srmmFlags = flags; }
	__forceinline int getSRMMFlags() { return srmmFlags; }
	
	__forceinline void setSRMMBackgroundFilename(const char *filename) { replaceStr(srmmBackgroundFilename, filename); }
	__forceinline const char* getSRMMBackgroundFilename() { return srmmBackgroundFilename; }

	__forceinline void setSRMMCssFilename(const char *filename) { replaceStr(srmmCssFilename, filename); }
	__forceinline const char* getSRMMCssFilename() { return srmmCssFilename; }
	
	              void setSRMMTemplateFilename(const char *filename);
	__forceinline const char* getSRMMTemplateFilename() { return srmmTemplateFilename; }

	__forceinline void setSRMMEnableTemp(bool enable) { this->srmmEnableTemp = enable; }
	__forceinline bool isSRMMEnableTemp() { return srmmEnableTemp; }

	__forceinline void setSRMMModeTemp(int mode) { this->srmmModeTemp = mode; }
	__forceinline int getSRMMModeTemp() { return srmmModeTemp; }

	__forceinline void setSRMMFlagsTemp(int flags) { this->srmmFlagsTemp = flags; }
	__forceinline int getSRMMFlagsTemp() { return srmmFlagsTemp; }
	
	__forceinline void setSRMMBackgroundFilenameTemp(const char *filename) { replaceStr(srmmBackgroundFilenameTemp, filename); }
	__forceinline const char* getSRMMBackgroundFilenameTemp() { return srmmBackgroundFilenameTemp; }

	__forceinline void setSRMMCssFilenameTemp(const char *filename) { replaceStr(srmmCssFilenameTemp, filename); }
	__forceinline const char* getSRMMCssFilenameTemp() { return srmmCssFilenameTemp; }

	__forceinline void setSRMMTemplateFilenameTemp(const char *filename) { replaceStr(srmmTemplateFilenameTemp, filename); }
	__forceinline const char* getSRMMTemplateFilenameTemp() { return srmmTemplateFilenameTemp; }

	__forceinline void setChatEnable(bool enable) { this->chatEnable = enable; }
	__forceinline bool isChatEnable() { return chatEnable; }
	
	__forceinline void setChatMode(int mode) { this->chatMode = mode; }
	__forceinline int getChatMode() { return chatMode; }
	
	__forceinline void setChatFlags(int flags) { this->chatFlags = flags; }
	__forceinline int getChatFlags() { return chatFlags; }
	
	__forceinline void setChatBackgroundFilename(const char *filename) { replaceStr(chatBackgroundFilename, filename); }
	__forceinline const char* getChatBackgroundFilename() { return chatBackgroundFilename; }
	
	__forceinline void setChatCssFilename(const char *filename) { replaceStr(chatCssFilename, filename); }
	__forceinline const char* getChatCssFilename() { return chatCssFilename; }

	              void setChatTemplateFilename(const char *filename);
	__forceinline const char* getChatTemplateFilename() { return chatTemplateFilename; }

	__forceinline void setChatEnableTemp(bool enable) { this->chatEnableTemp = enable; }
	__forceinline bool isChatEnableTemp() { return chatEnableTemp; }
	
	__forceinline void setChatModeTemp(int mode) { this->chatModeTemp = mode; }
	__forceinline int getChatModeTemp() { return chatModeTemp; }
	
	__forceinline void setChatFlagsTemp(int flags) { this->chatFlagsTemp = flags; }
	__forceinline int getChatFlagsTemp() { return chatFlagsTemp; }
	
	__forceinline void setChatBackgroundFilenameTemp(const char *filename) { replaceStr(chatBackgroundFilenameTemp, filename); }
	__forceinline const char* getChatBackgroundFilenameTemp() { return chatBackgroundFilenameTemp; }

	__forceinline void setChatCssFilenameTemp(const char *filename) { replaceStr(chatCssFilenameTemp, filename); }
	__forceinline const char* getChatCssFilenameTemp() { return chatCssFilenameTemp; }
	
	__forceinline void setChatTemplateFilenameTemp(const char *filename) { replaceStr(chatTemplateFilenameTemp, filename); }
	__forceinline const char* getChatTemplateFilenameTemp() { return chatTemplateFilenameTemp; }

	__forceinline void setHistoryEnable(bool enable) { this->historyEnable = enable; }
	__forceinline bool isHistoryEnable() { return historyEnable; }
	
	__forceinline void setHistoryMode(int mode) { this->historyMode = mode; }
	__forceinline int getHistoryMode() { return historyMode; }
	
	__forceinline void setHistoryFlags(int flags) { this->historyFlags = flags; }
	__forceinline int getHistoryFlags() { return historyFlags; }
	
	__forceinline void setHistoryBackgroundFilename(const char *filename) { replaceStr(historyBackgroundFilename, filename); }
	__forceinline const char* getHistoryBackgroundFilename() { return historyBackgroundFilename; }
	
	__forceinline void setHistoryCssFilename(const char *filename) { replaceStr(historyCssFilename, filename); }
	__forceinline const char* getHistoryCssFilename() { return historyCssFilename; }
	
	              void setHistoryTemplateFilename(const char *filename);
	__forceinline const char* getHistoryTemplateFilename() { return historyTemplateFilename; }

	__forceinline void setHistoryEnableTemp(bool enable) { this->historyEnableTemp = enable; }
	__forceinline bool isHistoryEnableTemp() { return historyEnableTemp; }
	
	__forceinline void setHistoryModeTemp(int mode) { this->historyModeTemp = mode; }
	__forceinline int getHistoryModeTemp() { return historyModeTemp; }
	
	__forceinline void setHistoryFlagsTemp(int flags) { this->historyFlagsTemp = flags; }
	__forceinline int getHistoryFlagsTemp() { return historyFlagsTemp; }
	
	__forceinline void setHistoryBackgroundFilenameTemp(const char *filename) { replaceStr(historyBackgroundFilenameTemp, filename); }
	__forceinline const char* getHistoryBackgroundFilenameTemp() { return historyBackgroundFilenameTemp; }
	
	__forceinline void setHistoryCssFilenameTemp(const char *filename) { replaceStr(historyCssFilenameTemp, filename); }
	__forceinline const char* getHistoryCssFilenameTemp() { return historyCssFilenameTemp; }
	
	__forceinline void setHistoryTemplateFilenameTemp(const char *filename) { replaceStr(historyTemplateFilenameTemp, filename); }
	__forceinline const char* getHistoryTemplateFilenameTemp() { return historyTemplateFilenameTemp; }

	void 	copyToTemp();
	void	copyFromTemp();
};

class Options {
private:
	static int 		generalFlags;
	static bool     isInited;
	static bool     bSmileyAdd;
	static int      avatarServiceFlags;
	static ProtocolSettings* protocolList;
public:
	enum MODES {
		MODE_COMPATIBLE = 0,
		MODE_CSS = 1,
		MODE_TEMPLATE = 2
	};
	enum OPTIONS {
		GENERAL_ENABLE_BBCODES = 0x000001,
		GENERAL_ENABLE_FLASH = 0x000004,
		GENERAL_SMILEYINNAMES = 0x000010,
		GENERAL_NO_BORDER = 0x000020,
		GENERAL_ENABLE_EMBED = 0x000040,

		LOG_SHOW_NICKNAMES = 0x000100,
		LOG_SHOW_TIME = 0x000200,
		LOG_SHOW_DATE = 0x000400,
		LOG_SHOW_SECONDS = 0x000800,
		LOG_LONG_DATE = 0x001000,
		LOG_RELATIVE_DATE = 0x002000,
		LOG_GROUP_MESSAGES = 0x004000,

		LOG_IMAGE_ENABLED = 0x010000,
		LOG_IMAGE_SCROLL = 0x020000

	};
	enum AVATARSERVICEFLAGS {
		AVATARSERVICE_PRESENT = 0x0001,
	};

	static void     		setGeneralFlags(int flags);
	static int				getGeneralFlags();
	static void     		setEmbedsize(int size);
	static int				getEmbedsize();

	static bool             isSmileyAdd();
	static int				getAvatarServiceFlags();
	static void      		init();
	static void      		uninit();
	static void				saveProtocolSettings();
	static void				resetProtocolSettings();
	static ProtocolSettings*getProtocolSettings();
	static ProtocolSettings*getProtocolSettings(const char *protocolName);
	static void             Reload();
};

#endif