|
1 /* |
|
2 * Copyright (c) 2004 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: Methods for CNcnClass0Viewer class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "NcnDebug.h" |
|
22 #include "CNcnClass0Viewer.h" |
|
23 #include "CNcnMsvSessionHandler.h" |
|
24 #include <MuiuMsgEditorLauncher.h> |
|
25 |
|
26 // ================= LOCAL CONSTANTS ======================= |
|
27 namespace |
|
28 { |
|
29 const TUid KUidMsgSmsViewer = {0x100058BD}; |
|
30 const TUid KUidSmsMtmId = {0x1000102c}; |
|
31 } |
|
32 |
|
33 // ================= MEMBER FUNCTIONS ======================= |
|
34 |
|
35 // ---------------------------------------------------- |
|
36 // CNcnClass0Viewer::CNcnClass0Viewer |
|
37 // ---------------------------------------------------- |
|
38 // |
|
39 CNcnClass0Viewer::CNcnClass0Viewer( |
|
40 CNcnMsvSessionHandler& aMsvSessionHandler ) : |
|
41 CActive( EPriorityNormal ), |
|
42 iMsvSessionHandler( aMsvSessionHandler ) |
|
43 { |
|
44 // empty |
|
45 } |
|
46 |
|
47 // ---------------------------------------------------- |
|
48 // CNcnClass0Viewer::NewL |
|
49 // ---------------------------------------------------- |
|
50 // |
|
51 CNcnClass0Viewer* CNcnClass0Viewer::NewL( |
|
52 CNcnMsvSessionHandler& aMsvSessionHandler ) |
|
53 { |
|
54 CNcnClass0Viewer* self = new (ELeave) CNcnClass0Viewer( aMsvSessionHandler ); |
|
55 |
|
56 CleanupStack::PushL( self ); |
|
57 self->ConstructL(); |
|
58 CleanupStack::Pop( self ); |
|
59 |
|
60 return self; |
|
61 } |
|
62 |
|
63 // ---------------------------------------------------- |
|
64 // CNcnClass0Viewer::ConstructL |
|
65 // ---------------------------------------------------- |
|
66 // |
|
67 void CNcnClass0Viewer::ConstructL() |
|
68 { |
|
69 // add AO to scheduler |
|
70 CActiveScheduler::Add( this ); |
|
71 } |
|
72 |
|
73 // ---------------------------------------------------- |
|
74 // CNcnClass0Viewer::~CNcnClass0Viewer |
|
75 // ---------------------------------------------------- |
|
76 // |
|
77 CNcnClass0Viewer::~CNcnClass0Viewer() |
|
78 { |
|
79 Cancel(); |
|
80 } |
|
81 |
|
82 // ---------------------------------------------------- |
|
83 // CNcnClass0Viewer::RunL |
|
84 // ---------------------------------------------------- |
|
85 // |
|
86 void CNcnClass0Viewer::RunL() |
|
87 { |
|
88 // just release operation instance, if any |
|
89 if( iMsvOperation ) |
|
90 { |
|
91 delete iMsvOperation; |
|
92 iMsvOperation = 0; |
|
93 } |
|
94 } |
|
95 |
|
96 // ---------------------------------------------------- |
|
97 // CNcnClass0Viewer::RunError |
|
98 // ---------------------------------------------------- |
|
99 // |
|
100 TInt CNcnClass0Viewer::RunError( TInt aError ) |
|
101 { |
|
102 return aError; |
|
103 } |
|
104 |
|
105 // ---------------------------------------------------- |
|
106 // CNcnClass0Viewer::DoCancel |
|
107 // ---------------------------------------------------- |
|
108 // |
|
109 void CNcnClass0Viewer::DoCancel() |
|
110 { |
|
111 // cancel & release operation instance, if any |
|
112 if( iMsvOperation ) |
|
113 { |
|
114 iMsvOperation->Cancel(); |
|
115 delete iMsvOperation; |
|
116 iMsvOperation = 0; |
|
117 } |
|
118 } |
|
119 |
|
120 // ---------------------------------------------------- |
|
121 // CNcnClass0Viewer::ShowClass0SmsL |
|
122 // ---------------------------------------------------- |
|
123 // |
|
124 void CNcnClass0Viewer::ShowClass0SmsL( const TMsvEntry& aEntry ) |
|
125 { |
|
126 //Cancel outstanding requests |
|
127 if( IsActive() ) |
|
128 { |
|
129 Cancel(); |
|
130 } |
|
131 |
|
132 //Create launch parameters |
|
133 TEditorParameters launchParams; |
|
134 launchParams.iId = aEntry.Id(); |
|
135 launchParams.iFlags |= EMsgReadOnly; |
|
136 |
|
137 // get session reference |
|
138 CMsvSession& msvSession = |
|
139 iMsvSessionHandler.MsvSessionL(); |
|
140 |
|
141 // launch editor |
|
142 iMsvOperation = |
|
143 MsgEditorLauncher::LaunchEditorApplicationL( |
|
144 msvSession, |
|
145 KUidSmsMtmId, |
|
146 iStatus, |
|
147 launchParams, |
|
148 *(MsvUiEditorUtilities::ResolveAppFileNameL( KUidMsgSmsViewer ) ) ); |
|
149 |
|
150 // set status and activate AO |
|
151 iStatus = KRequestPending; |
|
152 SetActive(); |
|
153 } |
|
154 |
|
155 // End of File |