|
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: Command Manager used for creating the commands |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 |
|
22 #include "CCAAppSettCommand.h" |
|
23 #include "CCACommandManager.h" |
|
24 #include "CCALoginCmd.h" |
|
25 #include "chatngclient.hrh" |
|
26 #include "avkon.hrh" |
|
27 #include "uikon.hrh" |
|
28 #include "CCAContactEditCmd.h" |
|
29 |
|
30 |
|
31 |
|
32 // ============================ MEMBER FUNCTIONS =============================== |
|
33 |
|
34 // ----------------------------------------------------------------------------- |
|
35 // CCACommandManager::NewL |
|
36 // ----------------------------------------------------------------------------- |
|
37 // |
|
38 CCACommandManager* CCACommandManager::NewL() |
|
39 { |
|
40 return new( ELeave ) CCACommandManager(); |
|
41 } |
|
42 |
|
43 // ----------------------------------------------------------------------------- |
|
44 // CCACommandManager::CCACommandManager |
|
45 // Default Constructor |
|
46 // ----------------------------------------------------------------------------- |
|
47 // |
|
48 CCACommandManager::CCACommandManager() |
|
49 { |
|
50 |
|
51 } |
|
52 |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CCACommandManager::CCACommandManager |
|
56 // Default Constructor |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 CCACommandManager::~CCACommandManager() |
|
60 { |
|
61 |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // CCACommandManager::NewCommandLC |
|
66 // |
|
67 // PLEASE NOTE VERY IMPT : THE CALLER OF THIS METHOD HAS TO DELETE THE COMMAND OBJECT. |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 MCACommand* CCACommandManager::NewCommandLC( TInt aCommandId, |
|
71 MCAProcessManager& aProcessManager, |
|
72 MCAUiLoginCmdCB& aUiLoginCmdCB ) |
|
73 { |
|
74 MCACommand* command = NULL; |
|
75 |
|
76 switch ( aCommandId ) |
|
77 { |
|
78 |
|
79 case EChatClientMainViewCmdLogin: |
|
80 case EChatClientMainViewCmdLogout: |
|
81 case EAknCmdExit: // fall-through, handled similarily |
|
82 case EEikCmdExit: |
|
83 case EAknSoftkeyExit: |
|
84 case EChatClientCmdExit: |
|
85 { |
|
86 command = CCALoginCmd::NewLC( aProcessManager, |
|
87 aUiLoginCmdCB, |
|
88 *iSessionHandlerCmd ); |
|
89 break; |
|
90 } |
|
91 |
|
92 default: |
|
93 { |
|
94 break; |
|
95 } |
|
96 } |
|
97 |
|
98 return command; |
|
99 } |
|
100 |
|
101 // ----------------------------------------------------------------------------- |
|
102 // CCACommandManager::NewCommandLC |
|
103 // ----------------------------------------------------------------------------- |
|
104 |
|
105 MCASettingsCommand* CCACommandManager::NewCommandLC( TInt aCommandId, |
|
106 MCAProcessManager& aProcessManager, |
|
107 MCAUiSettingsDialogCmdCB& aUiCmdCB ) |
|
108 { |
|
109 MCASettingsCommand* command = NULL; |
|
110 |
|
111 switch ( aCommandId ) |
|
112 { |
|
113 |
|
114 case EChatClientApplicationSettings: |
|
115 { |
|
116 command = CCAAppSettCommand::NewLC( aProcessManager, |
|
117 aUiCmdCB ); |
|
118 break; |
|
119 } |
|
120 |
|
121 |
|
122 default: |
|
123 { |
|
124 break; |
|
125 } |
|
126 } |
|
127 |
|
128 return command; |
|
129 } |
|
130 |
|
131 |
|
132 // ----------------------------------------------------------------------------- |
|
133 // CCACommandManager::NewCommandL |
|
134 // ----------------------------------------------------------------------------- |
|
135 |
|
136 MCASettingsCommand* CCACommandManager::NewCommandL( TInt aCommandId, |
|
137 MCAProcessManager& aProcessManager, |
|
138 MCAUiSettingsDialogCmdCB& aUiCmdCB ) |
|
139 { |
|
140 MCASettingsCommand* command = NULL; |
|
141 |
|
142 switch ( aCommandId ) |
|
143 { |
|
144 |
|
145 case EChatClientApplicationSettings: |
|
146 { |
|
147 command = CCAAppSettCommand::NewL( aProcessManager, |
|
148 aUiCmdCB ); |
|
149 break; |
|
150 } |
|
151 |
|
152 |
|
153 default: |
|
154 { |
|
155 break; |
|
156 } |
|
157 } |
|
158 |
|
159 return command; |
|
160 } |
|
161 |
|
162 // ----------------------------------------------------------------------------- |
|
163 // CCACommandManager::Initialize |
|
164 // Initializes the session handler |
|
165 // ----------------------------------------------------------------------------- |
|
166 // |
|
167 void CCACommandManager::Initialize( CCASessionHandlerCmd* aSessionHandlerCmd ) |
|
168 { |
|
169 iSessionHandlerCmd = aSessionHandlerCmd; |
|
170 } |
|
171 |
|
172 |
|
173 //added by saravana |
|
174 |
|
175 // ----------------------------------------------------------------------------- |
|
176 // CCACommandManager::NewCommandLC |
|
177 // ----------------------------------------------------------------------------- |
|
178 |
|
179 MCACommand* CCACommandManager::NewCommandLC( TInt aCommandId, |
|
180 MCAProcessManager& aProcessManager, |
|
181 MCAUiContactEditCmdCB& aUiCmdCB ) |
|
182 { |
|
183 CCAContactEditCmd* command = NULL; |
|
184 |
|
185 switch ( aCommandId ) |
|
186 { |
|
187 |
|
188 case EChatClientDetailsEdit: |
|
189 { |
|
190 command = CCAContactEditCmd::NewLC( aProcessManager, |
|
191 aUiCmdCB ); |
|
192 break; |
|
193 } |
|
194 |
|
195 |
|
196 default: |
|
197 { |
|
198 break; |
|
199 } |
|
200 } |
|
201 |
|
202 return command; |
|
203 } |
|
204 |
|
205 |
|
206 |
|
207 // ----------------------------------------------------------------------------- |
|
208 // CCACommandManager::NewCommandLC |
|
209 // ----------------------------------------------------------------------------- |
|
210 |
|
211 MCACommand* CCACommandManager::NewCommandL( TInt aCommandId, |
|
212 MCAProcessManager& aProcessManager, |
|
213 MCAUiContactEditCmdCB& aUiCmdCB ) |
|
214 { |
|
215 CCAContactEditCmd* command = NULL; |
|
216 |
|
217 switch ( aCommandId ) |
|
218 { |
|
219 |
|
220 case EChatClientDetailsEdit: |
|
221 { |
|
222 command = CCAContactEditCmd::NewL( aProcessManager, |
|
223 aUiCmdCB ); |
|
224 break; |
|
225 } |
|
226 |
|
227 |
|
228 default: |
|
229 { |
|
230 break; |
|
231 } |
|
232 } |
|
233 |
|
234 return command; |
|
235 } |
|
236 |
|
237 // ----------------------------------------------------------------------------- |
|
238 // CCACommandManager::GetSessionHandlerCmd |
|
239 // ----------------------------------------------------------------------------- |
|
240 // |
|
241 |
|
242 MCASessionHandlerCmd* CCACommandManager::GetSessionHandlerCmd() |
|
243 { |
|
244 return iSessionHandlerCmd; |
|
245 } |
|
246 |
|
247 |
|
248 // End of File |