CapuchinGAppObject

CapuchinGAppObject

Synopsis

enum                CapuchinGAppObjectActionType;
                    CapuchinGAppObject;
CapuchinGAppObject* capuchin_g_app_object_new           (DBusGProxy *proxy);
void                capuchin_g_app_object_update        (CapuchinGAppObject *appobject,
                                                         gboolean force_update,
                                                         GError **error);
void                capuchin_g_app_object_update_async  (CapuchinGAppObject *appobject,
                                                         gboolean force_update);
void                capuchin_g_app_object_install       (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         GError **error);
gchar*              capuchin_g_app_object_get_application_name
                                                        (CapuchinGAppObject *appobject,
                                                         GError **error);
gchar**             capuchin_g_app_object_get_available_plugins
                                                        (CapuchinGAppObject *appobject,
                                                         GError **error);
gchar**             capuchin_g_app_object_get_available_updates
                                                        (CapuchinGAppObject *appobject,
                                                         CapuchinGPluginInfo **plugins,
                                                         GError **error);
gchar**             capuchin_g_app_object_get_plugins_with_tag
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *tag,
                                                         GError **error);
gchar*              capuchin_g_app_object_get_plugin_name
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         GError **error);
gchar*              capuchin_g_app_object_get_plugin_description
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         GError **error);
gchar*              capuchin_g_app_object_get_plugin_changes
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         const gchar *version,
                                                         GError **error);
gchar**             capuchin_g_app_object_get_plugin_tags
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         GError **error);
CapuchinGPluginAuthor* capuchin_g_app_object_get_plugin_author
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         GError **error);
gchar*              capuchin_g_app_object_get_plugin_version
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         GError **error);
gchar**             capuchin_g_app_object_get_tags      (CapuchinGAppObject *appobject,
                                                         GError **error);
void                capuchin_g_app_object_close         (CapuchinGAppObject *appobject,
                                                         GError **error);

Object Hierarchy

  GObject
   +----CapuchinGAppObject

Signals

  "install-finished"                               : Run Last
  "status"                                         : Run Last
  "update-finished"                                : Run Last

Description

Details

enum CapuchinGAppObjectActionType

typedef enum /*< underscore_name=capuchin_g_app_object_action >*/
{
	CAPUCHIN_G_APP_OBJECT_ACTION_UPDATING_REPO,
	CAPUCHIN_G_APP_OBJECT_ACTION_DOWNLOADING_PLUGIN,
	CAPUCHIN_G_APP_OBJECT_ACTION_EXTRACTING_PLUGIN
} CapuchinGAppObjectActionType;


CapuchinGAppObject

typedef struct _CapuchinGAppObject CapuchinGAppObject;


capuchin_g_app_object_new ()

CapuchinGAppObject* capuchin_g_app_object_new           (DBusGProxy *proxy);

Usually, you don't have to use this method, because capuchin_g_app_object_manager_get_appobject() is more convenient

proxy :

A DBusGProxy object that represents the AppObject for the repository

Returns :

A new CapuchinGAppObject object

capuchin_g_app_object_update ()

void                capuchin_g_app_object_update        (CapuchinGAppObject *appobject,
                                                         gboolean force_update,
                                                         GError **error);

Load the repository. This method returns when the update process completed.

appobject :

CapuchinGAppObject of the repository

force_update :

Whether to force to download the XML file from the server or use the cached one, if no newer version is available

error :

a GError location to store the error occuring, or NULL to ignore.

capuchin_g_app_object_update_async ()

void                capuchin_g_app_object_update_async  (CapuchinGAppObject *appobject,
                                                         gboolean force_update);

Load the repository. The repository has been initialized when the CapuchinGAppObject::update-finished signal has been emitted.

appobject :

CapuchinGAppObject of the repository

force_update :

Whether to force to download the XML file from the server or use the cached one, if no newer version is available

capuchin_g_app_object_install ()

void                capuchin_g_app_object_install       (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         GError **error);

Update the plugin given ID. During the installation progess the CapuchinGAppObject::status signal will be emitted. When the process is complete the CapuchinGAppObject::install-finished signal will be emitted.

appobject :

CapuchinGAppObject of the repository

plugin_id :

Plugin's ID

error :

a GError location to store the error occuring, or NULL to ignore.

capuchin_g_app_object_get_application_name ()

gchar*              capuchin_g_app_object_get_application_name
                                                        (CapuchinGAppObject *appobject,
                                                         GError **error);

Get the name of the application the repository belongs to. You have to free it with g_free().

appobject :

CapuchinGAppObject of the repository

error :

a GError location to store the error occuring, or NULL to ignore.

Returns :

The name of the application the repository belongs to or NULL if an error occured

capuchin_g_app_object_get_available_plugins ()

gchar**             capuchin_g_app_object_get_available_plugins
                                                        (CapuchinGAppObject *appobject,
                                                         GError **error);

Get all plugins from the repository. You have to free it with g_strfreev().

appobject :

CapuchinGAppObject of the repository

error :

a GError location to store the error occuring, or NULL to ignore.

Returns :

An array of plugin IDs or NULL if an error occured

capuchin_g_app_object_get_available_updates ()

gchar**             capuchin_g_app_object_get_available_updates
                                                        (CapuchinGAppObject *appobject,
                                                         CapuchinGPluginInfo **plugins,
                                                         GError **error);

Get all available updates. You have to free it with g_strfreev().

