|
1 /* |
|
2 * Copyright (c) 2010 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: A helper object to open messagin entries (e.g. emails). |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef AIS_MSV_UI_H |
|
19 #define AIS_MSV_UI_H |
|
20 |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <msvapi.h> |
|
26 |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 |
|
30 class CBaseMtm; |
|
31 class CBaseMtmUi; |
|
32 class CClientMtmRegistry; |
|
33 class CMsvOperation; |
|
34 class CMsvSession; |
|
35 class CMtmUiRegistry; |
|
36 |
|
37 |
|
38 // CLASS DECLARATIONS |
|
39 |
|
40 /** |
|
41 * Interface for opening messaging entries (e.g. emails). |
|
42 */ |
|
43 class MMsvUI |
|
44 { |
|
45 public: // New functions |
|
46 |
|
47 /** |
|
48 * Opens the messaging entry. |
|
49 * |
|
50 * @param aMsvId TMsvId of the entry to open, as TUid |
|
51 */ |
|
52 virtual void OpenEntryL( const TUid& aMsvId ) = 0; |
|
53 }; |
|
54 |
|
55 /** |
|
56 * A helper object to open messaging entries (e.g. emails). |
|
57 * |
|
58 * MTM UI, which is used to open emails (at least), is asyncronous API. This |
|
59 * is a helper class that is active while the UI is open. |
|
60 */ |
|
61 class CMsvUI : public CActive, |
|
62 public MMsvUI, |
|
63 public MMsvSessionObserver |
|
64 { |
|
65 public: // Constructor and destructor |
|
66 |
|
67 /** |
|
68 * C++ constructor. |
|
69 */ |
|
70 CMsvUI(); |
|
71 |
|
72 /** |
|
73 * Destructor |
|
74 */ |
|
75 virtual ~CMsvUI(); |
|
76 |
|
77 public: // Functions from base classes |
|
78 |
|
79 /** |
|
80 * From MMsvUI. |
|
81 * |
|
82 * Opens the messaging entry. |
|
83 * |
|
84 * @param aMsvId TMsvId of the entry to open, as TUid |
|
85 */ |
|
86 void OpenEntryL( const TUid& aMsvId ); |
|
87 |
|
88 private: // Functions from base classes |
|
89 |
|
90 /** |
|
91 * From CActive. |
|
92 * |
|
93 * Handles an active object's request completion event. |
|
94 * |
|
95 * The function is called by the active scheduler when a request |
|
96 * completion event occurs, i.e. after the active scheduler's |
|
97 * WaitForAnyRequest() function completes. |
|
98 * |
|
99 * Before calling this active object's RunL() function, the active |
|
100 * scheduler has: |
|
101 * |
|
102 * 1. decided that this is the highest priority active object with a |
|
103 * completed request |
|
104 * |
|
105 * 2. marked this active object's request as complete (i.e. the |
|
106 * request is no longer outstanding) |
|
107 * |
|
108 * RunL() runs under a trap harness in the active scheduler. If it |
|
109 * leaves, then the active scheduler calls RunError() to handle the |
|
110 * leave. |
|
111 * |
|
112 * Note that once the active scheduler's Start() function has been |
|
113 * called, all user code is run under one of the program's active |
|
114 * object's RunL() or RunError() functions. |
|
115 * |
|
116 * @see CActiveScheduler::Start |
|
117 * @see CActiveScheduler::Error |
|
118 * @see CActiveScheduler::WaitForAnyRequest |
|
119 * @see TRAPD |
|
120 */ |
|
121 void RunL(); |
|
122 |
|
123 /** |
|
124 * From CActive. |
|
125 * |
|
126 * Implements cancellation of an outstanding request. |
|
127 * |
|
128 * This function is called as part of the active object's Cancel(). |
|
129 * |
|
130 * It must call the appropriate cancel function offered by the active |
|
131 * object's asynchronous service provider. The asynchronous service |
|
132 * provider's cancel is expected to act immediately. |
|
133 * |
|
134 * DoCancel() must not wait for event completion; this is handled by |
|
135 * Cancel(). |
|
136 * |
|
137 * @see CActive::Cancel |
|
138 */ |
|
139 void DoCancel(); |
|
140 |
|
141 /** |
|
142 * From MMsvSessionObserver. |
|
143 * |
|
144 * Indicates an event has occurred. |
|
145 * |
|
146 * The type of event is indicated by the value of aEvent. The |
|
147 * interpretation of the TAny arguments depends on this type. |
|
148 * |
|
149 * For most event types, the action that is taken, for example, |
|
150 * updating the display, is client-specific. All clients though |
|
151 * should respond to EMsvCloseSession and EMsvServerTerminated events. |
|
152 * |
|
153 * @param aEvent Indicates the event type. |
|
154 * @param aArg1 Event type-specific argument value. |
|
155 * @param aArg2 Event type-specific argument value. |
|
156 * @param aArg3 Event type-specific argument value. |
|
157 */ |
|
158 void HandleSessionEventL( TMsvSessionEvent aEvent, |
|
159 TAny* aArg1, |
|
160 TAny* aArg2, |
|
161 TAny* aArg3 ); |
|
162 |
|
163 private: // Data |
|
164 // Represents a channel of communication between message client |
|
165 // application and the Message Server thread |
|
166 CMsvSession* iSession; |
|
167 // Accesses the Client-side MTM registry. |
|
168 CClientMtmRegistry* iMtmReg; |
|
169 // Accesses the User Interface MTM registry. |
|
170 CMtmUiRegistry* iUIReg; |
|
171 // Provides a high-level interface for accessing a Message Server |
|
172 // entry |
|
173 CBaseMtm* iMtm; |
|
174 // Provides MTM-specific user interaction such as viewing of message |
|
175 // entries |
|
176 CBaseMtmUi* iUI; |
|
177 // Represents an ongoing action in the UI. |
|
178 CMsvOperation* iOperation; |
|
179 }; |
|
180 |
|
181 #endif // AIS_MSV_UI_H |
|
182 |
|
183 // End of File |