account-manager.h Source File

| Home · All Classes · All Namespaces · Modules · Functions · Files

account-manager.h
1
23 #ifndef _TelepathyQt_account_manager_h_HEADER_GUARD_
24 #define _TelepathyQt_account_manager_h_HEADER_GUARD_
25
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29
30 #include <TelepathyQt/_gen/cli-account-manager.h>
31
32 #include <TelepathyQt/Account>
33 #include <TelepathyQt/AccountFactory>
34 #include <TelepathyQt/ChannelFactory>
35 #include <TelepathyQt/ConnectionFactory>
36 #include <TelepathyQt/ContactFactory>
37 #include <TelepathyQt/StatelessDBusProxy>
38 #include <TelepathyQt/Filter>
39 #include <TelepathyQt/OptionalInterfaceFactory>
40 #include <TelepathyQt/SharedPtr>
41 #include <TelepathyQt/Types>
42
43 #include <QDBusObjectPath>
44 #include <QSet>
45 #include <QString>
46 #include <QVariantMap>
47
48 namespace Tp
49 {
50
51 class PendingAccount;
52
53 class TP_QT_EXPORT AccountManager : public StatelessDBusProxy,
54 public OptionalInterfaceFactory<AccountManager>
55 {
56 Q_OBJECT
57 Q_DISABLE_COPY(AccountManager)
58
59 public:
60 static const Feature FeatureCore;
61
62 static AccountManagerPtr create(const QDBusConnection &bus);
63 static AccountManagerPtr create(
64 const AccountFactoryConstPtr &accountFactory =
65 AccountFactory::create(QDBusConnection::sessionBus(), Account::FeatureCore),
66 const ConnectionFactoryConstPtr &connectionFactory =
67 ConnectionFactory::create(QDBusConnection::sessionBus()),
68 const ChannelFactoryConstPtr &channelFactory =
69 ChannelFactory::create(QDBusConnection::sessionBus()),
70 const ContactFactoryConstPtr &contactFactory =
71 ContactFactory::create());
72 static AccountManagerPtr create(const QDBusConnection &bus,
73 const AccountFactoryConstPtr &accountFactory,
74 const ConnectionFactoryConstPtr &connectionFactory,
75 const ChannelFactoryConstPtr &channelFactory,
76 const ContactFactoryConstPtr &contactFactory =
77 ContactFactory::create());
78
79 virtual ~AccountManager();
80
81 AccountFactoryConstPtr accountFactory() const;
82 ConnectionFactoryConstPtr connectionFactory() const;
83 ChannelFactoryConstPtr channelFactory() const;
84 ContactFactoryConstPtr contactFactory() const;
85
86 QList<AccountPtr> allAccounts() const;
87
88 AccountSetPtr validAccounts() const;
89 AccountSetPtr invalidAccounts() const;
90
91 AccountSetPtr enabledAccounts() const;
92 AccountSetPtr disabledAccounts() const;
93
94 AccountSetPtr onlineAccounts() const;
95 AccountSetPtr offlineAccounts() const;
96
97 AccountSetPtr textChatAccounts() const;
98 AccountSetPtr textChatroomAccounts() const;
99
100 AccountSetPtr audioCallAccounts() const;
101 AccountSetPtr videoCallAccounts() const;
102
103 TP_QT_DEPRECATED AccountSetPtr streamedMediaCallAccounts() const;
104 TP_QT_DEPRECATED AccountSetPtr streamedMediaAudioCallAccounts() const;
105 TP_QT_DEPRECATED AccountSetPtr streamedMediaVideoCallAccounts() const;
106 TP_QT_DEPRECATED AccountSetPtr streamedMediaVideoCallWithAudioAccounts() const;
107
108 AccountSetPtr fileTransferAccounts() const;
109
110 AccountSetPtr accountsByProtocol(const QString &protocolName) const;
111
112 AccountSetPtr filterAccounts(const AccountFilterConstPtr &filter) const;
113 AccountSetPtr filterAccounts(const QVariantMap &filter) const;
114
115 AccountPtr accountForObjectPath(const QString &path) const;
116 TP_QT_DEPRECATED AccountPtr accountForPath(const QString &path) const;
117 QList<AccountPtr> accountsForObjectPaths(const QStringList &paths) const;
118 TP_QT_DEPRECATED QList<AccountPtr> accountsForPaths(const QStringList &paths) const;
119
120 QStringList supportedAccountProperties() const;
121 PendingAccount *createAccount(const QString &connectionManager,
122 const QString &protocol, const QString &displayName,
123 const QVariantMap &parameters,
124 const QVariantMap &properties = QVariantMap());
125
126 Q_SIGNALS:
127 void newAccount(const Tp::AccountPtr &account);
128
129 protected:
130 AccountManager(const QDBusConnection &bus,
131 const AccountFactoryConstPtr &accountFactory,
132 const ConnectionFactoryConstPtr &connectionFactory,
133 const ChannelFactoryConstPtr &channelFactory,
134 const ContactFactoryConstPtr &contactFactory,
135 const Feature &coreFeature);
136
137 Client::AccountManagerInterface *baseInterface() const;
138
139 private Q_SLOTS:
140 TP_QT_NO_EXPORT void introspectMain();
141 TP_QT_NO_EXPORT void gotMainProperties(QDBusPendingCallWatcher *watcher);
142 TP_QT_NO_EXPORT void onAccountReady(Tp::PendingOperation *op);
143 TP_QT_NO_EXPORT void onAccountValidityChanged(const QDBusObjectPath &objectPath,
144 bool valid);
145 TP_QT_NO_EXPORT void onAccountRemoved(const QDBusObjectPath &objectPath);
146
147 private:
148 friend class PendingAccount;
149
150 struct Private;
151 friend struct Private;
152 Private *mPriv;
153 };
154
155 } // Tp
156
157 #endif
Tp::ConnectionFactory::create
static ConnectionFactoryPtr create(const QDBusConnection &bus, const Features &features=Features())
Definition: connection-factory.cpp:57
Tp::StatelessDBusProxy
The StatelessDBusProxy class is a base class representing a remote object whose API is basically stat...
Definition: dbus-proxy.h:80
Tp::ContactFactory::create
static ContactFactoryPtr create(const Features &features=Features())
Definition: contact-factory.cpp:48
Tp::AccountManager::FeatureCore
static const Feature FeatureCore
Definition: account-manager.h:60
Tp::Feature
The Feature class represents a feature that can be enabled on demand.
Definition: feature.h:41
Tp::PendingOperation
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45
Tp::AccountFactory::create
static AccountFactoryPtr create(const QDBusConnection &bus, const Features &features=Features())
Definition: account-factory.cpp:58
Tp::Client::AccountManagerInterface
Definition: cli-account-manager.h:44
Tp::ChannelFactory::create
static ChannelFactoryPtr create(const QDBusConnection &bus)
Definition: channel-factory.cpp:86
Tp::Account::FeatureCore
static const Feature FeatureCore
Definition: account.h:103
Tp::PendingAccount
The PendingAccount class represents the parameters of and the reply to an asynchronous account reques...
Definition: pending-account.h:43
Tp::AccountManager
The AccountManager class represents a Telepathy account manager.
Definition: account-manager.h:53
Tp::OptionalInterfaceFactory
The OptionalInterfaceFactory class is a helper class for high-level D-Bus proxy classes willing to of...
Definition: optional-interface-factory.h:65