PROP_VALUE,
PROP_DEFAULT_VALUE,
PROP_ORIGINAL_VALUE,
+ PROP_FORMAT,
PROP_VISIBLE,
PROP_EDITABLE,
PROP_TO_LOAD,
gchar *value;
gchar *default_value;
gchar *original_value;
+ gchar *format;
gboolean visible;
gboolean editable;
gboolean to_load;
"",
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class, PROP_FORMAT,
+ g_param_spec_string ("format",
+ "Format",
+ "Format",
+ "",
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
g_object_class_install_property (object_class, PROP_VISIBLE,
g_param_spec_boolean ("visible",
"Visible",
return (g_strcmp0 (zak_form_element_get_original_value (element), zak_form_element_get_value (element)) != 0);
}
+/**
+ * zak_form_element_set_format:
+ * @element:
+ * @format:
+ *
+ */
+gboolean
+zak_form_element_set_format (ZakFormElement *element, const gchar *format)
+{
+ ZakFormElementPrivate *priv;
+
+ priv = zak_form_element_get_instance_private (element);
+
+ if (priv->format != NULL)
+ {
+ g_free (priv->format);
+ }
+
+ priv->format = g_strdup (format);
+
+ return TRUE;
+}
+
+/**
+ * zak_form_element_get_format:
+ * @element:
+ *
+ */
+gchar
+*zak_form_element_get_format (ZakFormElement *element)
+{
+ ZakFormElementPrivate *priv;
+
+ gchar *ret;
+
+ priv = zak_form_element_get_instance_private (element);
+
+ ret = g_strdup (priv->format);
+
+ return ret;
+}
+
/**
* zak_form_element_set_visible:
* @element:
zak_form_element_set_original_value (zak_form_element, g_value_get_string (value));
break;
+ case PROP_FORMAT:
+ zak_form_element_set_format (zak_form_element, g_value_get_string (value));
+ break;
+
case PROP_VISIBLE:
zak_form_element_set_visible (zak_form_element, g_value_get_boolean (value));
break;
g_value_set_string (value, zak_form_element_get_original_value (zak_form_element));
break;
+ case PROP_FORMAT:
+ g_value_set_string (value, zak_form_element_get_format (zak_form_element));
+ break;
+
case PROP_VISIBLE:
g_value_set_boolean (value, zak_form_element_get_visible (zak_form_element));
break;
{
zak_form_element_set_default_value (element, (const gchar *)xmlNodeGetContent (cur));
}
+ else if (xmlStrcmp (cur->name, (const xmlChar *)"format") == 0)
+ {
+ zak_form_element_set_format (element, (const gchar *)xmlNodeGetContent (cur));
+ }
else if (xmlStrcmp (cur->name, (const xmlChar *)"visible") == 0)
{
zak_form_element_set_visible (element, xmlStrEqual ((const gchar *)xmlNodeGetContent (cur), "TRUE"));
void zak_form_element_set_as_original_value (ZakFormElement *element);
gboolean zak_form_element_is_changed (ZakFormElement *element);
+gboolean zak_form_element_set_format (ZakFormElement *element, const gchar *format);
+gchar *zak_form_element_get_format (ZakFormElement *element);
+
void zak_form_element_set_visible (ZakFormElement *element, gboolean visible);
gboolean zak_form_element_get_visible (ZakFormElement *element);