Akonadi

agentbase/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 #ifndef AKONADI_ACCOUNTSINTEGRATION_H_
8 #define AKONADI_ACCOUNTSINTEGRATION_H_
9 
10 #include <QObject>
11 #include "akonadiagentbase_export.h"
12 
13 #include <functional>
14 #include <optional>
15 
16 class Akonadi__AccountsAdaptor;
17 namespace Akonadi
18 {
19 
20 class AKONADIAGENTBASE_EXPORT AccountsIntegration : public QObject
21 {
22  Q_OBJECT
23 
24  friend class ::Akonadi__AccountsAdaptor;
25 public:
26  explicit AccountsIntegration();
27  ~AccountsIntegration() override = default;
28 
32  bool isEnabled() const;
33 
34  using AuthDataCallback = std::function<void(const QVariantMap &)>;
35  using ErrorCallback = std::function<void(const QString &)>;
36  void requestAuthData(const QString &serviceType, AuthDataCallback &&cb, ErrorCallback &&err);
37 
38  std::optional<QString> accountName() const;
39 public Q_SLOTS:
40  std::optional<quint32> accountId() const;
41  void setAccountId(quint32 accountId);
42 
43 Q_SIGNALS:
44  void accountChanged();
45 
46 private:
47  // For DBus adaptor which doesn't understand std::optional
48  quint32 getAccountId() const;
49 
50  std::optional<quint32> mAccountId;
51 };
52 
53 
54 
55 } // namespace Akonadi
56 
57 #endif
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 14 2020 23:16:12 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.