~mardy/ubuntu-system-settings-online-accounts/hide-unused-plugins

« back to all changes in this revision

Viewing changes to tests/online-accounts-ui/mock/application-manager-mock.h

  • Committer: CI Train Bot
  • Author(s): Alberto Mardegan
  • Date: 2015-08-06 13:07:06 UTC
  • mfrom: (271.2.12 request-by-service)
  • Revision ID: ci-train-bot@canonical.com-20150806130706-hlltppd23w0k59su
Create version 0.2 of the Ubuntu.OnlineAccounts.Client module

Add a new "serviceId" property to the Ubuntu.OnlineAccounts.Client Setup class. Fix shadow builds.
Approved by: Alexandre Abreu

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2014 Canonical Ltd.
 
3
 *
 
4
 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
 
5
 *
 
6
 * This file is part of online-accounts-ui
 
7
 *
 
8
 * This program is free software: you can redistribute it and/or modify it
 
9
 * under the terms of the GNU General Public License version 3, as published
 
10
 * by the Free Software Foundation.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful, but
 
13
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
14
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
15
 * PURPOSE.  See the GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License along
 
18
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
 
 
21
#ifndef MOCK_APPLICATION_MANAGER_H
 
22
#define MOCK_APPLICATION_MANAGER_H
 
23
 
 
24
#include <OnlineAccountsPlugin/application-manager.h>
 
25
 
 
26
#include <QHash>
 
27
#include <QObject>
 
28
 
 
29
namespace OnlineAccountsUi {
 
30
 
 
31
class ApplicationManagerPrivate: public QObject
 
32
{
 
33
    Q_OBJECT
 
34
    Q_DECLARE_PUBLIC(ApplicationManager)
 
35
 
 
36
public:
 
37
    ApplicationManagerPrivate(ApplicationManager *q);
 
38
    ~ApplicationManagerPrivate();
 
39
    static ApplicationManagerPrivate *mocked(ApplicationManager *r) { return r->d_ptr; }
 
40
 
 
41
    void setApplicationInfo(const QString &applicationId,
 
42
                            const QVariantMap &info) {
 
43
        m_applicationInfo[applicationId] = info;
 
44
    }
 
45
 
 
46
    void setProviderInfo(const QString &providerId, const QVariantMap &info) {
 
47
        m_providerInfo[providerId] = info;
 
48
    }
 
49
 
 
50
Q_SIGNALS:
 
51
    void applicationInfoCalled(QString applicationId, QString profile);
 
52
 
 
53
public:
 
54
    QHash<QString,QVariantMap> m_applicationInfo;
 
55
    QHash<QString,QVariantMap> m_providerInfo;
 
56
    mutable ApplicationManager *q_ptr;
 
57
};
 
58
 
 
59
} // namespace
 
60
 
 
61
#endif // MOCK_APPLICATION_MANAGER_H