Client class for accounts UI plugins. More...
#include <AccountSetup/ProviderPluginProxy>
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.
bool ProviderPluginProxy::accountCreated | ( | ) | const |
Checks whether an account was created by the plugin executed last.
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.
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.
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.
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.
Definition at line 303 of file provider-plugin-proxy.cpp.
QVariant ProviderPluginProxy::exitData | ( | ) |
Definition at line 371 of file provider-plugin-proxy.cpp.
void AccountSetup::ProviderPluginProxy::finished | ( | ) | [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 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.
Definition at line 356 of file provider-plugin-proxy.cpp.
QString ProviderPluginProxy::pluginName | ( | ) |
Definition at line 327 of file provider-plugin-proxy.cpp.
References isPluginRunning().
QString ProviderPluginProxy::providerName | ( | ) |
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 | 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.
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.
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.
Definition at line 321 of file provider-plugin-proxy.cpp.