Public Types | Signals | Public Member Functions | Protected Member Functions

AccountSetup::ProviderPluginProxy Class Reference

Client class for accounts UI plugins. More...

#include <AccountSetup/ProviderPluginProxy>

List of all members.

Public Types

enum  Error { NoError = 0, AccountNotFound, PluginNotFound, PluginCrashed }
 

Error codes for plugin execution.

More...

Signals

void finished ()
 Emitted when the plugin execution has been completed.

Public Member Functions

 ProviderPluginProxy (QObject *parent=0)
 Constructor.
void createAccount (Accounts::Provider *provider, const QString &serviceType)
 Runs the account plugin to create an account.
void editAccount (Accounts::Account *account, const QString &serviceType)
 Runs the account plugin to edit an account.
void setParentWidget (QWidget *parent)
 Attempt to set the next executed account plugin modal to a given widget.
void setPluginDirectories (const QStringList &pluginDirs)
 Set the list of directories which will be searched for provider plugins.
QStringList pluginDirectories () const
 Get the list of directories which will be searched for provider plugins.
bool accountCreated () const
 Checks whether an account was created by the plugin executed last.
Error error () const
 Gets the error code of the last plugin execution.
Accounts::AccountId createdAccountId () const
 Gets the ID of the newly created account.
bool isPluginRunning ()
 Checks whether a plugin is running.
SetupType setupType () const
 Returns the operation being performed by the plugin.
QString pluginName ()
QString providerName ()
QVariant exitData ()

Protected Member Functions

void setAdditionalParameters (const QStringList &parameters)
 Sets additional parameters to be passed to the plugin process on the next invocation of createAccount() or editAccount().
QStringList additionalParameters () const
 Gets the list of additional parameters passed to the plugin process.
bool killRunningPlugin ()
 Kills the plugin being executed.

Detailed Description

Client class for accounts UI plugins.

The ProviderPluginProxy class can be used to run the account plugins. Plugins can be started with the createAccount() and editAccount() methods, respectively to enter the account creation and editing modes. Plugin lifetime can be monitored with the created(), edited(), cancelled() signals, or inspected with the isPluginRunning() method.

Definition at line 60 of file provider-plugin-proxy.h.


Member Enumeration Documentation

Error codes for plugin execution.

See also:
error()

Definition at line 69 of file provider-plugin-proxy.h.


Member Function Documentation

bool ProviderPluginProxy::accountCreated (  )  const

Checks whether an account was created by the plugin executed last.

Note:
This method should be called only after the finished() signal has been emitted, and before the next execution of an account plugin.
Returns:
Whether an account has been successfully created.

Definition at line 297 of file provider-plugin-proxy.cpp.

void ProviderPluginProxy::createAccount ( Accounts::Provider *  provider,
const QString &  serviceType 
)

Runs the account plugin to create an account.

Parameters:
provider The Accounts::Provider for the account to be created.
serviceType The main service type the user is interested in, or empty string.

Definition at line 247 of file provider-plugin-proxy.cpp.

References finished().

Accounts::AccountId ProviderPluginProxy::createdAccountId (  )  const

Gets the ID of the newly created account.

Call accountCreated() first, to know whether an account was actually created.

Returns:
The account ID of the created account.

Definition at line 309 of file provider-plugin-proxy.cpp.

void ProviderPluginProxy::editAccount ( Accounts::Account *  account,
const QString &  serviceType 
)

Runs the account plugin to edit an account.

Parameters:
account The Accounts::Account to be edited.
serviceType The main service type the user is interested in, or empty string.

Definition at line 262 of file provider-plugin-proxy.cpp.

References finished().

ProviderPluginProxy::Error ProviderPluginProxy::error (  )  const

Gets the error code of the last plugin execution.

Note:
This method should be called only after the finished() signal has been emitted, and before the next execution of an account plugin.

Definition at line 303 of file provider-plugin-proxy.cpp.

QVariant ProviderPluginProxy::exitData (  ) 
Returns:
the extra data that the plugin returned when terminating.

Definition at line 371 of file provider-plugin-proxy.cpp.

void AccountSetup::ProviderPluginProxy::finished (  )  [signal]

Emitted when the plugin execution has been completed.

See also:
error(), accountCreated()

Referenced by createAccount(), and editAccount().

bool ProviderPluginProxy::isPluginRunning (  ) 

Checks whether a plugin is running.

Returns:
Returns true if there is plugin process running.

Definition at line 315 of file provider-plugin-proxy.cpp.

Referenced by pluginName(), and providerName().

bool ProviderPluginProxy::killRunningPlugin (  )  [protected]

Kills the plugin being executed.

This will probably result in data loss and other resource waste, so it's strongly recommended not to ever call this method.

Returns:
Returns true is the process was terminated, false otherwise.

Definition at line 356 of file provider-plugin-proxy.cpp.

QString ProviderPluginProxy::pluginName (  ) 
Returns:
the name of the currently running plugin, or empty string if no plugin is running.

Definition at line 327 of file provider-plugin-proxy.cpp.

References isPluginRunning().

QString ProviderPluginProxy::providerName (  ) 
Returns:
the name of the povider of the plugin

Definition at line 336 of file provider-plugin-proxy.cpp.

References isPluginRunning().

void ProviderPluginProxy::setAdditionalParameters ( const QStringList &  parameters  )  [protected]

Sets additional parameters to be passed to the plugin process on the next invocation of createAccount() or editAccount().

Parameters:
parameters The additional parameters to be passed to the plugin. In the current implementation these parameters are passed as process arguments.

Definition at line 344 of file provider-plugin-proxy.cpp.

void ProviderPluginProxy::setParentWidget ( QWidget *  parent  ) 

Attempt to set the next executed account plugin modal to a given widget.

Parameters:
parent The widget (window) the account plugin should be modal to.

Definition at line 279 of file provider-plugin-proxy.cpp.

void ProviderPluginProxy::setPluginDirectories ( const QStringList &  pluginDirs  ) 

Set the list of directories which will be searched for provider plugins.

Parameters:
pluginDirs List of directory names.

Definition at line 285 of file provider-plugin-proxy.cpp.

SetupType ProviderPluginProxy::setupType (  )  const

Returns the operation being performed by the plugin.

Returns:
CreateNew is the plugin was invoked to create a new account, EditExisting if it's edit an existing account.

Definition at line 321 of file provider-plugin-proxy.cpp.


The documentation for this class was generated from the following files: