Data Structures | Typedefs | Enumerations | Functions

The validation helper feature. More...

Data Structures

struct  _Elm_Validate_Content
 

Typedefs

typedef struct _Elm_Validate_Content Elm_Validate_Content
 Data for the elm_validator_regexp_helper()
 
typedef struct _Elm_Validator_Regexp Elm_Validator_Regexp
 The Regexp validator data.
 

Enumerations

enum  Elm_Regexp_Status {
  ELM_REG_NOERROR = 0 ,
  ELM_REG_NOMATCH ,
  ELM_REG_BADPAT
}
 Enumeration that defines the regex error codes. More...
 

Functions

Elm_Validator_Regexpelm_validator_regexp_new (const char *pattern, const char *signal)
 Create a new regex validator. More...
 
void elm_validator_regexp_free (Elm_Validator_Regexp *validator)
 Delete the existing regex validator. More...
 
Elm_Regexp_Status elm_validator_regexp_status_get (Elm_Validator_Regexp *validator)
 Get the validation status. More...
 
void elm_validator_regexp_helper (void *data, const Efl_Event *event)
 The regex validator. More...
 

Detailed Description

The validation helper feature.

Enumeration Type Documentation

◆ Elm_Regexp_Status

Enumeration that defines the regex error codes.

Since
1.14
Enumerator
ELM_REG_NOERROR 

Regex maches to the Entrys text.

ELM_REG_NOMATCH 

Failed to match.

ELM_REG_BADPAT 

Invalid regular expression.

Function Documentation

◆ elm_validator_regexp_new()

Elm_Validator_Regexp * elm_validator_regexp_new ( const char *  pattern,
const char *  signal 
)

Create a new regex validator.

General designed for validate inputed entry text.

Parameters
patternThe regex pattern
signalThe part of signal name, which will be emitted to style
Returns
The regex validator
See also
elm_validator_regexp_free()
elm_validator_regexp_status_get()
elm_validator_regexp_helper()
Since
1.14

References eina_stringshare_add(), ELM_REG_BADPAT, and ELM_REG_NOERROR.

◆ elm_validator_regexp_free()

void elm_validator_regexp_free ( Elm_Validator_Regexp validator)

Delete the existing regex validator.

Parameters
validatorThe given validator
See also
elm_validator_regexp_new()
Since
1.14

References eina_stringshare_del().

◆ elm_validator_regexp_status_get()

Elm_Regexp_Status elm_validator_regexp_status_get ( Elm_Validator_Regexp validator)

Get the validation status.

Parameters
validatorThe given validator
Note
All return value see here: http://www.gnu.org/software/libc/manual/html_node/Regular-Expressions.html
Since
1.14

◆ elm_validator_regexp_helper()

void elm_validator_regexp_helper ( void *  data,
const Efl_Event *  event 
)

The regex validator.

Used as callback to validate event.

Example:

extern Evas_Object *parent;
Evas_Object *entry;
//add validator
entry = elm_entry_add(parent);
re = elm_validator_regexp_new("^[0-9]*$", NULL);
efl_event_callback_add(entry, ELM_ENTRY_EVENT_VALIDATE, elm_validator_regexp_helper, re);
//delete validator
efl_event_callback_del(entry, ELM_ENTRY_EVENT_VALIDATE, elm_validator_regexp_helper, re);
#define ELM_ENTRY_EVENT_VALIDATE
Called when validating.
Definition: elm_entry_eo.h:1303
Evas_Object * elm_entry_add(Evas_Object *parent)
This adds an entry to parent object.
Definition: elm_entry.c:4184
Efl_Canvas_Object Evas_Object
An Evas Object handle.
Definition: Evas_Common.h:185
void elm_validator_regexp_helper(void *data, const Efl_Event *event)
The regex validator.
Definition: elm_helper.c:42
struct _Elm_Validator_Regexp Elm_Validator_Regexp
The Regexp validator data.
Definition: elm_helper.h:23
Elm_Validator_Regexp * elm_validator_regexp_new(const char *pattern, const char *sig)
Create a new regex validator.
Definition: elm_helper.c:16
See also
elm_validator_regexp_new()
Since
1.14

References ELM_REG_NOERROR, and ELM_REG_NOMATCH.