inputCodeRec

inputCodeRec — Functions for input code records.

Stability Level

Stable, unless otherwise indicated

Synopsis




gchar*              inputMethod_to_string               (InputMethod method);
InputMethod         inputMethod_parse                   (const char *str);
InputCodeRec*       inputCodeRec_new                    (InputMethod method,
                                                         const gchar *inputCode);
void                inputCodeRec_free                   (InputCodeRec *iRec);
void                inputCodeRec_copy                   (InputCodeRec *dest,
                                                         InputCodeRec *src);
gchar*              inputCodeRec_to_string              (InputCodeRec *self);
InputCodeRecList*   inputCodeRecList_new                ();
gchar*              inputCodeRecList_free               (InputCodeRecList *self,
                                                         gboolean free_segment);
guint               inputCodeRecList_size               (InputCodeRecList *self);
gboolean            inputCodeRecList_has_inputMethod    (InputCodeRecList *self,
                                                         InputMethod im);
gchar*              inputCodeRecList_get_inputCode      (InputCodeRecList *self,
                                                         InputMethod im);
gchar**             inputCodeRecList_get_inputCode_array
                                                        (InputCodeRecList *self,
                                                         InputMethod im);
InputCodeRec*       inputCodeRecList_index              (InputCodeRecList *self,
                                                         guint index);
void                inputCodeRecList_copy               (InputCodeRecList *self,
                                                         InputCodeRecList *src);
void                inputCodeRecList_reset              (InputCodeRecList *self);
gint                inputCodeRecList_find_inputCodeRec_index
                                                        (InputCodeRecList *self,
                                                         InputCodeRec *iRec);
InputCodeRec*       inputCodeRecList_find_inputCodeRec  (InputCodeRecList *self,
                                                         InputCodeRec *iRec);
void                inputCodeRecList_append             (InputCodeRecList *self,
                                                         InputCodeRec *iRec);
gboolean            inputCodeRecList_remove             (InputCodeRecList *self,
                                                         InputCodeRec *iRec);

Description

A input code records (InputCodeRec) consists input method and corresponding input code. Functions of input method and input code record can be found here, while the data structures is located at (InputCodeRec).

Details

inputMethod_to_string ()

gchar*              inputMethod_to_string               (InputMethod method);

method :

input method

Returns :

string representation of the given input method. Return string representation of the given input method.

inputMethod_parse ()

InputMethod         inputMethod_parse                   (const char *str);

str :

the string to be parsed.

Returns :

Corresponding input method, IM_INVALID if str cannot be parsed.

inputCodeRec_new ()

InputCodeRec*       inputCodeRec_new                    (InputMethod method,
                                                         const gchar *inputCode);

Allocate a new input code record.

method :

the input method for the new inputCodeRec.

inputCode :

the input code for the new inputCodeRec.

Returns :

New inputCodeRec with given input method an input code.

inputCodeRec_free ()

void                inputCodeRec_free                   (InputCodeRec *iRec);

Free the given input code record.

iRec :

the input code record.

inputCodeRec_copy ()

void                inputCodeRec_copy                   (InputCodeRec *dest,
                                                         InputCodeRec *src);

Deep copy from source input code record.

dest :

the destination input code record.

src :

the source input code record.

inputCodeRec_to_string ()

gchar*              inputCodeRec_to_string              (InputCodeRec *self);

Return string representation of input code record as: Method=method Code=[inputCode]

self :

the input code record

Returns :

string representation of input code record.

inputCodeRecList_new ()

InputCodeRecList*   inputCodeRecList_new                ();

Returns :

an array of input code records, It can be expended as needed.

inputCodeRecList_free ()

gchar*              inputCodeRecList_free               (InputCodeRecList *self,
                                                         gboolean free_segment);

Free the input code record list. The behavior is similar to g_array_free Set free_segment to FALSE to keep the elements in the list, while free_segment=TRUE indicates to free the elements as well.

self :

the input code record list

free_segment :

whether the elements in the list be freed as well.

Returns :

A pointer to the elements of the list if free_segment is FALSE; NULL otherwise.

inputCodeRecList_size ()

guint               inputCodeRecList_size               (InputCodeRecList *self);

Return the number of input code records in the list.

self :

the input code record list

Returns :

the number of input code records in the list.

inputCodeRecList_has_inputMethod ()

gboolean            inputCodeRecList_has_inputMethod    (InputCodeRecList *self,
                                                         InputMethod im);

Whether the list has an input code record.

self :

the input code record list

im :

input method to be searched.

Returns :

TRUE if at least one of the input code records have that input method; FALSE otherwise.

inputCodeRecList_get_inputCode ()

gchar*              inputCodeRecList_get_inputCode      (InputCodeRecList *self,
                                                         InputMethod im);

Return corresponding inputCode. Note: space will be used as delimiter if multiple input code records match.

self :

the input code record list

im :

the inputMethod, use IM_NOT_SPECIFIED if all input codes are required.

Returns :

input code, separated by space.

inputCodeRecList_get_inputCode_array ()

gchar**             inputCodeRecList_get_inputCode_array
                                                        (InputCodeRecList *self,
                                                         InputMethod im);

A convenient call to get the array of inputCode. Free the array using g_strfreev()

self :

the input code record list

im :

the inputMethod, use IM_NOT_SPECIFIED if all input codes are required.

Returns :

corresponding array of inputCode

inputCodeRecList_index ()

InputCodeRec*       inputCodeRecList_index              (InputCodeRecList *self,
                                                         guint index);

Return the input code record at the given index.

self :

the input code record list

index :

the index of the input code record to be returned.

Returns :

the input code record in self at index given by index.

inputCodeRecList_copy ()

void                inputCodeRecList_copy               (InputCodeRecList *self,
                                                         InputCodeRecList *src);

Deep copy from src to self.

self :

the input code record list.

src :

the source input code record list.

inputCodeRecList_reset ()

void                inputCodeRecList_reset              (InputCodeRecList *self);

Reset (remove all elements) the given input code record list.

self :

the input code record list

inputCodeRecList_find_inputCodeRec_index ()

gint                inputCodeRecList_find_inputCodeRec_index
                                                        (InputCodeRecList *self,
                                                         InputCodeRec *iRec);

Return the index of first matched input code record.

See also inputCodeRecList_find_inputCodeRec().

self :

the input code record list

iRec :

the input code record to be found.

Returns :

the index of first matched input code record, negative if not found.

inputCodeRecList_find_inputCodeRec ()

InputCodeRec*       inputCodeRecList_find_inputCodeRec  (InputCodeRecList *self,
                                                         InputCodeRec *iRec);

Return the first matched input code record.

See also inputCodeRecList_find_inputCodeRec_index().

self :

the input code record list

iRec :

the input code record to be found.

Returns :

the first matched input code record, negative if not found.

inputCodeRecList_append ()

void                inputCodeRecList_append             (InputCodeRecList *self,
                                                         InputCodeRec *iRec);

Append iRec to the input code record list self.

As the iRec will be duplicated to array elements, g_free() iRec if it is no longer needed.

self :

the input code record list

iRec :

the input code record to be appended.

inputCodeRecList_remove ()

gboolean            inputCodeRecList_remove             (InputCodeRecList *self,
                                                         InputCodeRec *iRec);

Return TRUE if the input code record was in the list and removed, FALSE if iRec was not in self.

self :

the input code record list.

iRec :

the input code record to be removed.

Returns :

TRUE if the input code record was in the list and removed, FALSE if iRec was not in self.

See Also

WritRecogn-Types