## FolksSimpleQuery FolksSimpleQuery — A simple text-based contact query. |

## Functions

FolksSimpleQuery * | folks_simple_query_new ()
const gchar * | folks_simple_query_get_query_string ()
void | folks_simple_query_set_query_string ()
const gchar * | folks_simple_query_get_query_locale ()
void | folks_simple_query_set_query_locale ()

## Types and Values

#define | FOLKS_TYPE_SIMPLE_QUERY
struct | FolksSimpleQuery
struct | FolksSimpleQueryClass

## Description

This is a generic implementation of the FolksQuery interface which supports general UI-style search use cases. It implements case-insensitive prefix matching, with transliteration of accents and other non-ASCII characters to improve matching against accented characters. It also normalises phone numbers to make matches invariant to hyphenation and spacing in phone numbers.

See also: FolksSearchView

## Functions

### folks_simple_query_new ()

    FolksSimpleQuery *
    folks_simple_query_new (const gchar *query_string,
                            gchar **match_fields,
                            gint match_fields_length1);

Create a simple text query.

#### Parameters

query_string | . text to match contacts against. Results will match all tokens within the whitespace-delimited string (logical-ANDing the tokens). A value of "" will match all contacts. However, it is recommended to not use a query at all if filtering is not required. . | [in]
match_fields | . the field names to apply this query to. See "match-fields" for more details. An empty array will match all contacts. However, it is recommended to use the FolksIndividualAggregator directly if filtering is not required. FolksPersonaDetail and `folks_persona_store_detail_key()` for pre-defined field names. . | [in][array length=match_fields_length1]
match_fields_length1 | length of the `match_fields` array |

Since: 0.11.0

### folks_simple_query_get_query_string ()

    const gchar *
    folks_simple_query_get_query_string (FolksSimpleQuery *self);

Get and return the current value of the "query-string" property.

The text query string.

This re-evaluates the query immediately, so most clients should implement de-bouncing to ensure re-evaluation only happens when (for example) the user has stopped typing a new query.

#### Parameters

self | the FolksSimpleQuery instance to query |

#### Returns

the value of the "query-string" property

Since: 0.11.0

### folks_simple_query_set_query_string ()

    void
    folks_simple_query_set_query_string (FolksSimpleQuery *self,
                                         const gchar *value);

Set the value of the "query-string" property to `value` .

The text query string.

This re-evaluates the query immediately, so most clients should implement de-bouncing to ensure re-evaluation only happens when (for example) the user has stopped typing a new query.

#### Parameters

self | the FolksSimpleQuery instance to modify |
value | the new value of the "query-string" property |

Since: 0.11.0

### folks_simple_query_get_query_locale ()

    const gchar *
    folks_simple_query_get_query_locale (FolksSimpleQuery *self);

Get and return the current value of the "query-locale" property.

Locale to interpret the `query_string` in.

If possible, locale-specific query string transliteration is done to increase the number of matches. Set this property to a POSIX locale name (e.g. ‘en’, ‘de_DE’, ‘de_DE`euro`’ or ‘C’) to potentially improve the transliteration performed.

This may be `null` if the locale is unknown, in which case the current locale will be used. To perform transliteration for no specific locale, use `C`.

#### Parameters

self | the FolksSimpleQuery instance to query |

#### Returns

the value of the "query-locale" property

Since: 0.11.0

### folks_simple_query_set_query_locale ()

    void
    folks_simple_query_set_query_locale (FolksSimpleQuery *self,
                                         const gchar *value);

Set the value of the "query-locale" property to `value` .

Locale to interpret the `query_string` in.

If possible, locale-specific query string transliteration is done to increase the number of matches. Set this property to a POSIX locale name (e.g. ‘en’, ‘de_DE’, ‘de_DE`euro`’ or ‘C’) to potentially improve the transliteration performed.

This may be `null` if the locale is unknown, in which case the current locale will be used. To perform transliteration for no specific locale, use `C`.

#### Parameters

self | the FolksSimpleQuery instance to modify |
value | the new value of the "query-locale" property |

Since: 0.11.0

## Types and Values

### FOLKS_TYPE_SIMPLE_QUERY

    #define FOLKS_TYPE_SIMPLE_QUERY (folks_simple_query_get_type ())

The type for FolksSimpleQuery.

### struct FolksSimpleQuery

    struct FolksSimpleQuery {
    	FolksQuery parent_instance;
    	FolksSimpleQueryPrivate * priv;
    };

A simple text-based contact query.

This is a generic implementation of the FolksQuery interface which supports general UI-style search use cases. It implements case-insensitive prefix matching, with transliteration of accents and other non-ASCII characters to improve matching against accented characters. It also normalises phone numbers to make matches invariant to hyphenation and spacing in phone numbers.

See also: FolksSearchView

Since: 0.11.0

### struct FolksSimpleQueryClass

    struct FolksSimpleQueryClass {
    	FolksQueryClass parent_class;
    };

The class structure for `FOLKS_TYPE_SIMPLE_QUERY`. All the fields in this structure are private and should never be accessed directly.

#### Members