|
1 /* |
|
2 * Copyright (c) 2006 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: Creator class for views. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDES |
|
20 #include "CAViewCreator.h" |
|
21 #include "CCARecordedChatsListView.h" |
|
22 #include "CCARecordedChatsView.h" |
|
23 #include "CAExternalInterface.h" |
|
24 #include "CCAConversationsView.h" |
|
25 #include "CCASettingsView.h" |
|
26 #include "CCASearchView.h" |
|
27 #include "CCARefreshView.h" |
|
28 #include "CCAChatView.h" |
|
29 #include "CCASingleListView.h" |
|
30 #include "ccainvitationview.h" |
|
31 |
|
32 #include <ChatNG.rsg> |
|
33 |
|
34 // ----------------------------------------------------------------------------- |
|
35 // CAViewCreator::CreateMainViewL |
|
36 // Create all needed views |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 void CAViewCreator::CreateMainViewL( CCAAppUi& aAppUi ) |
|
40 { |
|
41 CCASingleListView* view4 = new ( ELeave ) CCASingleListView; |
|
42 CleanupStack::PushL( view4 ); |
|
43 view4->ConstructL( R_CHATCLIENT_FRIENDSLIST_VIEW, KUidFriendsListView ); |
|
44 aAppUi.AddViewL( view4 ); // transfer ownership to CAknViewAppUi |
|
45 CleanupStack::Pop( view4 ); |
|
46 TVwsViewId aTempId = view4->ViewId(); |
|
47 view4->ActivateViewL( aTempId ); |
|
48 aAppUi.SetDefaultViewL( *view4 ); |
|
49 } |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // CAViewCreator::CreateOtherViewsL |
|
53 // Create all needed views |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 void CAViewCreator::CreateOtherViewsL( CCAAppUi& aAppUi ) |
|
57 { |
|
58 // Create chat-view |
|
59 CCAChatView* view2 = new ( ELeave ) CCAChatView; |
|
60 CleanupStack::PushL( view2 ); |
|
61 // Chat-view has a specialized ConstructL instead of BaseConstructL |
|
62 view2->ConstructL( R_CHATCLIENT_CHAT_VIEW, KUidChatView, aAppUi.MessageHandler() ); |
|
63 aAppUi.AddViewL( view2 ); // transfer ownership to CAknViewAppUi |
|
64 CleanupStack::Pop( view2 ); |
|
65 |
|
66 // Create settings view |
|
67 CCASettingsView* view6 = new ( ELeave ) CCASettingsView; |
|
68 CleanupStack::PushL( view6 ); |
|
69 view6->ConstructL( R_CHATCLIENT_SETTINGS_VIEW, KUidSettingsView ); |
|
70 aAppUi.AddViewL( view6 ); |
|
71 CleanupStack::Pop( view6 ); |
|
72 |
|
73 |
|
74 // Create search view |
|
75 CCASearchView* view7 = new ( ELeave ) CCASearchView; |
|
76 CleanupStack::PushL( view7 ); |
|
77 view7->BaseConstructL( R_CHATCLIENT_SEARCH_VIEW, KUidSearchView ); |
|
78 aAppUi.AddViewL( view7 ); |
|
79 CleanupStack::Pop( view7 ); |
|
80 |
|
81 // Conversations view |
|
82 CCAConversationsView* view9 = new ( ELeave ) CCAConversationsView; |
|
83 CleanupStack::PushL( view9 ); |
|
84 view9->ConstructL( R_CHATCLIENT_P2P_VIEW, KUidConversationsView, aAppUi.MessageHandler() ); |
|
85 aAppUi.AddViewL( view9 ); |
|
86 CleanupStack::Pop( view9 ); |
|
87 |
|
88 // Create recorded chats list-view |
|
89 CCARecordedChatsListView* view10 = new ( ELeave ) CCARecordedChatsListView; |
|
90 CleanupStack::PushL( view10 ); |
|
91 // Chatlist-view has a specialized ConstructL instead of BaseConstructL |
|
92 view10->ConstructL( R_CHATCLIENT_RECORDEDCHATSLIST_VIEW , KUidRecordedChatListView ); |
|
93 aAppUi.AddViewL( view10 ); // transfer ownership to CAknViewAppUi |
|
94 CleanupStack::Pop( view10 ); |
|
95 |
|
96 // Create recorded chats view |
|
97 CCARecordedChatsView* view11 = new ( ELeave ) CCARecordedChatsView; |
|
98 CleanupStack::PushL( view11 ); |
|
99 // Chatlist-view has a specialized ConstructL instead of BaseConstructL |
|
100 view11->ConstructL( R_CHATCLIENT_RECORDEDCHATS_VIEW , KUidRecordedChatView ); |
|
101 aAppUi.AddViewL( view11 ); // transfer ownership to CAknViewAppUi |
|
102 CleanupStack::Pop( view11 ); |
|
103 view11->SetRecordedChatProvider( view10->RecordedChatArrayProvider() ); |
|
104 |
|
105 // View for branding refresh functionality |
|
106 CCARefreshView* view12 = new ( ELeave ) CCARefreshView( aAppUi.RefreshWaitFlag() ); |
|
107 CleanupStack::PushL( view12 ); |
|
108 view12->BaseConstructL( R_CHATCLIENT_REFRESHVIEW, KUidRefreshView ); |
|
109 aAppUi.AddViewL( view12 ); // transfer ownership to CAknViewAppUi |
|
110 CleanupStack::Pop( view12 ); |
|
111 |
|
112 // View for Invitation |
|
113 CCAInvitationView* view14 = new ( ELeave ) CCAInvitationView; |
|
114 CleanupStack::PushL( view14 ); |
|
115 view14->ConstructL( R_CHATCLIENT_INVITATIONS_VIEW, KUidInvitationView ); |
|
116 aAppUi.AddViewL( view14 ); // transfer ownership to CAknViewAppUi |
|
117 CleanupStack::Pop( view14 ); |
|
118 } |
|
119 |
|
120 // end of file |