|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "cntmainwindow.h" |
|
19 #include "cntdefaultviewmanager.h" |
|
20 #include "cntviewnavigator.h" |
|
21 #include "cntabstractviewfactory.h" |
|
22 #include "cntkeygrabber.h" |
|
23 #include <cntdebug.h> |
|
24 #include <cntabstractengine.h> |
|
25 |
|
26 |
|
27 CntMainWindow::CntMainWindow(QWidget *parent, int defaultView) |
|
28 : HbMainWindow(parent), |
|
29 mViewManager( NULL ), |
|
30 mDefaultView( defaultView ) |
|
31 { |
|
32 CNT_ENTRY |
|
33 CntKeyGrabber *keyGrabber = new CntKeyGrabber(this, this); |
|
34 |
|
35 if (defaultView != noView) |
|
36 { |
|
37 CntViewNavigator* navigator = new CntViewNavigator(this); |
|
38 navigator->addException( favoritesMemberView, collectionView ); |
|
39 navigator->addEffect( groupMemberView, groupActionsView ); |
|
40 navigator->addEffect( groupActionsView, groupMemberView ); |
|
41 navigator->addEffect( contactCardView, historyView ); |
|
42 navigator->addEffect( historyView, contactCardView ); |
|
43 navigator->addRoot( namesView ); |
|
44 navigator->addRoot( collectionView ); |
|
45 navigator->addRoot( groupMemberView ); |
|
46 navigator->addRoot( favoritesMemberView ); |
|
47 |
|
48 mViewManager = new CntDefaultViewManager( this ); |
|
49 mViewManager->setViewNavigator( navigator ); |
|
50 mViewManager->setViewFactory( new CntDefaultViewFactory( mViewManager->engine().extensionManager()) ); |
|
51 |
|
52 //activate the view |
|
53 CntViewParameters viewParameters; |
|
54 viewParameters.insert(EViewId, defaultView); |
|
55 mViewManager->changeView( viewParameters ); |
|
56 } |
|
57 |
|
58 CNT_EXIT |
|
59 } |
|
60 |
|
61 CntMainWindow::~CntMainWindow() |
|
62 { |
|
63 CNT_ENTRY |
|
64 |
|
65 delete mViewManager; |
|
66 mViewManager = NULL; |
|
67 |
|
68 CNT_EXIT |
|
69 } |
|
70 |
|
71 // end of file |