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
32 #include <QtCore/QCoreApplication>
33 #include <QtCore/QDebug>
35 #include <QtDBus/QDBusConnection>
36 #include <QtDBus/QDBusMetaType>
37 #include <QtDBus/QDBusInterface>
41 #include "connectionmanager.h"
42 #include "basetypes.h"
43 #include "connectionmanagertypes.h"
44 #include "connectiontypes.h"
45 #include "connectioninterfacerequeststypes.h"
46 #include "connectioninterfacecapabilitiestypes.h"
53 void MyOutputHandler(QtMsgType type, const char *msg) {
56 logfile << QTime::currentTime().toString().toAscii().data() << " Debug: " << msg << "\n";
59 logfile << QTime::currentTime().toString().toAscii().data() << " Critical: " << msg << "\n";
62 logfile << QTime::currentTime().toString().toAscii().data() << " Warning: " << msg << "\n";
65 logfile << QTime::currentTime().toString().toAscii().data() << " Fatal: " << msg << "\n";
70 int main(int argc, char ** argv)
73 // logfile.open("/var/log/logfile.txt", ios::app);
74 // #ifndef QT_NO_DEBUG_OUTPUT
75 // qInstallMsgHandler(MyOutputHandler);
79 QCoreApplication app(argc, argv);
82 qDBusRegisterMetaType<org::freedesktop::Telepathy::ParameterDefinition>();
83 qDBusRegisterMetaType<org::freedesktop::Telepathy::ParameterDefinitionList>();
84 qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelInfo>();
85 qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelInfoList>();
86 qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetails>();
87 qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetailsList>();
88 qDBusRegisterMetaType<org::freedesktop::Telepathy::ContactCapabilities>();
89 qDBusRegisterMetaType<org::freedesktop::Telepathy::ContactCapabilitiesList>();
90 qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityPair>();
91 qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityPairList>();
92 qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityChange>();
93 qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityChangeList>();
94 qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClass>();
95 qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClassList>();
97 QDBusConnection connection = QDBusConnection::sessionBus();
99 if (!connection.interface()->isServiceRegistered(cm_service_name))
102 // register CM on D-BUS:
103 if (connection.registerService(cm_service_name)){
104 qDebug(qPrintable(QObject::tr("Service %1 registered with session bus.").
105 arg(cm_service_name)));
108 qDebug(qPrintable(QObject::tr("Unable to register service %1 with session bus.").
109 arg(cm_service_name)));
114 ConnectionManager connection_mgr(&app);
115 if (!connection.registerObject(cm_object_path,&connection_mgr)){
116 qDebug(qPrintable(QObject::tr("Unable to register VICaR connection manager at path %1 with session bus.").
117 arg(cm_object_path)));
120 qDebug(qPrintable(QObject::tr("Enternig main loop.")));