summaryrefslogtreecommitdiff
path: root/Plugins/skins/SkinLib/Dialog.cpp
diff options
context:
space:
mode:
authorpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2008-12-31 21:12:58 +0000
committerpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2008-12-31 21:12:58 +0000
commitbb6784e0e1a385cdd20b41d3254093e89a210332 (patch)
treec5d9c91b42a74baa30682fcbb717116a1df9c126 /Plugins/skins/SkinLib/Dialog.cpp
parent204a27b2f949cababbc13aff26755756987789a0 (diff)
skins: Added SkinLib
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@120 c086bb3d-8645-0410-b8da-73a8550f86e7
Diffstat (limited to 'Plugins/skins/SkinLib/Dialog.cpp')
-rw-r--r--Plugins/skins/SkinLib/Dialog.cpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/Plugins/skins/SkinLib/Dialog.cpp b/Plugins/skins/SkinLib/Dialog.cpp
new file mode 100644
index 0000000..712b85a
--- /dev/null
+++ b/Plugins/skins/SkinLib/Dialog.cpp
@@ -0,0 +1,72 @@
+#include "globals.h"
+#include "Dialog.h"
+#include "DialogState.h"
+
+
+Dialog::Dialog(const char *aName) : name(aName)
+{
+}
+
+
+Dialog::~Dialog()
+{
+ for(unsigned int i = 0; i < fields.size(); i++)
+ delete fields[i];
+
+ fields.clear();
+}
+
+
+const char * Dialog::getName() const
+{
+ return name.c_str();
+}
+
+
+bool Dialog::addField(Field *field)
+{
+ if (getField(field->getName()) != NULL)
+ return false;
+
+ fields.push_back(field);
+ return true;
+}
+
+
+Field * Dialog::getField(const char *name) const
+{
+ if (name == NULL || name[0] == 0)
+ return NULL;
+
+ for(unsigned int i = 0; i < fields.size(); i++)
+ {
+ Field *field = fields[i];
+ if (strcmp(name, field->getName()) == 0)
+ return field;
+ }
+
+ return NULL;
+}
+
+
+const Size & Dialog::getSize() const
+{
+ return size;
+}
+
+
+void Dialog::setSize(const Size &size)
+{
+ this->size = size;
+}
+
+
+DialogState * Dialog::createState()
+{
+ DialogState *ret = new DialogState(this);
+
+ for(unsigned int i = 0; i < fields.size(); i++)
+ ret->fields.push_back(fields[i]->createState());
+
+ return ret;
+}