static void zak_cgi_form_element_dispose (GObject *gobject);
static void zak_cgi_form_element_finalize (GObject *gobject);
+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))
typedef struct _ZakCgiFormElementPrivate ZakCgiFormElementPrivate;
object_class->dispose = zak_cgi_form_element_dispose;
object_class->finalize = zak_cgi_form_element_finalize;
+ class->xml_parsing = zak_cgi_form_element_xml_parsing;
+
g_type_class_add_private (object_class, sizeof (ZakCgiFormElementPrivate));
class->construct = zak_cgi_form_element_construct;
GObjectClass *parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (gobject));
parent_class->finalize (gobject);
}
+
+static void
+zak_cgi_form_element_xml_parsing (ZakFormElement *element, xmlNode *xmlnode)
+{
+ ZAK_FORM_ELEMENT_GET_CLASS (element)->xml_parsing (element, xmlnode);
+}
/*
- * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2016 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
void (*construct) (ZakCgiFormElement *element, const gchar *id, GHashTable *ht_attrs);
GHashTable *(*get_ht_attrs) (ZakCgiFormElement *element);
+ void (*xml_parsing) (ZakFormElement *element, xmlNode *xmlnode);
+
gchar *(*render) (ZakCgiFormElement *element);
};
id = NULL;
+ ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_check_parent_class)->xml_parsing (element, xmlnode);
+
ht_attrs = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_replace (ht_attrs, "type", "checkbox");
id = NULL;
+ ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_email_parent_class)->xml_parsing (element, xmlnode);
+
ht_attrs = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_replace (ht_attrs, "type", "email");
id = NULL;
+ ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_hidden_parent_class)->xml_parsing (element, xmlnode);
+
ht_attrs = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_replace (ht_attrs, "type", "hidden");
id = NULL;
+ ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_password_parent_class)->xml_parsing (element, xmlnode);
+
ht_attrs = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_replace (ht_attrs, "type", "password");
id = NULL;
+ ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_select_parent_class)->xml_parsing (element, xmlnode);
+
ht_attrs = g_hash_table_new (g_str_hash, g_str_equal);
cur = xmlnode->children;
ret = FALSE;
+ ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_string_parent_class)->xml_parsing (element, xmlnode);
+
cur = xmlnode->children;
while (cur != NULL)
{
id = NULL;
+ ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_submit_parent_class)->xml_parsing (element, xmlnode);
+
ht_attrs = g_hash_table_new (g_str_hash, g_str_equal);
cur = xmlnode->children;
id = NULL;
+ ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_text_parent_class)->xml_parsing (element, xmlnode);
+
ht_attrs = g_hash_table_new (g_str_hash, g_str_equal);
cur = xmlnode->children;
id = NULL;
+ ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_text_area_parent_class)->xml_parsing (element, xmlnode);
+
ht_attrs = g_hash_table_new (g_str_hash, g_str_equal);
cur = xmlnode->children;