From 9242a80a84fa5c96dbadec9594177875aeeec1ac Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Tue, 10 Jul 2012 18:37:21 +0000 Subject: only added MyDetails and Skins. not adopted yet git-svn-id: http://svn.miranda-ng.org/main/trunk@892 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Skins/SkinLib/SkinOptions.h | 98 +++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 plugins/Skins/SkinLib/SkinOptions.h (limited to 'plugins/Skins/SkinLib/SkinOptions.h') diff --git a/plugins/Skins/SkinLib/SkinOptions.h b/plugins/Skins/SkinLib/SkinOptions.h new file mode 100644 index 0000000000..41d238a5a1 --- /dev/null +++ b/plugins/Skins/SkinLib/SkinOptions.h @@ -0,0 +1,98 @@ +#ifndef __SKINNED_DIALOG_OPTIONS_H__ +# define __SKINNED_DIALOG_OPTIONS_H__ + +#include +#include "tstring.h" +#include + + +enum SkinOptionType +{ + CHECKBOX, + NUMBER, + TEXT +}; + +class SkinOption; + +typedef void (*SkinOptionCallback)(void *param, const SkinOption *opt); + + +class SkinOption +{ +public: + SkinOption(const char *name); + ~SkinOption(); + + const char * getName() const; + + SkinOptionType getType() const; + void setType(SkinOptionType type); + + const TCHAR * getDescription() const; + void setDescription(const TCHAR * description); + + int getMax() const; + void setMax(int max); + + int getMin() const; + void setMin(int min); + + bool getValueCheckbox() const; + void setValueCheckbox(bool value); + + int getValueNumber() const; + void setValueNumber(int value); + + const TCHAR * getValueText() const; + void setValueText(const TCHAR * value); + + void setOnChangeCallback(SkinOptionCallback cb, void *param = NULL); + +private: + std::string name; + SkinOptionType type; + std::tstring description; + bool valueCheckbox; + int valueNumber; + int minValue; + int maxValue; + std::tstring valueText; + + SkinOptionCallback onChangeCallback; + void * onChangeCallbackParam; + + void fireOnChange(); +}; + + +class SkinOptions +{ +public: + SkinOptions(); + ~SkinOptions(); + + bool addOption(SkinOption *opt); + SkinOption * getOption(const char *name) const; + SkinOption * getOption(unsigned int pos) const; + unsigned int getNumOptions() const; + void clearOptions(); + + void setOnOptionAddRemoveCallback(SkinOptionCallback cb, void *param = NULL); + void setOnOptionChangeCallback(SkinOptionCallback cb, void *param = NULL); + +private: + std::vector options; + + SkinOptionCallback onAddRemoveCallback; + void * onAddRemoveCallbackParam; + + SkinOptionCallback onChangeCallback; + void * onChangeCallbackParam; + + void fireOnAddRemove(SkinOption *opt); +}; + + + +#endif // __SKINNED_DIALOG_OPTIONS_H__ -- cgit v1.2.3