SharingPluginInterface

SharingPluginInterface — Sharing plugin interface defines the plugin gmodule interface.

Synopsis

enum                SharingPluginInterfaceSendResult;
enum                SharingPluginInterfaceAccountSetupResult;
enum                SharingPluginInterfaceAccountValidateResult;
enum                SharingPluginInterfaceEditAccountResult;
enum                SharingPluginInterfaceUpdateOptionsResult;
guint               (*SharingPluginInterfaceInit)       (gboolean *dead_mans_switch);
guint               (*SharingPluginInterfaceUninit)     (gboolean *dead_mans_switch);
SharingPluginInterfaceSendResult (*SharingPluginInterfaceSend)
                                                        (SharingTransfer *transfer,
                                                         ConIcConnection *con,
                                                         gboolean *dead_mans_switch);
SharingPluginInterfaceAccountSetupResult (*SharingPluginInterfaceAccountSetup)
                                                        (GtkWindow *parent,
                                                         SharingService *service,
                                                         SharingAccount **worked_on,
                                                         osso_context_t *osso);
SharingPluginInterfaceAccountValidateResult (*SharingPluginInterfaceAccountValidate)
                                                        (SharingAccount *account,
                                                         ConIcConnection *con,
                                                         gboolean *cont,
                                                         gboolean *dead_mans_switch);
SharingPluginInterfaceEditAccountResult (*SharingPluginInterfaceEditAccount)
                                                        (GtkWindow *parent,
                                                         SharingAccount *account,
                                                         ConIcConnection *con,
                                                         gboolean *dead_mans_switch);
gboolean            (*SharingPluginInterfaceUpdateOptions)
                                                        (SharingAccount *account,
                                                         ConIcConnection *con,
                                                         gboolean *cont,
                                                         gboolean *dead_mans_switch,
                                                         UpdateOptionsCallback cb_func,
                                                         gpointer cb_data);
void                (*UpdateOptionsCallback)            (SharingPluginInterfaceUpdateOptionsResult result,
                                                         gpointer cb_data);

Description

SharingPluginInterface defines the interface that Sharing framework uses when calling the plugin.

Details

enum SharingPluginInterfaceSendResult

typedef enum {
    SHARING_SEND_SUCCESS = 0,
    SHARING_SEND_ERROR_UNKNOWN = 1,
    SHARING_SEND_ERROR_AUTH = 2,
    SHARING_SEND_ERROR_CONNECTION = 3,
    SHARING_SEND_CANCELLED = 4,
    SHARING_SEND_ERROR_FILE_FORMAT = 5,
    SHARING_SEND_ERROR_UPLOAD_LIMIT = 6,
    SHARING_SEND_ERROR_ACCOUNT_NOT_FOUND = 7,
    SHARING_SEND_ERROR_TIMEOUT = 8
} SharingPluginInterfaceSendResult;

enum SharingPluginInterfaceAccountSetupResult

typedef enum {
    SHARING_ACCOUNT_SETUP_SUCCESS = 0,
    SHARING_ACCOUNT_SETUP_ERROR_UNKNOWN = 1,
    SHARING_ACCOUNT_SETUP_ERROR_CONNECTION = 2
} SharingPluginInterfaceAccountSetupResult;

SHARING_ACCOUNT_SETUP_SUCCESS Setup flow succesfully done.
SHARING_ACCOUNT_SETUP_ERROR_UNKNOWN General failure.
SHARING_ACCOUNT_SETUP_ERROR_CONNECTION Connection & connection timeout error.

enum SharingPluginInterfaceAccountValidateResult

typedef enum {
    SHARING_ACCOUNT_VALIDATE_SUCCESS = 0,
    SHARING_ACCOUNT_VALIDATE_ACCOUNT_NOT_FOUND = 1,
    SHARING_ACCOUNT_VALIDATE_FAILED = 2,
    SHARING_ACCOUNT_VALIDATE_ERROR_UNKNOWN = 3,
    SHARING_ACCOUNT_VALIDATE_ERROR_CONNECTION = 4,
    SHARING_ACCOUNT_VALIDATE_NOT_STARTED = 5,
    SHARING_ACCOUNT_VALIDATE_CANCELLED = 6
} SharingPluginInterfaceAccountValidateResult;

