static void zak_cgi_form_element_dispose (GObject *gobject);
static void zak_cgi_form_element_finalize (GObject *gobject);
+static gchar *zak_cgi_form_element_get_value (ZakCgiFormElement *element);
+static gboolean zak_cgi_form_element_set_value (ZakCgiFormElement *element, const gchar *value);
static void zak_cgi_form_element_xml_parsing (ZakFormElement *element, xmlNode *xmlnode);
#define ZAK_CGI_FORM_ELEMENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_CGI_TYPE_FORM_ELEMENT, ZakCgiFormElementPrivate))
gchar *id;
GHashTable *ht_attrs;
GHashTable *ht_label_attrs;
+ gchar *value;
};
G_DEFINE_TYPE (ZakCgiFormElement, zak_cgi_form_element, ZAK_FORM_TYPE_ELEMENT)
zak_cgi_form_element_class_init (ZakCgiFormElementClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
+ ZakFormElementClass *elem_class = ZAK_FORM_ELEMENT_CLASS (class);
object_class->set_property = zak_cgi_form_element_set_property;
object_class->get_property = zak_cgi_form_element_get_property;
class->xml_parsing = zak_cgi_form_element_xml_parsing;
+ elem_class->get_value = zak_cgi_form_element_get_value;
+ elem_class->set_value = zak_cgi_form_element_set_value;
+
g_type_class_add_private (object_class, sizeof (ZakCgiFormElementPrivate));
class->construct = zak_cgi_form_element_construct;
zak_form_element_set_long_name (ZAK_FORM_ELEMENT (element), label);
}
+/**
+ * zak_cgi_form_element_bind:
+ * @element:
+ * @value:
+ *
+ */
+void
+zak_cgi_form_element_bind (ZakCgiFormElement *element, const gchar *value)
+{
+ ZakCgiFormElementPrivate *priv;
+
+ priv = ZAK_CGI_FORM_ELEMENT_GET_PRIVATE (element);
+
+ priv->value = g_strdup (value);
+}
+
/**
* zak_cgi_form_element_render:
* @element:
return priv->ht_attrs;
}
+static gchar
+*zak_cgi_form_element_get_value (ZakCgiFormElement *element)
+{
+ gchar *ret;
+
+ ZakCgiFormElementPrivate *priv;
+
+ priv = ZAK_CGI_FORM_ELEMENT_GET_PRIVATE (element);
+
+ ret = g_strdup (priv->value);
+
+ return ret;
+}
+
+static gboolean
+zak_cgi_form_element_set_value (ZakCgiFormElement *element, const gchar *value)
+{
+ ZakCgiFormElementPrivate *priv;
+
+ priv = ZAK_CGI_FORM_ELEMENT_GET_PRIVATE (element);
+
+ priv->value = g_strdup (value);
+
+ return TRUE;
+}
+
static void
zak_cgi_form_element_set_property (GObject *object,
guint property_id,