summaryrefslogtreecommitdiff
path: root/plugins/IEView/src/Options.h
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-07 21:32:59 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-07 21:33:07 +0300
commit08e2f2b731c2a696b1c23edd1ac0e911c2336dba (patch)
tree239fd9453b487e6590d05e1d688b140879b2ecbb /plugins/IEView/src/Options.h
parent140598d6c6061678f54c65acb2059ebc7b6b9aa7 (diff)
IEView: double settings set removed
Diffstat (limited to 'plugins/IEView/src/Options.h')
-rw-r--r--plugins/IEView/src/Options.h222
1 files changed, 64 insertions, 158 deletions
diff --git a/plugins/IEView/src/Options.h b/plugins/IEView/src/Options.h
index 9e82daaac4..f791aa553f 100644
--- a/plugins/IEView/src/Options.h
+++ b/plugins/IEView/src/Options.h
@@ -18,87 +18,60 @@ 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"
+
+#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;
+ int srmmMode;
+ int srmmFlags;
+ CMStringA srmmBackgroundFilename;
+ CMStringA srmmCssFilename;
+ CMStringA srmmTemplateFilename;
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;
+ int chatMode;
+ int chatFlags;
+ CMStringA chatBackgroundFilename;
+ CMStringA chatCssFilename;
+ CMStringA chatTemplateFilename;
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;
+ CMStringA historyBackgroundFilename;
+ CMStringA historyCssFilename;
+ CMStringA historyCssFilenameRtl;
+ CMStringA historyTemplateFilename;
public:
ProtocolSettings(const char *protocolName);
@@ -106,9 +79,6 @@ public:
__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; }
@@ -118,33 +88,15 @@ public:
__forceinline void setSRMMFlags(int flags) { this->srmmFlags = flags; }
__forceinline int getSRMMFlags() { return srmmFlags; }
- __forceinline void setSRMMBackgroundFilename(const char *filename) { replaceStr(srmmBackgroundFilename, filename); }
+ __forceinline void setSRMMBackgroundFilename(const char *filename) { srmmBackgroundFilename = filename; }
__forceinline const char* getSRMMBackgroundFilename() { return srmmBackgroundFilename; }
- __forceinline void setSRMMCssFilename(const char *filename) { replaceStr(srmmCssFilename, filename); }
+ __forceinline void setSRMMCssFilename(const char *filename) { 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; }
@@ -154,33 +106,15 @@ public:
__forceinline void setChatFlags(int flags) { this->chatFlags = flags; }
__forceinline int getChatFlags() { return chatFlags; }
- __forceinline void setChatBackgroundFilename(const char *filename) { replaceStr(chatBackgroundFilename, filename); }
+ __forceinline void setChatBackgroundFilename(const char *filename) { chatBackgroundFilename = filename; }
__forceinline const char* getChatBackgroundFilename() { return chatBackgroundFilename; }
- __forceinline void setChatCssFilename(const char *filename) { replaceStr(chatCssFilename, filename); }
+ __forceinline void setChatCssFilename(const char *filename) { 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; }
@@ -190,51 +124,27 @@ public:
__forceinline void setHistoryFlags(int flags) { this->historyFlags = flags; }
__forceinline int getHistoryFlags() { return historyFlags; }
- __forceinline void setHistoryBackgroundFilename(const char *filename) { replaceStr(historyBackgroundFilename, filename); }
+ __forceinline void setHistoryBackgroundFilename(const char *filename) { historyBackgroundFilename = filename; }
__forceinline const char* getHistoryBackgroundFilename() { return historyBackgroundFilename; }
- __forceinline void setHistoryCssFilename(const char *filename) { replaceStr(historyCssFilename, filename); }
+ __forceinline void setHistoryCssFilename(const char *filename) { 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 {
+namespace Options
+{
+ enum
+ {
MODE_COMPATIBLE = 0,
MODE_CSS = 1,
MODE_TEMPLATE = 2
};
- enum OPTIONS {
+
+ enum OPTIONS
+ {
GENERAL_ENABLE_BBCODES = 0x000001,
GENERAL_ENABLE_FLASH = 0x000004,
GENERAL_SMILEYINNAMES = 0x000010,
@@ -253,24 +163,20 @@ public:
LOG_IMAGE_SCROLL = 0x020000
};
- enum AVATARSERVICEFLAGS {
- AVATARSERVICE_PRESENT = 0x0001,
- };
+
+ extern int generalFlags;
+ extern bool isInited, bHasSmileyAdd, bHasAvs;
+
+ int getEmbedSize();
+ void setEmbedSize(int);
+
+ ProtocolSettings* getProtocolSettings(const char *protocolName);
+ ProtocolSettings* getDefaultSettings();
- 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();
+ void init();
+ void uninit();
+ void saveProtocolSettings();
+ void reload();
};
#endif