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 #include <QtCore/QCoreApplication>
30 #include <QtCore/QDebug>
32 #include <QtDBus/QDBusConnection>
33 #include <QtDBus/QDBusMetaType>
34 #include <QtDBus/QDBusInterface>
39 #include "connectionmanager.h"
40 #include "basetypes.h"
41 #include "connectionmanagertypes.h"
42 #include "connectiontypes.h"
43 #include "connectioninterfacerequeststypes.h"
44 #include "connectioninterfacecapabilitiestypes.h"
49 int main(int argc, char ** argv)
52 QCoreApplication app(argc, argv);
55 qDBusRegisterMetaType<org::freedesktop::Telepathy::ParameterDefinition>();
56 qDBusRegisterMetaType<org::freedesktop::Telepathy::ParameterDefinitionList>();
57 qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelInfo>();
58 qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelInfoList>();
59 qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetails>();
60 qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetailsList>();
61 qDBusRegisterMetaType<org::freedesktop::Telepathy::ContactCapabilities>();
62 qDBusRegisterMetaType<org::freedesktop::Telepathy::ContactCapabilitiesList>();
63 qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityPair>();
64 qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityPairList>();
65 qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityChange>();
66 qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityChangeList>();
67 qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClass>();
68 qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClassList>();
70 QDBusConnection connection = QDBusConnection::sessionBus();
72 if (!connection.interface()->isServiceRegistered(cm_service_name))
75 // register CM on D-BUS:
76 bool success = connection.registerService(cm_service_name);
78 qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Service %1 registered with session bus.").
79 arg(cm_service_name)));
83 QDBusError error = connection.interface()->lastError();
85 qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Unable to register service %1 with session bus due to error %2.").
86 arg(cm_service_name,error.message())));
91 ConnectionManager connection_mgr(&app);
92 if (!connection.registerObject(cm_object_path,&connection_mgr)){
93 qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Unable to register VICaR connection manager at path %1 with session bus.").
94 arg(cm_object_path)));
97 qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Enternig main loop.")));