libAccountSetup 1.0
|
Client class for accounts UI plugins. More...
#include <AccountSetup/ProviderPluginProxy>
Inherits QObject.
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 ¶meters) |
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. | |
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.
Error codes for plugin execution.
Definition at line 69 of file provider-plugin-proxy.h.
ProviderPluginProxy::ProviderPluginProxy | ( | QObject * | parent = 0 | ) |
Constructor.
Definition at line 236 of file provider-plugin-proxy.cpp.
|
virtual |
Definition at line 242 of file provider-plugin-proxy.cpp.
bool ProviderPluginProxy::accountCreated | ( | ) | const |
Checks whether an account was created by the plugin executed last.
Definition at line 298 of file provider-plugin-proxy.cpp.
|
protected |
Gets the list of additional parameters passed to the plugin process.
Definition at line 351 of file provider-plugin-proxy.cpp.
void ProviderPluginProxy::createAccount | ( | Accounts::Provider | provider, |
const QString & | serviceType ) |
Runs the account plugin to create an account.
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 248 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.
Definition at line 310 of file provider-plugin-proxy.cpp.
void ProviderPluginProxy::editAccount | ( | Accounts::Account * | account, |
const QString & | serviceType ) |
Runs the account plugin to edit an account.
account | The Accounts::Account to be edited. |
serviceType | The main service type the user is interested in, or empty string. |
Definition at line 263 of file provider-plugin-proxy.cpp.
References finished().
ProviderPluginProxy::Error ProviderPluginProxy::error | ( | ) | const |
Gets the error code of the last plugin execution.
Definition at line 304 of file provider-plugin-proxy.cpp.
QVariant ProviderPluginProxy::exitData | ( | ) |
Definition at line 372 of file provider-plugin-proxy.cpp.
|
signal |
Emitted when the plugin execution has been completed.
Referenced by createAccount(), and editAccount().
bool ProviderPluginProxy::isPluginRunning | ( | ) |
Checks whether a plugin is running.
Definition at line 316 of file provider-plugin-proxy.cpp.
Referenced by pluginName(), and providerName().
|
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.
Definition at line 357 of file provider-plugin-proxy.cpp.
QStringList ProviderPluginProxy::pluginDirectories | ( | ) | const |
Get the list of directories which will be searched for provider plugins.
Definition at line 292 of file provider-plugin-proxy.cpp.
QString ProviderPluginProxy::pluginName | ( | ) |
Definition at line 328 of file provider-plugin-proxy.cpp.
References isPluginRunning().
QString ProviderPluginProxy::providerName | ( | ) |
Definition at line 337 of file provider-plugin-proxy.cpp.
References isPluginRunning().
|
protected |
Sets additional parameters to be passed to the plugin process on the next invocation of createAccount() or editAccount().
parameters | The additional parameters to be passed to the plugin. In the current implementation these parameters are passed as process arguments. |
Definition at line 345 of file provider-plugin-proxy.cpp.
void ProviderPluginProxy::setParentWidget | ( | QWidget * | parent | ) |
Attempt to set the next executed account plugin modal to a given widget.
parent | The widget (window) the account plugin should be modal to. |
Definition at line 280 of file provider-plugin-proxy.cpp.
void ProviderPluginProxy::setPluginDirectories | ( | const QStringList & | pluginDirs | ) |
Set the list of directories which will be searched for provider plugins.
pluginDirs | List of directory names. |
Definition at line 286 of file provider-plugin-proxy.cpp.
SetupType ProviderPluginProxy::setupType | ( | ) | const |
Returns the operation being performed by the plugin.
Definition at line 322 of file provider-plugin-proxy.cpp.