3 @author: Sudheer K. <scifi1947 at gmail.com>
4 @license: GNU General Public License
6 Based on Telepathy-SNOM with copyright notice below.
10 * Telepathy SNOM VoIP phone connection manager
11 * Copyright (C) 2006 by basyskom GmbH
12 * @author Tobias Hunger <info@basyskom.de>
14 * This library is free software; you can redisQObject::tribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License version 2.1 as published by the Free Software Foundation.
18 * This library is disQObject::tributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the
25 * Free Software Foundation, Inc.,
26 * 51 Franklin SQObject::treet, Fifth Floor, Boston, MA 02110-1301 USA
29 #ifndef _VICAR_CONNECTION_H_
30 #define _VICAR_CONNECTION_H_
32 #include "connectiontypes.h"
33 #include "connectioninterfacerequeststypes.h"
34 #include "connectioninterfacecapabilitiestypes.h"
36 #include <QtDBus/QDBusContext>
37 #include <QtDBus/QtDBus>
39 class ConnectionPrivate;
41 class Connection : public QObject, protected QDBusContext
46 explicit Connection(const QString & account,
47 QObject * parent = 0);
51 QString serviceName() const;
52 QDBusObjectPath objectPath() const;
54 bool registerObject();
55 void unregisterObject();
68 ReasonNetworkError = 2,
69 ReasonAuthenticationFailed = 3,
70 ReasonEncryptionError = 4,
72 ReasonCertNotProvided = 6,
73 ReasonCertUntrusted = 7,
74 ReasonCertExpired = 8,
75 ReasonCertNotActivated = 9,
76 ReasonCertHostnameMismatch = 10,
77 ReasonCertFingerprintMismatch = 11,
78 ReasonCertSelfSigned = 12,
79 ReasonCertOtherError = 13
92 //org.freedesktop.Telepathy.Connection
96 QStringList GetInterfaces();
97 QString GetProtocol();
100 uint GetSelfHandle();
101 QList<uint> RequestHandles(const uint handle_type, const QStringList &names);
102 void HoldHandles(const uint handle_type, const QList<uint> &handles);
103 QStringList InspectHandles(const uint handle_type, const QList<uint> &handles);
104 void ReleaseHandles(const uint handle_type, const QList<uint> &handles);
106 org::freedesktop::Telepathy::ChannelInfoList ListChannels();
107 QDBusObjectPath RequestChannel(const QString &type,
108 uint handle_type, uint handle,
109 bool suppress_handler);
111 //org.freedesktop.Telepathy.Connection.Interface.Requests
112 QDBusObjectPath CreateChannel(const QVariantMap &request,
113 QVariantMap &channel_properties);
115 bool EnsureChannel(const QVariantMap &request,
116 QDBusObjectPath &channel_object,
117 QVariantMap &channel_properties);
118 //org.freedesktop.Telepathy.Connection.Interface.Capabilities
119 org::freedesktop::Telepathy::CapabilityPairList AdvertiseCapabilities(org::freedesktop::Telepathy::CapabilityPairList Add,
120 const QStringList &Remove);
121 org::freedesktop::Telepathy::ContactCapabilitiesList GetCapabilities(const QList<uint> &Handles);
124 QDBusObjectPath processChannel(const QVariantMap &request);
127 void NewChannel(const QDBusObjectPath & object_path,
128 const QString & channel_type,
129 uint handle_type, uint handle,
130 bool suppress_handler);
131 void StatusChanged(uint status, uint reason);
133 //org.freedesktop.Telepathy.Connection.Interface.Requests
134 void ChannelClosed(const QDBusObjectPath &removed_channel_object);
135 void NewChannels(org::freedesktop::Telepathy::ChannelDetailsList new_channels);
137 //org.freedesktop.Telepathy.Connection.Interface.Capabilities
138 void CapabilitiesChanged(org::freedesktop::Telepathy::CapabilityChangeList changes);
141 Connection(const Connection &); // no impl.
142 ConnectionPrivate * const d;