TpHandleRepoIface

TpHandleRepoIface — abstract interface for handle allocation

Synopsis

#include <telepathy-glib/handle-repo.h>

                    TpHandleRepoIface;
                    TpHandleRepoIfaceClass;
gboolean            tp_handle_is_valid                  (TpHandleRepoIface *self,
                                                         TpHandle handle,
                                                         GError **error);
gboolean            tp_handles_are_valid                (TpHandleRepoIface *self,
                                                         const GArray *handles,
                                                         gboolean allow_zero,
                                                         GError **error);
gboolean            tp_handles_supported_and_valid      (TpHandleRepoIface *repos[NUM_TP_HANDLE_TYPES],
                                                         TpHandleType handle_type,
                                                         const GArray *handles,
                                                         gboolean allow_zero,
                                                         GError **error);
void                tp_handle_ref                       (TpHandleRepoIface *self,
                                                         TpHandle handle);
void                tp_handles_ref                      (TpHandleRepoIface *self,
                                                         const GArray *handles);
void                tp_handle_unref                     (TpHandleRepoIface *self,
                                                         TpHandle handle);
void                tp_handles_unref                    (TpHandleRepoIface *self,
                                                         const GArray *handles);
gboolean            tp_handle_client_hold               (TpHandleRepoIface *self,
                                                         const gchar *client,
                                                         TpHandle handle,
                                                         GError **error);
gboolean            tp_handles_client_hold              (TpHandleRepoIface *self,
                                                         const gchar *client,
                                                         const GArray *handles,
                                                         GError **error);
gboolean            tp_handle_client_release            (TpHandleRepoIface *self,
                                                         const gchar *client,
                                                         TpHandle handle,
                                                         GError **error);
gboolean            tp_handles_client_release           (TpHandleRepoIface *self,
                                                         const gchar *client,
                                                         const GArray *handles,
                                                         GError **error);
const char *        tp_handle_inspect                   (TpHandleRepoIface *self,
                                                         TpHandle handle);
void                tp_handle_set_qdata                 (TpHandleRepoIface *repo,
                                                         TpHandle handle,
                                                         GQuark key_id,
                                                         gpointer data,
                                                         GDestroyNotify destroy);
gpointer            tp_handle_get_qdata                 (TpHandleRepoIface *repo,
                                                         TpHandle handle,
                                                         GQuark key_id);
TpHandle            tp_handle_ensure                    (TpHandleRepoIface *self,
                                                         const gchar *id,
                                                         gpointer context,
                                                         GError **error);
TpHandle            tp_handle_lookup                    (TpHandleRepoIface *self,
                                                         const gchar *id,
                                                         gpointer context,
                                                         GError **error);


                    TpHandleSet;
#define             TP_TYPE_HANDLE_SET
void                (*TpHandleSetMemberFunc)            (TpHandleSet *set,
                                                         TpHandle handle,
                                                         gpointer userdata);
TpHandleSet *       tp_handle_set_new                   (TpHandleRepoIface *repo);
TpHandleSet *       tp_handle_set_new_from_array        (TpHandleRepoIface *repo,
                                                         const GArray *array);
TpHandleSet *       tp_handle_set_copy                  (const TpHandleSet *other);
void                tp_handle_set_clear                 (TpHandleSet *set);
void                tp_handle_set_destroy               (TpHandleSet *set);
TpIntSet *          tp_handle_set_peek                  (TpHandleSet *set);
void                tp_handle_set_add                   (TpHandleSet *set,
                                                         TpHandle handle);
gboolean            tp_handle_set_remove                (TpHandleSet *set,
                                                         TpHandle handle);
gboolean            tp_handle_set_is_member             (const TpHandleSet *set,
                                                         TpHandle handle);
void                tp_handle_set_foreach               (TpHandleSet *set,
                                                         TpHandleSetMemberFunc func,
                                                         gpointer userdata);
