}
}
+/**
+ * zak_form_form_set_as_original:
+ * @zakform: a #ZakFormForm object.
+ *
+ */
+void
+zak_form_form_set_as_original (ZakFormForm *zakform)
+{
+ guint i;
+
+ ZakFormFormPrivate *priv;
+
+ g_return_if_fail (ZAK_FORM_IS_FORM (zakform));
+
+ priv = zak_form_form_get_instance_private (zakform);
+
+ for (i = 0; i < priv->ar_elements->len; i++)
+ {
+ ZakFormElement *element = (ZakFormElement *)g_ptr_array_index (priv->ar_elements, i);
+
+ zak_form_element_set_as_original_value (element);
+ }
+}
+
/**
* zak_form_form_is_valid:
* @zakform:
return ret;
}
+/**
+ * zak_form_form_is_changed:
+ * @zakform:
+ *
+ * Returns:
+ */
+gboolean
+zak_form_form_is_changed (ZakFormForm *zakform)
+{
+ guint i;
+
+ gboolean ret;
+
+ ZakFormFormPrivate *priv;
+
+ priv = zak_form_form_get_instance_private (zakform);
+
+ ret = FALSE;
+
+ for (i = 0; i < priv->ar_elements->len; i++)
+ {
+ ZakFormElement *element = (ZakFormElement *)g_ptr_array_index (priv->ar_elements, i);
+ if (zak_form_element_is_changed (element))
+ {
+ ret = TRUE;
+ break;
+ }
+ }
+
+ return ret;
+}
+
/**
* zak_form_form_load:
* @zakform:
void zak_form_form_clear (ZakFormForm *zakform);
+void zak_form_form_set_as_original (ZakFormForm *zakform);
+
gboolean zak_form_form_is_valid (ZakFormForm *zakform);
+gboolean zak_form_form_is_changed (ZakFormForm *zakform);
gboolean zak_form_form_load (ZakFormForm *zakform, ZakFormIProvider *provider);
gboolean zak_form_form_insert (ZakFormForm *zakform, ZakFormIProvider *provider);
gboolean
zak_form_element_is_changed (ZakFormElement *element)
{
- return (g_strcmp0 (zak_form_element_get_original_value (element), zak_form_element_get_value (element)) == 0);
+ return (g_strcmp0 (zak_form_element_get_original_value (element), zak_form_element_get_value (element)) != 0);
}
/**