libAccountSetup 1.0
provider-plugin-proxy.h
1/*
2 * This file is part of accounts-ui
3 *
4 * Copyright (C) 2011 Nokia Corporation.
5 *
6 * Contact: Alberto Mardegan <alberto.mardegan@nokia.com>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * version 2.1 as published by the Free Software Foundation.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 */
27#ifndef ACCOUNTSETUP_PROVIDER_PLUGIN_PROXY_H
28#define ACCOUNTSETUP_PROVIDER_PLUGIN_PROXY_H
29
30// libAccountSetup
31#include <AccountSetup/common.h>
32#include <AccountSetup/types.h>
33
34// Accounts
35#include <Accounts/Account>
36#include <Accounts/Provider>
37
38// Qt
39#include <QObject>
40#include <QStringList>
41
42class QWidget;
43
44namespace AccountSetup {
45
46class ProviderPluginProxyPrivate;
47
60class ACCOUNTSETUP_EXPORT ProviderPluginProxy: public QObject
61{
62 Q_OBJECT
63
64public:
69 enum Error {
70 NoError = 0,
71 AccountNotFound,
72 PluginNotFound,
73 PluginCrashed,
74 };
75
79 ProviderPluginProxy(QObject *parent = 0);
80 virtual ~ProviderPluginProxy();
81
89 void createAccount(Accounts::Provider provider,
90 const QString &serviceType);
91
99 void editAccount(Accounts::Account *account, const QString &serviceType);
100
106 void setParentWidget(QWidget *parent);
107
113 void setPluginDirectories(const QStringList &pluginDirs);
114
119 QStringList pluginDirectories() const;
120
128 bool accountCreated() const;
129
135 Error error() const;
136
143 Accounts::AccountId createdAccountId() const;
144
150 bool isPluginRunning();
151
158 SetupType setupType() const;
159
164 QString pluginName();
165
169 QString providerName();
170
174 QVariant exitData();
175
176Q_SIGNALS:
181 void finished();
182
183protected:
192 void setAdditionalParameters(const QStringList &parameters);
193
197 QStringList additionalParameters() const;
198
205 bool killRunningPlugin();
206
207private:
208 ProviderPluginProxyPrivate *d_ptr;
209 Q_DECLARE_PRIVATE(ProviderPluginProxy)
210};
211
212} // namespace
213
214#endif // ACCOUNTSETUP_PROVIDER_PLUGIN_PROXY_H
215
Client class for accounts UI plugins.
Error
Error codes for plugin execution.
void finished()
Emitted when the plugin execution has been completed.
SetupType
Operation type.
Definition types.h:38