gboolean            tp_handle_set_is_empty              (const TpHandleSet *set);
int                 tp_handle_set_size                  (const TpHandleSet *set);
GArray *            tp_handle_set_to_array              (const TpHandleSet *set);
TpIntSet *          tp_handle_set_update                (TpHandleSet *set,
                                                         const TpIntSet *add);
TpIntSet *          tp_handle_set_difference_update     (TpHandleSet *set,
                                                         const TpIntSet *remove);

Object Hierarchy

  GInterface
   +----TpHandleRepoIface

Known Implementations

TpHandleRepoIface is implemented by TpDynamicHandleRepo and TpStaticHandleRepo.

Properties

  "handle-type"              guint                 : Read / Write / Construct Only

Description

Abstract interface of a repository for handles, supporting operations which include checking for validity, reference counting, lookup by string value and lookup by numeric value. See TpDynamicHandleRepo and TpStaticHandleRepo for concrete implementations.

Details

TpHandleRepoIface

typedef struct _TpHandleRepoIface TpHandleRepoIface;

Dummy typedef representing any implementation of this interface.


TpHandleRepoIfaceClass

typedef struct _TpHandleRepoIfaceClass TpHandleRepoIfaceClass;

The class of a handle repository interface. The structure layout is only available within telepathy-glib, for the handle repository implementations' benefit.


tp_handle_is_valid ()

gboolean            tp_handle_is_valid                  (TpHandleRepoIface *self,
                                                         TpHandle handle,
                                                         GError **error);

self :

handle :

error :

Returns :


tp_handles_are_valid ()

gboolean            tp_handles_are_valid                (TpHandleRepoIface *self,
                                                         const GArray *handles,
                                                         gboolean allow_zero,
                                                         GError **error);

self :

handles :

allow_zero :

error :

Returns :


tp_handles_supported_and_valid ()

gboolean            tp_handles_supported_and_valid      (TpHandleRepoIface *repos[NUM_TP_HANDLE_TYPES],
                                                         TpHandleType handle_type,
                                                         const GArray *handles,
                                                         gboolean allow_zero,
                                                         GError **error);

repos :

handle_type :

handles :

allow_zero :

error :

Returns :


tp_handle_ref ()

void                tp_handle_ref                       (TpHandleRepoIface *self,
                                                         TpHandle handle);

self :

handle :


tp_handles_ref ()

void                tp_handles_ref                      (TpHandleRepoIface *self,
                                                         const GArray *handles);

self :

handles :


tp_handle_unref ()

void                tp_handle_unref                     (TpHandleRepoIface *self,
                                                         TpHandle handle);

self :

handle :


tp_handles_unref ()

void                tp_handles_unref                    (TpHandleRepoIface *self,
                                                         const GArray *handles);

self :

handles :


tp_handle_client_hold ()

gboolean            tp_handle_client_hold               (TpHandleRepoIface *self,
                                                         const gchar *client,
                                                         TpHandle handle,
                                                         GError **error);

self :

client :

handle :

error :

Returns :


tp_handles_client_hold ()

gboolean            tp_handles_client_hold              (TpHandleRepoIface *self,
                                                         const gchar *client,
                                                         const GArray *handles,
                                                         GError **error);

self :

client :

handles :

error :

Returns :


tp_handle_client_release ()

gboolean            tp_handle_client_release            (TpHandleRepoIface *self,
                                                         const gchar *client,
                                                         TpHandle handle,
                                                         GError **error);

self :

client :

handle :

error :

Returns :


tp_handles_client_release ()

gboolean            tp_handles_client_release           (TpHandleRepoIface *self,
                                                         const gchar *client,
                                                         const GArray *handles,
                                                         GError **error);

self :

client :

handles :

error :

Returns :


tp_handle_inspect ()

const char *        tp_handle_inspect                   (TpHandleRepoIface *self,
                                                         TpHandle handle);

self :

handle :

Returns :


tp_handle_set_qdata ()

void                tp_handle_set_qdata                 (TpHandleRepoIface *repo,
                                                         TpHandle handle,
                                                         GQuark key_id,
                                                         gpointer data,
                                                         GDestroyNotify destroy);

repo :

handle :

