RtcomAccountItem

RtcomAccountItem — A representation of a McAccount.

Synopsis




            RtcomAccountItem;
RtcomAccountItem* rtcom_account_item_new    (McAccount *account,
                                             RtcomAccountService *service);
gboolean    rtcom_account_item_store_settings
                                            (RtcomAccountItem *item,
                                             GError **error);
gboolean    rtcom_account_item_delete       (RtcomAccountItem *item);
McProfile*  rtcom_account_item_get_mc_profile
                                            (RtcomAccountItem *item);
const gchar* rtcom_account_item_get_unique_name
                                            (RtcomAccountItem *item);
void        rtcom_account_item_changed      (RtcomAccountItem *item);
void        rtcom_account_item_name_change  (RtcomAccountItem *item);
void        rtcom_account_item_enable       (RtcomAccountItem *item,
                                             gboolean enable);

Object Hierarchy


  GObject
   +----AccountItem
         +----RtcomAccountItem

Properties


  "account"              McAccount             : Read / Write

Signals


"name-changed"
            void        user_function      (RtcomAccountItem *account,
                                            gpointer          user_data)      : Run last / Action
"store-settings"
            gboolean    user_function      (RtcomAccountItem *account,
                                            gpointer          error,
                                            gpointer          user_data)      : Run last / Action

Description

This is a subclass of the AccountItem class in libaccounts which implements the account_item_set_enabled() method and includes some functionality commonly expected for McAccount editing.

Account plugins shouln't need to subclass this class, since it already implements all required methods. Also, the only method that might be of use in a plugin implementation is rtcom_account_item_get_mc_profile(); all other methods are already called by other objects in the library as needed.

Details

RtcomAccountItem

typedef struct _RtcomAccountItem RtcomAccountItem;


rtcom_account_item_new ()

RtcomAccountItem* rtcom_account_item_new    (McAccount *account,
                                             RtcomAccountService *service);

Creates a RtcomAccountItem object providing the given service. If account is specified, it will be bound to the newly created object (this will be the case when editing an existing account).

account : a McAccount, or NULL.
service : a RtcomAccountService.
Returns : the RtcomAccountItem created.

rtcom_account_item_store_settings ()

gboolean    rtcom_account_item_store_settings
                                            (RtcomAccountItem *item,
                                             GError **error);

Emits the RtcomAccountItem::store-settings signal.

item : the RtcomAccountItem.
error : a GError, or NULL.
Returns : TRUE if all signal handlers returned TRUE, FALSE otherwise; the error, if not NULL, will be set by the signal handler which returned FALSE.

rtcom_account_item_delete ()

gboolean    rtcom_account_item_delete       (RtcomAccountItem *item);

Deletes the McAccount associated to item.

item : the RtcomAccountItem.
Returns : TRUE on success, FALSE otherwise.

rtcom_account_item_get_mc_profile ()

McProfile*  rtcom_account_item_get_mc_profile
                                            (RtcomAccountItem *item);

Gets the McProfile for this account item.

item : the RtcomAccountItem.
Returns : the McProfile, whose reference count is incremented.

rtcom_account_item_get_unique_name ()

const gchar* rtcom_account_item_get_unique_name
                                            (RtcomAccountItem *item);

Gets the unique name for this account item.

item : the RtcomAccountItem.
Returns : the unique name, or NULL if no McAccount is bound to this item.

rtcom_account_item_changed ()

void        rtcom_account_item_changed      (RtcomAccountItem *item);

Call this function to notify the item that it should reload its data.

item : the RtcomAccountItem.

rtcom_account_item_name_change ()

void        rtcom_account_item_name_change  (RtcomAccountItem *item);

Call this function to notify the item that the account has been modified in such a way that the user has to confirm the last page again before exiting editing. This happens usually when the username or the password have changed.

item : the RtcomAccountItem.

rtcom_account_item_enable ()

void        rtcom_account_item_enable       (RtcomAccountItem *item,
                                             gboolean enable);

Update the "enabled" property of the account.

item : the RtcomAccountItem.
enable : a gboolean.

Property Details

The "account" property

  "account"              McAccount             : Read / Write

McAccount.

Signal Details

The "name-changed" signal

void        user_function                  (RtcomAccountItem *account,
                                            gpointer          user_data)      : Run last / Action

Emitted to signal to the UI that the account has been modified in such a way that the user has to confirm the last page again before exiting editing. This happens usually when the username or the password have changed.

account : The RtcomAccountItem.
user_data : user data set when the signal handler was connected.

The "store-settings" signal

gboolean    user_function                  (RtcomAccountItem *account,
                                            gpointer          error,
                                            gpointer          user_data)      : Run last / Action

Emitted to signal to the UI that it should store the configuration into the McAccount. If some error occurs, the handler should return FALSE and store an error in the error parameter.

account : The RtcomAccountItem.
error : Variable to receive an error.
user_data : user data set when the signal handler was connected.
Returns : TRUE for success, of FALSE.