appobject :

CapuchinGAppObject of the repository

plugins :

A null terminated array of CapuchinGPluginInfo objects

error :

a GError location to store the error occuring, or NULL to ignore. representing the plugins that should be checked for updates

Returns :

An array of plugin IDs or NULL if an error occured

capuchin_g_app_object_get_plugins_with_tag ()

gchar**             capuchin_g_app_object_get_plugins_with_tag
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *tag,
                                                         GError **error);

Get all plugins that are tagged with the given tag. You have to free it with g_strfreev().

appobject :

CapuchinGAppObject of the repository

tag :

A tag

error :

a GError location to store the error occuring, or NULL to ignore.

Returns :

A list of plugin IDs or NULL if an error occured

capuchin_g_app_object_get_plugin_name ()

gchar*              capuchin_g_app_object_get_plugin_name
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         GError **error);

Get name of plugin with given ID. You have to free it with g_free().

appobject :

CapuchinGAppObject of the repository

plugin_id :

Plugin's ID

error :

a GError location to store the error occuring, or NULL to ignore.

Returns :

Plugin's name or NULL if an error occured

capuchin_g_app_object_get_plugin_description ()

gchar*              capuchin_g_app_object_get_plugin_description
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         GError **error);

Get description of plugin with given ID. You have to free it with g_free().

appobject :

CapuchinGAppObject of the repository

plugin_id :

Plugin's ID

error :

a GError location to store the error occuring, or NULL to ignore.

Returns :

Plugin's descriptio

capuchin_g_app_object_get_plugin_changes ()

gchar*              capuchin_g_app_object_get_plugin_changes
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         const gchar *version,
                                                         GError **error);

Get changes for plugin with given ID made in given version. You have to free it with g_free().

appobject :

CapuchinGAppObject of the repository

plugin_id :

Plugin's ID

version :

Plugin's version that you want to get the changes from

error :

a GError location to store the error occuring, or NULL to ignore.

Returns :

Changes or NULL if an error occured

capuchin_g_app_object_get_plugin_tags ()

gchar**             capuchin_g_app_object_get_plugin_tags
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         GError **error);

Get tags for the plugin given ID. You have to free it with g_strfreev().

appobject :

CapuchinGAppObject of the repository

plugin_id :

Plugin's ID

error :

a GError location to store the error occuring, or NULL to ignore.

Returns :

Array of tags for the plugin or NULL if an error occured

capuchin_g_app_object_get_plugin_author ()

CapuchinGPluginAuthor* capuchin_g_app_object_get_plugin_author
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         GError **error);

Get the author's name and e-mail address for the plugin given ID

appobject :

CapuchinGAppObject of the repository

plugin_id :

Plugin's ID

error :

a GError location to store the error occuring, or NULL to ignore.

Returns :

CapuchinGPluginAuthor or NULL if an error occured

capuchin_g_app_object_get_plugin_version ()

gchar*              capuchin_g_app_object_get_plugin_version
                                                        (CapuchinGAppObject *appobject,
                                                         const gchar *plugin_id,
                                                         GError **error);

Get the version of the plugin with given ID. You have to free it with g_free().

appobject :

CapuchinGAppObject of the repository

plugin_id :

Plugin's ID

error :

a GError location to store the error occuring, or NULL to ignore.

Returns :

Plugin's version or NULL if an error occured

capuchin_g_app_object_get_tags ()

gchar**             capuchin_g_app_object_get_tags      (CapuchinGAppObject *appobject,
                                                         GError **error);

Get all available tags available in this repository. You have to free it with g_strfreev().

appobject :

CapuchinGAppObject of the repository

error :

a GError location to store the error occuring, or NULL to ignore.

Returns :

A list of tags or NULL when an error occured

capuchin_g_app_object_close ()

void                capuchin_g_app_object_close         (CapuchinGAppObject *appobject,
                                                         GError **error);

Tell the object that it isn't needed anymore

appobject :

CapuchinGAppObject of the repository

error :

a GError location to store the error occuring, or NULL to ignore.

Signal Details

The "install-finished" signal

void                user_function                      (CapuchinGAppObject *appobject,
                                                        gchar              *plugin_id,
                                                        gpointer            user_data)      : Run Last

Emitted when the plugin has been downloaded and unpacked and is ready to be (re-)loaded by the application

appobject :

The object on which the signal is emitted

plugin_id :

Plugin's ID

user_data :

user data set when the signal handler was connected.

The "status" signal

void                user_function                      (CapuchinGAppObject          *appobject,
                                                        CapuchinGAppObjectActionType action,
                                                        gchar                       *plugin_id,
                                                        gdouble                      progress,
                                                        gint                         speed,
                                                        gpointer                     user_data)      : Run Last

Emitted when the plugin is getting downloaded and extracted after calling capuchin_g_app_object_install()

appobject :

The object on which the signal is emitted

action :

Current action

plugin_id :

The ID of the plugin that the status is related to

progress :

The fraction of the progress that's complete (from 0 to 1), or -1.0 if no information is available on how long it will take

speed :

Download speed

user_data :

user data set when the signal handler was connected.

The "update-finished" signal

void                user_function                      (CapuchinGAppObject *appobject,
                                                        gpointer            user_data)      : Run Last

Emitted when the repository has been updated after calling capuchin_g_app_object_update()

appobject :

The object on which the signal is emitted

user_data :

user data set when the signal handler was connected.