key_id :

data :

destroy :


tp_handle_get_qdata ()

gpointer            tp_handle_get_qdata                 (TpHandleRepoIface *repo,
                                                         TpHandle handle,
                                                         GQuark key_id);

repo :

handle :

key_id :

Returns :


tp_handle_ensure ()

TpHandle            tp_handle_ensure                    (TpHandleRepoIface *self,
                                                         const gchar *id,
                                                         gpointer context,
                                                         GError **error);

Return a new reference to the handle for the given string. The handle is normalized, if possible. If no such handle exists it will be created.

self :

A handle repository implementation

id :

A string whose handle is required

context :

User data to be passed to the normalization callback

error :

Used to return an error if 0 is returned

Returns :

the handle corresponding to the given string, or 0 if it is invalid.

tp_handle_lookup ()

TpHandle            tp_handle_lookup                    (TpHandleRepoIface *self,
                                                         const gchar *id,
                                                         gpointer context,
                                                         GError **error);

self :

id :

context :

error :

Returns :


TpHandleSet

typedef struct _TpHandleSet TpHandleSet;

A set of handles. This is similar to a TpIntSet (and implemented using one), but adding a handle to the set also references it.


TP_TYPE_HANDLE_SET

#define TP_TYPE_HANDLE_SET (tp_handle_set_get_type ())


TpHandleSetMemberFunc ()

void                (*TpHandleSetMemberFunc)            (TpHandleSet *set,
                                                         TpHandle handle,
                                                         gpointer userdata);

set :

handle :

userdata :


tp_handle_set_new ()

TpHandleSet *       tp_handle_set_new                   (TpHandleRepoIface *repo);

repo :

Returns :


tp_handle_set_new_from_array ()

TpHandleSet *       tp_handle_set_new_from_array        (TpHandleRepoIface *repo,
                                                         const GArray *array);

repo :

array :

Returns :


tp_handle_set_copy ()

TpHandleSet *       tp_handle_set_copy                  (const TpHandleSet *other);

other :

Returns :


tp_handle_set_clear ()

void                tp_handle_set_clear                 (TpHandleSet *set);

set :


tp_handle_set_destroy ()

void                tp_handle_set_destroy               (TpHandleSet *set);

set :


tp_handle_set_peek ()

TpIntSet *          tp_handle_set_peek                  (TpHandleSet *set);

set :

Returns :


tp_handle_set_add ()

void                tp_handle_set_add                   (TpHandleSet *set,
                                                         TpHandle handle);

set :

handle :


tp_handle_set_remove ()

gboolean            tp_handle_set_remove                (TpHandleSet *set,
                                                         TpHandle handle);

set :

handle :

Returns :


tp_handle_set_is_member ()

gboolean            tp_handle_set_is_member             (const TpHandleSet *set,
                                                         TpHandle handle);

set :

handle :

Returns :


tp_handle_set_foreach ()

void                tp_handle_set_foreach               (TpHandleSet *set,
                                                         TpHandleSetMemberFunc func,
                                                         gpointer userdata);

set :

func :

userdata :


tp_handle_set_is_empty ()

gboolean            tp_handle_set_is_empty              (const TpHandleSet *set);

set :

Returns :


tp_handle_set_size ()

int                 tp_handle_set_size                  (const TpHandleSet *set);

set :

Returns :


tp_handle_set_to_array ()

GArray *            tp_handle_set_to_array              (const TpHandleSet *set);

set :

Returns :


tp_handle_set_update ()

TpIntSet *          tp_handle_set_update                (TpHandleSet *set,
                                                         const TpIntSet *add);

set :

add :

Returns :


tp_handle_set_difference_update ()

TpIntSet *          tp_handle_set_difference_update     (TpHandleSet *set,
                                                         const TpIntSet *remove);

set :

remove :

Returns :

Property Details

The "handle-type" property

  "handle-type"              guint                 : Read / Write / Construct Only

The TpHandleType held in this handle repository.

Default value: 0

See Also

TpDynamicHandleRepo, TpStaticHandleRepo