![]() |
![]() |
![]() |
LibSharing Manual | ![]() |
---|---|---|---|---|
SharingPluginInterfaceSharingPluginInterface — Sharing plugin interface defines the plugin gmodule interface. |
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);
SharingPluginInterface defines the interface that Sharing framework uses when calling the plugin.
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;
typedef enum { SHARING_ACCOUNT_SETUP_SUCCESS = 0, SHARING_ACCOUNT_SETUP_ERROR_UNKNOWN = 1, SHARING_ACCOUNT_SETUP_ERROR_CONNECTION = 2 } SharingPluginInterfaceAccountSetupResult;
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;
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;
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;
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. |
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. |
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. |
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. |
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. |
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. |
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! |
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. |