summaryrefslogtreecommitdiff
path: root/Plugins/skins/SkinLib/Field.h
blob: fb244a4ce7fd4c019977993574cc4f842842d918 (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
#ifndef __FIELD_H__
# define __FIELD_H__

#include <windows.h>
#include <tchar.h>
#include "tstring.h"
#include "Size.h"
#include "Position.h"


enum FieldType
{
	SIMPLE_TEXT = 1,
	SIMPLE_IMAGE,
	SIMPLE_ICON,
	CONTROL_LABEL,
	CONTROL_BUTTON,
	CONTROL_EDIT,
	USER_DEFINED = 0x100
};

class Dialog;
class Field;
class FieldState;

typedef void (*FieldCallback)(void *param, const Field *field);


class Field
{
public:
	Field(Dialog *dlg, const char *name);
	virtual ~Field();

	virtual Dialog * getDialog() const;
	virtual const char * getName() const;
	virtual FieldType getType() const = 0;

	virtual FieldState * createState() = 0;

	virtual void setOnChangeCallback(FieldCallback cb, void *param = NULL);

protected:
	void fireOnChange() const;

private:
	Dialog *dlg;
	const std::string name;

	FieldCallback onChangeCallback;
	void *onChangeCallbackParam;
};




#endif // __FIELD_H__