SHARING_ACCOUNT_VALIDATE_SUCCESS Setup flow succesfully done.
SHARING_ACCOUNT_VALIDATE_ACCOUNT_NOT_FOUND Account data could not be loaded.
SHARING_ACCOUNT_VALIDATE_FAILED Account information invalid.
SHARING_ACCOUNT_VALIDATE_ERROR_UNKNOWN General error.
SHARING_ACCOUNT_VALIDATE_ERROR_CONNECTION Connection & connection timeout
SHARING_ACCOUNT_VALIDATE_NOT_STARTED Validation process not started.
SHARING_ACCOUNT_VALIDATE_CANCELLED Returned when dialog is validating dialog is closed by user.

enum SharingPluginInterfaceEditAccountResult

typedef enum {
    SHARING_EDIT_ACCOUNT_SUCCESS = 0,
    SHARING_EDIT_ACCOUNT_ERROR_UNKNOWN = 1,
    SHARING_EDIT_ACCOUNT_ERROR_CONNECTION = 2,
    SHARING_EDIT_ACCOUNT_NOT_STARTED = 3,
    SHARING_EDIT_ACCOUNT_DELETE = 4,
    SHARING_EDIT_ACCOUNT_CANCELLED = 5
} SharingPluginInterfaceEditAccountResult;

SHARING_EDIT_ACCOUNT_SUCCESS Editing succesfully done.
SHARING_EDIT_ACCOUNT_ERROR_UNKNOWN General error.
SHARING_EDIT_ACCOUNT_ERROR_CONNECTION Connection & connection timeout.
SHARING_EDIT_ACCOUNT_NOT_STARTED Editing process not started.
SHARING_EDIT_ACCOUNT_DELETE Account is wanted to be deleted.
SHARING_EDIT_ACCOUNT_CANCELLED Editing cancelled.

enum SharingPluginInterfaceUpdateOptionsResult

typedef enum {
    SHARING_UPDATE_OPTIONS_SUCCESS = 0,
    SHARING_UPDATE_OPTIONS_ERROR_UNKNOWN = 1,
    SHARING_UPDATE_OPTIONS_CANCELLED = 2,
    SHARING_UPDATE_OPTIONS_NO_UPDATE_FUNCTIONALITY = 3,
    SHARING_UPDATE_OPTIONS_ERROR_PARAMETERS = 4
} SharingPluginInterfaceUpdateOptionsResult;

SHARING_UPDATE_OPTIONS_SUCCESS Updating succesfully done.
SHARING_UPDATE_OPTIONS_ERROR_UNKNOWN General error.
SHARING_UPDATE_OPTIONS_CANCELLED Updating cancelled.
SHARING_UPDATE_OPTIONS_NO_UPDATE_FUNCTIONALITY Does not support update.
SHARING_UPDATE_OPTIONS_ERROR_PARAMETERS Parameters invalid.

SharingPluginInterfaceInit ()

guint               (*SharingPluginInterfaceInit)       (gboolean *dead_mans_switch);

Sharing Service Plugin Interface function for plugin init. This function must be implemented in Sharing Plugins. Function is called straight after plugin is loaded.

dead_mans_switch : While in function this switch should be turned to FALSE at least every 30 seconds.
Returns : Plugin should return 0 if initialization was successful else 1.

SharingPluginInterfaceUninit ()

guint               (*SharingPluginInterfaceUninit)     (gboolean *dead_mans_switch);

Sharing Service Plugin Interface function for SharingEntry sending. This function must be implemented in Sharing Plugins. Function is called before plugin is unloaded.

