libAccountSetup 1.0
provider-plugin-proxy-priv.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 */
22
23#ifndef ACCOUNTSETUP_PROVIDER_PLUGIN_PROXY_PRIV_H
24#define ACCOUNTSETUP_PROVIDER_PLUGIN_PROXY_PRIV_H
25
26//libAccountSetup
27#include "provider-plugin-proxy.h"
28
29//Qt
30#include <QDebug>
31#include <QDir>
32#include <QFileInfo>
33#include <QLocalServer>
34#include <QPointer>
35#include <QProcess>
36#include <QWidget>
37
38using namespace Accounts;
39using namespace AccountSetup;
40
41namespace AccountSetup {
42
43class ProviderPluginProxyPrivate: public QObject
44{
45 Q_OBJECT
46 Q_DECLARE_PUBLIC(ProviderPluginProxy)
47
48public:
49 ProviderPluginProxyPrivate(ProviderPluginProxy *parent):
50 q_ptr(parent),
51 pluginName(),
52 process(0),
53 socketName(QString()),
54 createdAccountId(0),
55 error(ProviderPluginProxy::NoError),
56 setupType(Unset),
57 providerName(),
58 exitData()
59 {
60 pluginDirs << QString::fromLatin1("/usr/lib/AccountSetup");
61 }
62 ~ProviderPluginProxyPrivate();
63
64 void startProcess(Provider provider, AccountId accountId,
65 const QString &serviceType);
66 bool findPlugin(Provider provider, QString &pluginPath,
67 QString &pluginFileName);
68
69private Q_SLOTS:
70 void onReadStandardError();
71 void onError(QProcess::ProcessError);
72 void onFinished(int exitCode, QProcess::ExitStatus exitStatus);
73 void onNewConnection();
74 void setCommunicationChannel();
75
76private:
77 mutable ProviderPluginProxy *q_ptr;
78 QString pluginName;
79 QProcess *process;
80 QString socketName;
81 AccountId createdAccountId;
82 QStringList pluginDirs;
84 QPointer<QWidget> parentWidget;
85 QStringList additionalParameters;
86 QByteArray pluginOutput;
87 SetupType setupType;
88 QString providerName;
89 QVariant exitData;
90};
91
92}; // namespace
93
94#endif // ACCOUNTSETUP_PROVIDER_PLUGIN_PROXY_PRIV_H
95
Client class for accounts UI plugins.
Error
Error codes for plugin execution.
SetupType
Operation type.
Definition types.h:38