* zak_form_element_get_filters:
* @zakform:
*
- * Returns: a #GPtrArray with the list of ZakFormElement's in the form.
+ * Returns: a #GPtrArray with the list of ZakFormElementFilter's in the form element.
*/
GPtrArray
*zak_form_element_get_filters (ZakFormElement *element)
return priv->pa_messages;
}
+/**
+ * zak_form_element_get_validators:
+ * @zakform:
+ *
+ * Returns: a #GPtrArray with the list of ZakFormElementValidator's in the form element.
+ */
+GPtrArray
+*zak_form_element_get_validators(ZakFormElement *element)
+{
+ ZakFormElementPrivate *priv = zak_form_element_get_instance_private (element);
+
+ return priv->pa_validators;
+}
+
+/**
+ * zak_form_element_get_validators_by_type:
+ * @element:
+ * @type:
+ *
+ * Returns: a #GPtrArray with the list of ZakFormElementValidator's in the form element filtered by @type.
+ */
+GPtrArray
+*zak_form_element_get_validators_by_type (ZakFormElement *element, GType type)
+{
+ GPtrArray *ar;
+ ZakFormElementFilter *filter;
+
+ guint i;
+
+ ZakFormElementPrivate *priv = zak_form_element_get_instance_private (element);
+
+ ar = g_ptr_array_new ();
+ for (i = 0; i < priv->pa_validators->len; i++)
+ {
+ filter = (ZakFormElementFilter *)g_ptr_array_index (priv->pa_validators, i);
+ if (G_OBJECT_TYPE (filter) == type)
+ {
+ g_ptr_array_add (ar, filter);
+ }
+ }
+
+ return ar;
+}
+
/* PRIVATE */
static void
zak_form_element_set_property (GObject *object,
gboolean zak_form_element_is_valid (ZakFormElement *element);
GPtrArray *zak_form_element_get_messages (ZakFormElement *element);
+GPtrArray *zak_form_element_get_validators (ZakFormElement *element);
+GPtrArray *zak_form_element_get_validators_by_type (ZakFormElement *element, GType type);
+
+
G_END_DECLS
/*
- * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2017 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
/* Other members, including private data. */
};
-#define ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_TYPE_FORM_ELEMENT_VALIDATOR_DATE, ZakFormElementValidatorDatePrivate))
+#define ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_ELEMENT_VALIDATOR_DATE, ZakFormElementValidatorDatePrivate))
typedef struct _ZakFormElementValidatorDatePrivate ZakFormElementValidatorDatePrivate;
struct _ZakFormElementValidatorDatePrivate
/*
- * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2017 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
G_BEGIN_DECLS
-#define ZAK_TYPE_FORM_ELEMENT_VALIDATOR_DATE zak_form_element_validator_date_get_type ()
+#define ZAK_FORM_TYPE_ELEMENT_VALIDATOR_DATE zak_form_element_validator_date_get_type ()
G_DECLARE_FINAL_TYPE (ZakFormElementValidatorDate, zak_form_element_validator_date, ZAK_FORM, ELEMENT_VALIDATOR_DATE, ZakFormElementValidator)
ZakFormElementValidatorDate *zak_form_element_validator_date_new (void);
/*
- * Copyright (C) 2015-2016 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2017 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
/* Other members, including private data. */
};
-#define ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_TYPE_FORM_ELEMENT_VALIDATOR_NOTEMPTY, ZakFormElementValidatorNotemptyPrivate))
+#define ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_ELEMENT_VALIDATOR_NOTEMPTY, ZakFormElementValidatorNotemptyPrivate))
typedef struct _ZakFormElementValidatorNotemptyPrivate ZakFormElementValidatorNotemptyPrivate;
struct _ZakFormElementValidatorNotemptyPrivate
/*
- * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2017 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
G_BEGIN_DECLS
-#define ZAK_TYPE_FORM_ELEMENT_VALIDATOR_NOTEMPTY zak_form_element_validator_notempty_get_type ()
+#define ZAK_FORM_TYPE_ELEMENT_VALIDATOR_NOTEMPTY zak_form_element_validator_notempty_get_type ()
G_DECLARE_FINAL_TYPE (ZakFormElementValidatorNotempty, zak_form_element_validator_notempty, ZAK_FORM, ELEMENT_VALIDATOR_NOTEMPTY, ZakFormElementValidator)
ZakFormElementValidatorNotempty *zak_form_element_validator_notempty_new (void);
/*
- * Copyright (C) 2015-2016 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2017 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
/* Other members, including private data. */
};
-#define ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_TYPE_FORM_ELEMENT_VALIDATOR_REGEX, ZakFormElementValidatorRegexPrivate))
+#define ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_ELEMENT_VALIDATOR_REGEX, ZakFormElementValidatorRegexPrivate))
typedef struct _ZakFormElementValidatorRegexPrivate ZakFormElementValidatorRegexPrivate;
struct _ZakFormElementValidatorRegexPrivate
/*
- * Copyright (C) 2015-2016 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2017 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
G_BEGIN_DECLS
-#define ZAK_TYPE_FORM_ELEMENT_VALIDATOR_REGEX zak_form_element_validator_regex_get_type ()
+#define ZAK_FORM_TYPE_ELEMENT_VALIDATOR_REGEX zak_form_element_validator_regex_get_type ()
G_DECLARE_FINAL_TYPE (ZakFormElementValidatorRegex, zak_form_element_validator_regex, ZAK_FORM, ELEMENT_VALIDATOR_REGEX, ZakFormElementValidator)
ZakFormElementValidatorRegex *zak_form_element_validator_regex_new (void);