author | hgs |
Fri, 15 Oct 2010 12:24:46 +0300 | |
changeset 81 | 640d30f4fb64 |
parent 72 | 6abfb1094884 |
permissions | -rw-r--r-- |
24
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
#include <hbapplication.h> |
53 | 19 |
#include <hbmainwindow.h> |
81 | 20 |
#include <xqserviceutil.h> |
24
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include <QTranslator> |
40
b46a585f6909
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
22 |
#include <QLocale> |
66 | 23 |
#include <QScopedPointer> |
50 | 24 |
#include "cntserviceproviderold.h" |
25 |
#include "cntserviceproviderold2.h" |
|
26 |
#include "cntserviceproviderfetch.h" |
|
27 |
#include "cntserviceproviderold2.h" |
|
28 |
#include "cntserviceproviderviewing.h" |
|
29 |
#include "cntserviceprovideredit.h" |
|
30 |
#include "cntservices.h" |
|
31 |
#include "cntserviceviewmanager.h" |
|
32 |
#include "cntviewnavigator.h" |
|
54 | 33 |
#include "cntkeygrabber.h" |
53 | 34 |
#include "cntdebug.h" |
50 | 35 |
#include <cntviewparams.h> |
24
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
|
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
int main(int argc, char **argv) |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
{ |
66 | 39 |
#if defined (TRACES) || defined (TRACE2FILE) |
53 | 40 |
qInstallMsgHandler(MSG_HANDLER); |
66 | 41 |
#endif |
81 | 42 |
qDebug() << "Enter"; |
43 |
bool embedded = XQServiceUtil::isEmbedded( argc, argv ); |
|
44 |
qDebug() << "Embedded: " << embedded; |
|
53 | 45 |
|
81 | 46 |
HbApplication a( argc, argv, embedded ? Hb::NoSplash : Hb::DefaultApplicationFlags ); |
47 |
qDebug() << "HbApplication ready"; |
|
48 |
||
24
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
QTranslator translator; |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
QString lang = QLocale::system().name(); |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
QString path = "z:/resource/qt/translations/"; |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
translator.load(path + "contacts_" + lang); |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
a.installTranslator(&translator); |
81 | 54 |
qDebug() << "Translator installed"; |
55 |
||
53 | 56 |
HbMainWindow mainWindow; |
81 | 57 |
qDebug() << "MainWindow ready"; |
58 |
||
54 | 59 |
CntKeyGrabber *keyGrabber = new CntKeyGrabber(&mainWindow, &mainWindow); |
81 | 60 |
qDebug() << "KeyGrabber ready"; |
61 |
||
50 | 62 |
CntViewNavigator* navigator = new CntViewNavigator( &mainWindow ); |
72 | 63 |
navigator->addException( serviceEditView, noView ); |
53 | 64 |
navigator->addEffect( serviceContactCardView, historyView ); |
65 |
navigator->addEffect( historyView, serviceContactCardView ); |
|
61 | 66 |
navigator->addEffect( serviceGroupMemberView, groupActionsView ); |
67 |
navigator->addEffect( groupActionsView, serviceGroupMemberView ); |
|
68 |
navigator->addRoot( serviceGroupMemberView ); |
|
81 | 69 |
qDebug() << "Navigator ready"; |
70 |
||
50 | 71 |
// This object actually executes the services |
72 |
CntServices* services = new CntServices(); |
|
73 |
services->setParent( &mainWindow ); // for ownership |
|
81 | 74 |
qDebug() << "CntServices ready"; |
75 |
||
66 | 76 |
QScopedPointer<CntServiceViewManager> viewManager(new CntServiceViewManager( |
50 | 77 |
&mainWindow, |
66 | 78 |
*services )); // as CntAbstractServiceProvider |
81 | 79 |
qDebug() << "Service ViewManager ready"; |
80 |
||
50 | 81 |
viewManager->setViewNavigator( navigator ); |
81 | 82 |
|
61 | 83 |
services->setEngine( viewManager->engine() ); |
50 | 84 |
|
85 |
// These objects talk with QT Highway (send/receive) |
|
86 |
CntServiceProviderOld* serviceProviderOld = new CntServiceProviderOld( *services, &mainWindow ); // com.nokia.services.phonebookservices.Fetch |
|
87 |
CntServiceProviderOld2* serviceProviderOld2 = new CntServiceProviderOld2( *services, &mainWindow ); // phonebookservices.Fetch |
|
88 |
CntServiceProviderFetch* serviceProviderFetch = new CntServiceProviderFetch( *services, &mainWindow ); // phonebookservices.com.nokia.symbian.IContactFetch |
|
89 |
CntServiceProviderViewing* serviceProviderViewing = new CntServiceProviderViewing( *services, &mainWindow ); // phonebookservices.com.nokia.symbian.IContactView |
|
90 |
CntServiceProviderEdit* serviceProviderEdit = new CntServiceProviderEdit( *services, &mainWindow ); // phonebookservices.com.nokia.symbian.IContactEdit |
|
81 | 91 |
|
92 |
qDebug() << "Service MainWindow about to show"; |
|
24
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
mainWindow.show(); |
81 | 94 |
qDebug() << "Service MainWindow show ready"; |
95 |
||
24
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
return a.exec(); |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
} |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |