TelepathyGLib.ContactSearch

g GObject.GInterface GObject.GInterface Gio.AsyncInitable Gio.AsyncInitable GObject.GInterface->Gio.AsyncInitable GObject.Object GObject.Object TelepathyGLib.ContactSearch TelepathyGLib.ContactSearch GObject.Object->TelepathyGLib.ContactSearch Gio.AsyncInitable->TelepathyGLib.ContactSearch

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.AsyncInitable (4)

Structs:

GObject.ObjectClass (5)

class

new_async (account, server, limit, callback, *user_data)

class

new_finish (result)

get_account ()

get_limit ()

get_search_keys ()

get_server ()

reset_async (server, limit, callback, *user_data)

reset_finish (result)

start (criteria)

Virtual Methods

Inherited:

GObject.Object (7), Gio.AsyncInitable (2)

Properties

Name

Type

Flags

Short Description

account

TelepathyGLib.Account

r/w/co

A TelepathyGLib.Account used to create search channels

limit

int

r/w

The maximum number of results to be returned by the server

server

str

r/w/co

The server on which to search for contacts

state

int

r

The search’s state

Signals

Inherited:

GObject.Object (1)

Name

Short Description

search-results-received

Emitted when search results are received.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class TelepathyGLib.ContactSearch(**kwargs)
Bases:

GObject.Object, Gio.AsyncInitable

Abstract:

No

Structure:

TelepathyGLib.ContactSearchClass

An object for Telepathy contact searches. There are no interesting public struct fields.

New in version 0.13.11.

classmethod new_async(account, server, limit, callback, *user_data)
Parameters:

New in version 0.13.11.

classmethod new_finish(result)
Parameters:

result (Gio.AsyncResult) – the Gio.AsyncResult from the callback

Raises:

GLib.Error

Returns:

a new contact search object, or None in case of error.

Return type:

TelepathyGLib.ContactSearch

New in version 0.13.11.

get_account()
Returns:

The TelepathyGLib.ContactSearch :account property

Return type:

TelepathyGLib.Account

New in version 0.13.11.

get_limit()
Returns:

The TelepathyGLib.ContactSearch :limit property

Return type:

int

New in version 0.13.11.

get_search_keys()
Returns:

the new search keys, or None.

Return type:

[str]

Get the search keys for a contact search. The keys are vCard field names in lower case, except when they’re one of the special cases from telepathy-spec like “tel;cell” or “x-n-given”. See the

Channel.Type.ContactSearch interface for a list of the special cases.

New in version 0.13.11.

get_server()
Returns:

The TelepathyGLib.ContactSearch :server property

Return type:

str

New in version 0.13.11.

reset_async(server, limit, callback, *user_data)
Parameters:
  • server (str) – the server on which to search for contacts, or None

  • limit (int) – The maximum number of results the server should return, or 0 for the server default.

  • callback (Gio.AsyncReadyCallback or None) – a Gio.AsyncReadyCallback to call when the initialization is finished

  • user_data (object or None) – data to pass to the callback function

Resets the contact search object so a new search can be performed. If another TelepathyGLib.ContactSearch.reset_async() call is in progress, it will be cancelled and TelepathyGLib.ContactSearch.reset_finish() will return an appropriate error.

New in version 0.13.11.

reset_finish(result)
Parameters:

result (Gio.AsyncResult) – the Gio.AsyncResult from the callback

Raises:

GLib.Error

Returns:

the new search keys, or None in case of error.

Return type:

[str]

New in version 0.13.11.

start(criteria)
Parameters:

criteria ({str: str}) – a map from keys returned by TelepathyGLib.ContactSearch.get_search_keys() to values to search for

Starts a search for the keys specified in criteria. Connect to the TelepathyGLib.ContactSearch ::search-results-received signal before calling this function.

Before searching again on the same TelepathyGLib.ContactSearch, you must call TelepathyGLib.ContactSearch.reset_async().

New in version 0.13.11.

Signal Details

TelepathyGLib.ContactSearch.signals.search_results_received(contact_search, results)
Signal Name:

search-results-received

Flags:

RUN_LAST

Parameters:

Emitted when search results are received. Note that this signal may be emitted multiple times for the same search.

New in version 0.13.11.

Property Details

TelepathyGLib.ContactSearch.props.account
Name:

account

Type:

TelepathyGLib.Account

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

This search’s account.

New in version 0.13.11.

TelepathyGLib.ContactSearch.props.limit
Name:

limit

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The maximum number of results that the server should return. This is only supported by some protocols; use TelepathyGLib.Capabilities.supports_contact_search() to check if it’s supported.

To change the limit after the object has been constructed, use TelepathyGLib.ContactSearch.reset_async().

New in version 0.13.11.

TelepathyGLib.ContactSearch.props.server
Name:

server

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The search server. This is only supported by some protocols; use TelepathyGLib.Capabilities.supports_contact_search() to check if it’s supported.

To change the server after the object has been constructed, use TelepathyGLib.ContactSearch.reset_async().

New in version 0.13.11.

TelepathyGLib.ContactSearch.props.state
Name:

state

Type:

int

Default Value:

0

Flags:

READABLE

This search’s state, as a TelepathyGLib.ChannelContactSearchState.

New in version 0.13.11.