dead_mans_switch : While in function this switch should be turned to FALSE at least every 30 seconds.
Returns : Plugin should return 0 if uninitialization was successful else 1.

SharingPluginInterfaceSend ()

SharingPluginInterfaceSendResult (*SharingPluginInterfaceSend)
                                                        (SharingTransfer *transfer,
                                                         ConIcConnection *con,
                                                         gboolean *dead_mans_switch);

Sharing Service Plugin Interface function for SharingTransfer sending. This function must be implemented in Sharing Plugins.

SharingTransfer : Transfer to be send.
con : ConIc connection.
dead_mans_switch : While in function this switch should be turned to FALSE as many times as possible. Do NOT use any GTK idle / timeout function or any other separate to do this!
Returns : Plugin should return most fitting SharingPluginInterfaceSendResult value.

SharingPluginInterfaceAccountSetup ()

SharingPluginInterfaceAccountSetupResult (*SharingPluginInterfaceAccountSetup)
                                                        (GtkWindow *parent,
                                                         SharingService *service,
                                                         SharingAccount **worked_on,
                                                         osso_context_t *osso);

Sharing Service Plugin Interface function for SharingAccount setup.

parent : Parent window.
service : Service information.
worked_on : If account is already created in account manager flow it is given as parameter here. Otherwise NULL value given.
osso : osso_context_t to be used for the Dialog.
Returns : Plugin should return most fitting SharingPluginInterfaceAccountSetupResult value.

SharingPluginInterfaceAccountValidate ()

SharingPluginInterfaceAccountValidateResult (*SharingPluginInterfaceAccountValidate)
                                                        (SharingAccount *account,
                                                         ConIcConnection *con,
                                                         gboolean *cont,
                                                         gboolean *dead_mans_switch);

Sharing Service Plugin Interface function for validating SharingAccount. This function must be implemented in Sharing Plugins.

account : Account to be validated.
con : ConIc connection.
cont : TRUE in common. FALSE if validation dialog is cancelled, end your validation flow in this case.
dead_mans_switch : While in function this switch should be turned to FALSE at least every 30 seconds.
Returns : Plugin should return most fitting SharingPluginInterfaceAccountValidateResult value.

SharingPluginInterfaceEditAccount ()

SharingPluginInterfaceEditAccountResult (*SharingPluginInterfaceEditAccount)
                                                        (GtkWindow *parent,
                                                         SharingAccount *account,
                                                         ConIcConnection *con,
                                                         gboolean *dead_mans_switch);

Sharing Service Plugin Interface function to edit SharingAccount. This function must be implemented in Sharing Plugins.

parent : Parent window.
account : Account to be edited.
con : ConIc connection.
dead_mans_switch : While in function this switch should be turned to FALSE at least every 30 seconds.
Returns : Plugin should return most fitting SharingPluginInterfaceEditAccountResult value.

SharingPluginInterfaceUpdateOptions ()

gboolean            (*SharingPluginInterfaceUpdateOptions)
                                                        (SharingAccount *account,
                                                         ConIcConnection *con,
                                                         gboolean *cont,
                                                         gboolean *dead_mans_switch,
                                                         UpdateOptionsCallback cb_func,
                                                         gpointer cb_data);

Updates options (albums) set to account.

account : SharingAccount that will have the updated options.
con : ConIcConnection* con.
dead_mans_switch : While in function this switch should be turned to FALSE at least every 30 seconds.
cb_func : Callback function called when update flow ends.
cb_data : Callback function cb_data.
Returns : TRUE if start was OK, FALSE otherwise. Callback is be called in TRUE case only!

UpdateOptionsCallback ()

void                (*UpdateOptionsCallback)            (SharingPluginInterfaceUpdateOptionsResult result,
                                                         gpointer cb_data);

Update options flow done callback at SharingPluginInterfaceUpdateOptions as parameter.

result : Result of plug-in's flow.
cb_data : Callback function data got before.