OssoABookAccountModel

OssoABookAccountModel — A GtkTreeModel listing GalagoAccount objects.

Synopsis




            OssoABookAccountModel;
enum        OssoABookAccountModelColumn;
            OssoABookAccountModelTuple;
OssoABookAccountModel* osso_abook_account_model_new
                                            (OssoABookAccountTypeFlags flags);
OssoABookAccountTypeFlags osso_abook_account_model_get_flags
                                            (OssoABookAccountModel *model);
gboolean    osso_abook_account_model_get_iter
                                            (OssoABookAccountModel *model,
                                             OssoABookAccountModelTuple *tuple,
                                             GtkTreeIter *iter);
OssoABookAccountModelTuple* osso_abook_account_model_tuple_new
                                            (EContact *contact,
                                             OssoABookAccount *account);
OssoABookAccountModelTuple* osso_abook_account_model_tuple_ref
                                            (OssoABookAccountModelTuple *tuple);
void        osso_abook_account_model_tuple_unref
                                            (OssoABookAccountModelTuple *tuple);
guint       osso_abook_account_model_tuple_hash
                                            (OssoABookAccountModelTuple *tuple);
gboolean    osso_abook_account_model_tuple_equal
                                            (OssoABookAccountModelTuple *a,
                                             OssoABookAccountModelTuple *b);


Object Hierarchy


  GObject
   +----GtkListStore
         +----OssoABookTreeModel
               +----OssoABookAccountModel

Implemented Interfaces

OssoABookAccountModel implements GtkTreeModel, GtkTreeDragSource, GtkTreeDragDest and GtkTreeSortable.

Properties


  "flags"                guint                 : Read / Write
  "single-contact"       EContact              : Read / Write

Description

The OssoABookAccountModel is a model that lists the GalagoAccount objects of accounts from EContact objects exposed by an EBookView, and their associated OssoABookAccountPresence objects.

Details

OssoABookAccountModel

typedef struct _OssoABookAccountModel OssoABookAccountModel;

There are no public fields in OssoABookAccountModel.


enum OssoABookAccountModelColumn

typedef enum {
        OSSO_ABOOK_ACCOUNT_MODEL_COL_CONTACT  = 0,
           OSSO_ABOOK_ACCOUNT_MODEL_COL_PRESENCE = 1,
           OSSO_ABOOK_ACCOUNT_MODEL_COL_TUPLE    = 2
} OssoABookAccountModelColumn;

The columns in an OssoABookAccountModel.

The data columns of the model. Data cell data can be retreived using gtk_tree_model_get().

OSSO_ABOOK_ACCOUNT_MODEL_COL_CONTACT The contact column, containing an EContact
OSSO_ABOOK_ACCOUNT_MODEL_COL_PRESENCE The presence column, containing an OssoABookAccountPresence
OSSO_ABOOK_ACCOUNT_MODEL_COL_TUPLE The tuple column, containing an OssoABookAccountModelTuple

OssoABookAccountModelTuple

typedef struct {
        EContact         *contact;
        OssoABookAccount *account;

        int               ref_count;
} OssoABookAccountModelTuple;

Links an EContact to an OssoABookAccount.

EContact *contact; EContact of the tuple.
OssoABookAccount *account; OssoABookAccount of the tuple.
int ref_count; Reference count of the tuple struct.

osso_abook_account_model_new ()

OssoABookAccountModel* osso_abook_account_model_new
                                            (OssoABookAccountTypeFlags flags);

Creates a new OssoABookAccountModel object listing accounts of types specified by flags. Note that for any accounts to show up, the newly created model should be bound to an EBookView using osso_abook_tree_model_set_book_view().

flags : An OssoABookAccountTypeFlags bitmask specifying the type of accounts to be listed
Returns : A new OssoABookAccouthModel object.

osso_abook_account_model_get_flags ()

OssoABookAccountTypeFlags osso_abook_account_model_get_flags
                                            (OssoABookAccountModel *model);

Retrieves the OssoABookAccountTypeFlags bitmask indicating the type of accounts listed.

model : An OssoABookAccountModel
Returns : OssoABookAccountTypeFlags bitmask indicating the type of accounts listed.

osso_abook_account_model_get_iter ()

gboolean    osso_abook_account_model_get_iter
                                            (OssoABookAccountModel *model,
                                             OssoABookAccountModelTuple *tuple,
                                             GtkTreeIter *iter);

Retreives the GtkTreeIter associated with tuple, and stores it in iter.

model : An OssoABookAccountModel
tuple : An OssoABookAccountModelTuple
iter : A GtkTreeIter. Can be NULL.
Returns : TRUE if tuple was included in model, FALSE otherwise.

osso_abook_account_model_tuple_new ()

OssoABookAccountModelTuple* osso_abook_account_model_tuple_new
                                            (EContact *contact,
                                             OssoABookAccount *account);

Allocate a new OssoABookAccountModelTuple object containing contact and account.

contact : An EContact
account : An OssoABookAccount
Returns : A newly allocated OssoABookAccountModelTuple.

osso_abook_account_model_tuple_ref ()

OssoABookAccountModelTuple* osso_abook_account_model_tuple_ref
                                            (OssoABookAccountModelTuple *tuple);

Increase the ref count of tuple.

tuple : An OssoABookAccountModelTuple
Returns : A reference to tuple, for use in embedding the command.

osso_abook_account_model_tuple_unref ()

void        osso_abook_account_model_tuple_unref
                                            (OssoABookAccountModelTuple *tuple);

Decrease the ref count of tuple.


osso_abook_account_model_tuple_hash ()

guint       osso_abook_account_model_tuple_hash
                                            (OssoABookAccountModelTuple *tuple);

Converts tuple to a hash value. It can be passed to g_hash_table_new() as the hash_func parameter, when using tuples as keys in a GHashTable.

tuple : An OssoABookAccountModelTuple
Returns : a hash value corresponding to the key.

osso_abook_account_model_tuple_equal ()

gboolean    osso_abook_account_model_tuple_equal
                                            (OssoABookAccountModelTuple *a,
                                             OssoABookAccountModelTuple *b);

Compares two tuples and returns TRUE if they are equal. It can be passed to g_hash_table_new() as the key_equal_func parameter, when using tuples as keys in a GHashTable.

a : An OssoABookAccountModelTuple
b : An OssoABookAccountModelTuple
Returns : TRUE if the two keys match.

Properties

The "flags" property

  "flags"                guint                 : Read / Write

The flags specifying the types of accounts to be listed.

Allowed values: <= 7

Default value: 0


The "single-contact" property

  "single-contact"       EContact              : Read / Write

The EContact whose accounts are exclusively exposed.

See Also

OssoABookAccountView, OssoABookAccountSelector, OssoABookAccountPresence