Version 0.7-0
[vicar] / src / vicar-telepathy / cpp / connectiontypes.h
1 /*
2 @version: 0.6
3 @author: Sudheer K. <scifi1947 at gmail.com>
4 @license: GNU General Public License
5
6 Based on QtTelepathy with copyright notice below.
7 */
8
9 /*
10  * QtTelepathy, the Tapioca Qt4 Telepathy Client Library
11  * Copyright (C) 2006 by Tobias Hunger <tobias.hunger@basyskom.de>
12  * Copyright (C) 2006 by INdT
13  *  @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
14  *
15  * This library is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU Lesser General Public
17  * License as published by the Free Software Foundation; either
18  * version 2.1 of the License, or (at your option) any later version.
19  *
20  * This library is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23  * Lesser General Public License for more details.
24  *
25  * You should have received a copy of the GNU Lesser General Public
26  * License along with this library; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28  */
29
30 #ifndef QTTELEPATHY_CONNECTION_H
31 #define QTTELEPATHY_CONNECTION_H
32
33 #include <QtCore/QList>
34 #include <QtCore/QString>
35 #include <QtDBus/QDBusArgument>
36 #include "basetypes.h"
37
38 namespace org {
39 namespace freedesktop {
40 namespace Telepathy {
41
42 enum HandleType {
43     HANDLE_TYPE_NONE = 0,
44     HANDLE_TYPE_CONTACT,
45     HANDLE_TYPE_ROOM,
46     HANDLE_TYPE_LIST
47 };
48
49 enum ConnectionState {
50     CONNECTION_STATUS_CONNECTED,
51     CONNECTION_STATUS_CONNECTING,
52     CONNECTION_STATUS_DISCONNECTED
53 };
54
55 enum ConnectionStateReason {
56     CONNECTION_STATUS_REASON_NONE_SPECIFIED,
57     CONNECTION_STATUS_REASON_REQUESTED,
58     CONNECTION_STATUS_REASON_NETWORK_ERROR,
59     CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED,
60     CONNECTION_STATUS_REASON_ENCRYPTION_ERROR,
61     CONNECTION_STATUS_REASON_NAME_IN_USE,
62     CONNECTION_STATUS_REASON_CERT_NOT_PROVIDED,
63     CONNECTION_STATUS_REASON_CERT_UNTRUSTED,
64     CONNECTION_STATUS_REASON_CERT_EXPIRED,
65     CONNECTION_STATUS_REASON_CERT_NOT_ACTIVATED,
66     CONNECTION_STATUS_REASON_CERT_HOSTNAME_MISMATCH,
67     CONNECTION_STATUS_REASON_CERT_FINGERPRINT_MISMATCH,
68     CONNECTION_STATUS_REASON_CERT_SELF_SIGNED,
69     CONNECTION_STATUS_REASON_CERT_OTHER_ERROR
70 };
71
72 class ChannelInfo
73 {
74 public:
75     QDBusObjectPath objectPath;
76     QString interfaceName;
77     uint handleType;
78     uint handle;
79 };
80 typedef QList<ChannelInfo> ChannelInfoList;
81
82 } // namespace Telepathy
83 } // namespace freedesktop
84 } // namespace org
85
86 Q_DECLARE_METATYPE(org::freedesktop::Telepathy::ChannelInfo)
87 Q_DECLARE_METATYPE(org::freedesktop::Telepathy::ChannelInfoList)
88
89 const QDBusArgument &operator>>(const QDBusArgument &argument, org::freedesktop::Telepathy::ChannelInfo &info);
90 QDBusArgument &operator<<(QDBusArgument &argument, const org::freedesktop::Telepathy::ChannelInfo &info);
91
92 #endif
93