Changeset View
Changeset View
Standalone View
Standalone View
src/accountwidget.h
- This file was copied from src/lib/uipluginsmanager.h.
1 | /************************************************************************************* | 1 | /************************************************************************************* | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2015 by Martin Klapetek <mklapetek@kde.org> * | 2 | * Copyright (C) 2012-2013 by Alejandro Fiestas Olivares <afiestas@kde.org> * | ||
3 | * * | 3 | * * | ||
4 | * This program is free software; you can redistribute it and/or * | 4 | * This program is free software; you can redistribute it and/or * | ||
5 | * modify it under the terms of the GNU General Public License * | 5 | * modify it under the terms of the GNU General Public License * | ||
6 | * as published by the Free Software Foundation; either version 2 * | 6 | * as published by the Free Software Foundation; either version 2 * | ||
7 | * of the License, or (at your option) any later version. * | 7 | * of the License, or (at your option) any later version. * | ||
8 | * * | 8 | * * | ||
9 | * This program is distributed in the hope that it will be useful, * | 9 | * This program is distributed in the hope that it will be useful, * | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
12 | * GNU General Public License for more details. * | 12 | * GNU General Public License for more details. * | ||
13 | * * | 13 | * * | ||
14 | * You should have received a copy of the GNU General Public License * | 14 | * You should have received a copy of the GNU General Public License * | ||
15 | * along with this program; if not, write to the Free Software * | 15 | * along with this program; if not, write to the Free Software * | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * | ||
17 | *************************************************************************************/ | 17 | *************************************************************************************/ | ||
18 | 18 | | |||
19 | #ifndef UIPLUGINSMANAGER_H | 19 | #ifndef ACCOUNTWIDGET_H | ||
20 | #define UIPLUGINSMANAGER_H | 20 | #define ACCOUNTWIDGET_H | ||
21 | 21 | | |||
22 | #include <QList> | 22 | #include "ui_services.h" | ||
23 | #include "create.h" | ||||
23 | 24 | | |||
24 | class KAccountsUiPlugin; | 25 | #include <QPointer> | ||
25 | 26 | | |||
26 | namespace KAccounts { | 27 | namespace Accounts { | ||
28 | class Account; | ||||
29 | } | ||||
30 | | ||||
31 | class QCheckBox; | ||||
32 | | ||||
33 | class AccountWidget : public QWidget, Ui::Services | ||||
34 | { | ||||
35 | Q_OBJECT | ||||
27 | 36 | | |||
28 | class UiPluginsManager { | | |||
29 | public: | 37 | public: | ||
30 | static QList<KAccountsUiPlugin*> uiPlugins(); | 38 | explicit AccountWidget(Accounts::Account *model, QWidget *parent); | ||
31 | static KAccountsUiPlugin* pluginForService(const QString &service); | 39 | virtual ~AccountWidget(); | ||
32 | static KAccountsUiPlugin* pluginForName(const QString &name); | | |||
33 | }; | | |||
34 | 40 | | |||
35 | } | 41 | void setAccount(Accounts::Account *account); | ||
42 | | ||||
43 | public Q_SLOTS: | ||||
44 | void serviceEnabledChanged(const QString &serviceName, bool enabled); | ||||
45 | void serviceChanged(bool enabled); | ||||
46 | | ||||
47 | private: | ||||
48 | QHash<QString, QCheckBox*> m_checkboxes; | ||||
49 | QPointer<Accounts::Account> m_account; | ||||
50 | Accounts::Manager *m_manager; | ||||
51 | QList<QMetaObject::Connection> m_connections; | ||||
52 | }; | ||||
36 | 53 | | |||
37 | #endif //UIPLUGINSMANAGER_H | 54 | #endif //ACCOUNTWIDGET_H |