summaryrefslogtreecommitdiffstats
path: root/framework/domain/accountfactory.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-10 11:57:08 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-10 11:57:08 +0100
commit9bfadc71a4fb694ae3946711d04acdfe009264c0 (patch)
tree883c944c166e8b31862ba2a898ab6aed1944b0aa /framework/domain/accountfactory.h
parentd0617d0ad6926c250e29d1a40db93733fa911e5d (diff)
downloadkube-9bfadc71a4fb694ae3946711d04acdfe009264c0.tar.gz
kube-9bfadc71a4fb694ae3946711d04acdfe009264c0.zip
A factory to load account plugins.
Diffstat (limited to 'framework/domain/accountfactory.h')
-rw-r--r--framework/domain/accountfactory.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/framework/domain/accountfactory.h b/framework/domain/accountfactory.h
new file mode 100644
index 00000000..0c6afe50
--- /dev/null
+++ b/framework/domain/accountfactory.h
@@ -0,0 +1,48 @@
1/*
2 Copyright (c) 2016 Christian Mollekopf <mollekopf@kolabsystems.com>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#pragma once
21
22#include <QObject>
23#include <QVariant>
24
25/**
26 * A factory to instantiate accountp plugins.
27 */
28class AccountFactory : public QObject
29{
30 Q_OBJECT
31 Q_PROPERTY(QString accountId MEMBER mAccountId);
32 Q_PROPERTY(QString name READ name);
33 Q_PROPERTY(QString icon READ icon);
34 Q_PROPERTY(QVariant ui READ ui);
35 Q_PROPERTY(QString uiPath READ uiPath);
36public:
37 explicit AccountFactory(QObject *parent = Q_NULLPTR);
38
39 QString name() const;
40 QString icon() const;
41 QVariant ui() const;
42 QString uiPath() const;
43
44 Q_INVOKABLE QVariant createComponent(const QByteArray &accountType) const;
45private:
46 QByteArray getAccountType() const;
47 QString mAccountId;
48};