summaryrefslogtreecommitdiff
path: root/client/widgets/widget.h
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/widget.h')
-rw-r--r--client/widgets/widget.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/client/widgets/widget.h b/client/widgets/widget.h
index 9b6a996..2977e3a 100644
--- a/client/widgets/widget.h
+++ b/client/widgets/widget.h
@@ -38,13 +38,35 @@ class Widget {
public:
Widget(QDomNode &node, MacroWindow *macrowindow);
virtual ~Widget(){}
- virtual QString getValue();
- virtual void setValue(QString value);
+
+ virtual QString getValue() { return ""; }
+ virtual void setValue(QString value, QString source = "");
+
virtual bool isValid();
- virtual void disable();
- virtual void enable();
+
+ virtual void disable() {}
+ virtual void enable() {}
+ virtual bool isDisabled() { return false; }
+
+ virtual void setVisibility(bool) {}
+
QString getName();
+ /**
+ * Connect some signal from this object to some slot in some other object.
+ */
+ virtual void connectFrom(const char *, const QObject *, const char *) {}
+
+ /**
+ * Connect some signal from some other object to some slot in this object.
+ */
+ virtual void connectTo(const QObject *, const char *, const char *) {}
+
+ virtual bool setKeyboardFocus() { return false; }
+
+ void setInitialValue(QString value);
+ virtual void reset();
+
protected:
QString widget_name;
@@ -60,6 +82,9 @@ private:
QString luaprogram;
LUA *lua;
MacroWindow *macrowindow;
+
+ QString initial_value;
+ bool has_initial_value;
};
#endif/*__PRACRO_WIDGET_H__*/