2 * Copyright (C) 2015-2017 Andrea Zagli <azagli@libero.it>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef __ZAK_FORM_ELEMENT_VALIDATOR_H__
20 #define __ZAK_FORM_ELEMENT_VALIDATOR_H__
22 #include <glib-object.h>
24 #include <libxml/xpath.h>
30 #define ZAK_FORM_TYPE_ELEMENT_VALIDATOR zak_form_element_validator_get_type ()
31 G_DECLARE_DERIVABLE_TYPE (ZakFormElementValidator
, zak_form_element_validator
, ZAK_FORM
, ELEMENT_VALIDATOR
, GObject
)
33 struct _ZakFormElementValidatorClass
35 GObjectClass parent_class
;
37 gboolean (*xml_parsing
) (ZakFormElementValidator
*self
, xmlNode
*xnode
);
38 gboolean (*validate
) (ZakFormElementValidator
*self
, const gchar
*value
);
41 gboolean
zak_form_element_validator_xml_parsing (ZakFormElementValidator
*self
, xmlNode
*xnode
);
42 gboolean
zak_form_element_validator_validate (ZakFormElementValidator
*self
, const gchar
*value
);
44 void zak_form_element_validator_set_id (ZakFormElementValidator
*validator
,
46 gchar
*zak_form_element_validator_get_id (ZakFormElementValidator
*validator
);
48 void zak_form_element_validator_set_message (ZakFormElementValidator
*validator
,
49 const gchar
*message
);
50 gchar
*zak_form_element_validator_get_message (ZakFormElementValidator
*validator
);
52 gboolean
zak_form_element_validator_get_enabled (ZakFormElementValidator
*validator
);
53 void zak_form_element_validator_set_enabled (ZakFormElementValidator
*validator
, gboolean enabled
);
59 #endif /* __ZAK_FORM_ELEMENT_VALIDATOR_H__ */