enum
{
PROP_0,
+ PROP_IS_KEY,
PROP_VALUE,
PROP_DEFAULT_VALUE,
PROP_ORIGINAL_VALUE,
typedef struct
{
+ gboolean is_key;
gchar *value;
gchar *default_value;
gchar *original_value;
class->xml_parsing = zak_form_element_xml_parsing;
class->get_messages = zak_form_element_get_messages;
+ g_object_class_install_property (object_class, PROP_IS_KEY,
+ g_param_spec_boolean ("is-key",
+ "Is key",
+ "Is key",
+ TRUE,
+ G_PARAM_READWRITE));
+
g_object_class_install_property (object_class, PROP_VALUE,
g_param_spec_string ("value",
"Value",
{
ZakFormElementPrivate *priv = zak_form_element_get_instance_private (zak_form_element);
+ priv->is_key = TRUE;
priv->value = g_strdup ("");
priv->visible = TRUE;
priv->editable = TRUE;
}
}
+/**
+ * zak_form_element_set_is_key:
+ * @element:
+ * @is_key:
+ *
+ */
+void
+zak_form_element_set_is_key (ZakFormElement *element, gboolean is_key)
+{
+ ZakFormElementPrivate *priv;
+
+ priv = zak_form_element_get_instance_private (element);
+
+ priv->is_key = is_key;
+}
+
+/**
+ * zak_form_element_get_is_key:
+ * @element:
+ *
+ */
+gboolean
+zak_form_element_get_is_key (ZakFormElement *element)
+{
+ ZakFormElementPrivate *priv;
+
+ priv = zak_form_element_get_instance_private (element);
+
+ return priv->is_key;
+}
+
/**
* zak_form_element_set_value:
* @element:
switch (property_id)
{
+ case PROP_IS_KEY:
+ zak_form_element_set_is_key (zak_form_element, g_value_get_boolean (value));
+ break;
+
case PROP_VALUE:
zak_form_element_set_value (zak_form_element, g_value_dup_string (value));
break;
switch (property_id)
{
+ case PROP_IS_KEY:
+ g_value_set_boolean (value, zak_form_element_get_is_key (zak_form_element));
+ break;
+
case PROP_VALUE:
g_value_set_string (value, zak_form_element_get_value (zak_form_element));
break;
};
+void zak_form_element_set_to_is_key (ZakFormElement *element, gboolean is_key);
+gboolean zak_form_element_get_is_key (ZakFormElement *element);
+
gboolean zak_form_element_set_value (ZakFormElement *element, const gchar *value);
gchar *zak_form_element_get_value (ZakFormElement *element);