author | hgs |
Tue, 21 Sep 2010 17:07:25 +0300 | |
changeset 72 | 6abfb1094884 |
parent 66 | 554fe4dbbb59 |
child 81 | 640d30f4fb64 |
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> |
24
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include <QTranslator> |
40
b46a585f6909
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
21 |
#include <QLocale> |
66 | 22 |
#include <QScopedPointer> |
50 | 23 |
#include "cntserviceproviderold.h" |
24 |
#include "cntserviceproviderold2.h" |
|
25 |
#include "cntserviceproviderfetch.h" |
|
26 |
#include "cntserviceproviderold2.h" |
|
27 |
#include "cntserviceproviderviewing.h" |
|
28 |
#include "cntserviceprovideredit.h" |
|
29 |
#include "cntservices.h" |
|
30 |
#include "cntserviceviewmanager.h" |
|
31 |
#include "cntviewnavigator.h" |
|
54 | 32 |
#include "cntkeygrabber.h" |
53 | 33 |
#include "cntdebug.h" |
50 | 34 |
#include <cntviewparams.h> |
24
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
|
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
int main(int argc, char **argv) |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
{ |
66 | 38 |
#if defined (TRACES) || defined (TRACE2FILE) |
53 | 39 |
qInstallMsgHandler(MSG_HANDLER); |
66 | 40 |
#endif |
53 | 41 |
|
24
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
HbApplication a( argc, argv ); |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
|
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
QTranslator translator; |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
QString lang = QLocale::system().name(); |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
QString path = "z:/resource/qt/translations/"; |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
translator.load(path + "contacts_" + lang); |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
a.installTranslator(&translator); |
50 | 49 |
|
53 | 50 |
HbMainWindow mainWindow; |
54 | 51 |
CntKeyGrabber *keyGrabber = new CntKeyGrabber(&mainWindow, &mainWindow); |
50 | 52 |
|
53 |
CntViewNavigator* navigator = new CntViewNavigator( &mainWindow ); |
|
72 | 54 |
navigator->addException( serviceEditView, noView ); |
53 | 55 |
navigator->addEffect( serviceContactCardView, historyView ); |
56 |
navigator->addEffect( historyView, serviceContactCardView ); |
|
61 | 57 |
navigator->addEffect( serviceGroupMemberView, groupActionsView ); |
58 |
navigator->addEffect( groupActionsView, serviceGroupMemberView ); |
|
59 |
navigator->addRoot( serviceGroupMemberView ); |
|
50 | 60 |
|
61 |
// This object actually executes the services |
|
62 |
CntServices* services = new CntServices(); |
|
63 |
services->setParent( &mainWindow ); // for ownership |
|
64 |
||
66 | 65 |
QScopedPointer<CntServiceViewManager> viewManager(new CntServiceViewManager( |
50 | 66 |
&mainWindow, |
66 | 67 |
*services )); // as CntAbstractServiceProvider |
50 | 68 |
viewManager->setViewNavigator( navigator ); |
69 |
||
61 | 70 |
services->setEngine( viewManager->engine() ); |
50 | 71 |
|
72 |
// These objects talk with QT Highway (send/receive) |
|
73 |
CntServiceProviderOld* serviceProviderOld = new CntServiceProviderOld( *services, &mainWindow ); // com.nokia.services.phonebookservices.Fetch |
|
74 |
CntServiceProviderOld2* serviceProviderOld2 = new CntServiceProviderOld2( *services, &mainWindow ); // phonebookservices.Fetch |
|
75 |
CntServiceProviderFetch* serviceProviderFetch = new CntServiceProviderFetch( *services, &mainWindow ); // phonebookservices.com.nokia.symbian.IContactFetch |
|
76 |
CntServiceProviderViewing* serviceProviderViewing = new CntServiceProviderViewing( *services, &mainWindow ); // phonebookservices.com.nokia.symbian.IContactView |
|
77 |
CntServiceProviderEdit* serviceProviderEdit = new CntServiceProviderEdit( *services, &mainWindow ); // phonebookservices.com.nokia.symbian.IContactEdit |
|
24
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
|
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
mainWindow.show(); |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
|
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
return a.exec(); |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
} |
0ba2181d7c28
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |