Akonadi

akonadicontrol/accountsintegration.h
1 /***************************************************************************
2  * SPDX-FileCopyrightText: 2019 Daniel Vr├ítil <[email protected]> *
3  * *
4  * SPDX-License-Identifier: LGPL-2.0-or-later *
5  ***************************************************************************/
6 
7 #pragma once
8 
9 #include <QMap>
10 #include <QObject>
11 
12 #include <Accounts/Manager>
13 
14 #include <optional>
15 
16 namespace Accounts
17 {
18 class Account;
19 class Service;
20 }
21 
22 class AgentManager;
23 
24 class AccountsIntegration : public QObject
25 {
26  Q_OBJECT
27 public:
28  explicit AccountsIntegration(AgentManager &agentManager);
29 
30 private Q_SLOTS:
31  void onAccountAdded(Accounts::AccountId);
32  void onAccountRemoved(Accounts::AccountId);
33  void onAccountServiceEnabled(const QString &service, bool enabled);
34 
35 private:
36  void configureAgentInstance(const QString &identifier, Accounts::AccountId accountId, int attempt = 0);
37  std::optional<QString> agentForAccount(const QString &agentType, Accounts::AccountId accountId) const;
38  void createAgent(const QString &agentType, Accounts::AccountId accountId);
39  void removeAgentInstance(const QString &identifier);
40 
41  AgentManager &mAgentManager;
42  Accounts::Manager mAccountsManager;
43 
44  QMap<QString, QString /* agent type */> mSupportedServices;
45 };
46 
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
The agent manager has knowledge about all available agents (it scans for .desktop files in the agent ...
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jun 30 2022 03:51:45 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.