|
1 /* |
|
2 * Copyright (c) 2002 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 the License "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: Client Mtm class declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef PUSHMTMCLIENT_H |
|
21 #define PUSHMTMCLIENT_H |
|
22 |
|
23 // INCLUDE FILES |
|
24 |
|
25 #include <e32std.h> |
|
26 #include <msvstd.h> |
|
27 #include <mtclbase.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 |
|
31 class CMsvOperation; |
|
32 class CMsvEntrySelection; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Client MTM for pushed messages. |
|
38 */ |
|
39 class CPushMtmClient : public CBaseMtm |
|
40 { |
|
41 public: // construction |
|
42 |
|
43 /** |
|
44 * Two-phased constructor (exported factory function). |
|
45 * Leaves on failure. |
|
46 * @param aRegisteredMtmDll Registration data for the MTM DLL. |
|
47 * @param CMsvSession Message Server Session to be used by this client. |
|
48 * @return The constructed client. |
|
49 */ |
|
50 IMPORT_C static CPushMtmClient* NewL |
|
51 ( CRegisteredMtmDll& aRegisteredMtmDll, CMsvSession& aMsvSession ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CPushMtmClient(); |
|
57 |
|
58 private: // construction |
|
59 |
|
60 /** |
|
61 * Constructor. |
|
62 * @param aRegisteredMtmDll Registration data for the MTM DLL. |
|
63 * @param CMsvSession Message Server Session to be used by this client. |
|
64 */ |
|
65 CPushMtmClient |
|
66 ( CRegisteredMtmDll& aRegisteredMtmDll, CMsvSession& aMsvSession ); |
|
67 |
|
68 /** |
|
69 * Second phase constructor. Derivde classes should call this first |
|
70 * during construction. |
|
71 */ |
|
72 void ConstructL(); |
|
73 |
|
74 private: // from CBaseMtm |
|
75 |
|
76 /** |
|
77 * (Not supported) Save the message. |
|
78 */ |
|
79 void SaveMessageL(); |
|
80 |
|
81 /** |
|
82 * (Not supported) Load the message. |
|
83 */ |
|
84 void LoadMessageL(); |
|
85 |
|
86 /** |
|
87 * Validate the current context. |
|
88 * @param aPartList Message parts for which validation is requested. |
|
89 * @return |
|
90 * - Bitmask of the TMsvPartList IDs for each invalid part, or |
|
91 * - KErrNone if all parts are valid. |
|
92 */ |
|
93 TMsvPartList ValidateMessage( TMsvPartList aPartList ); |
|
94 |
|
95 /** |
|
96 * (Not supported) Find text in the current context. |
|
97 * @param aTextToFind Text to find. |
|
98 * @param aPartList Message parts to search. |
|
99 * @return 0 (not supported). |
|
100 */ |
|
101 TMsvPartList Find |
|
102 ( const TDesC& aTextToFind, TMsvPartList aPartList ); |
|
103 |
|
104 /** |
|
105 * (Not supported) Create a reply to the current context. |
|
106 * @param aReplyEntryId The entry to which to assign the reply. |
|
107 * @param aPartList Message parts to include in the reply. |
|
108 * @param aCompletionStatus Completion request status. |
|
109 * @return A completed operation with status KErrNotSupported. |
|
110 */ |
|
111 CMsvOperation* ReplyL |
|
112 ( |
|
113 TMsvId aReplyEntryId, |
|
114 TMsvPartList aPartlist, |
|
115 TRequestStatus& aCompletionStatus |
|
116 ); |
|
117 |
|
118 /** |
|
119 * (Not supported) Create a reply to the current context. |
|
120 * @param aReplyEntryId The entry to which to assign the forwarded |
|
121 * message. |
|
122 * @param aPartList Message parts to include in the forwarded message. |
|
123 * @param aCompletionStatus Completion request status. |
|
124 * @return A completed operation with status KErrNotSupported. |
|
125 */ |
|
126 CMsvOperation* ForwardL |
|
127 ( |
|
128 TMsvId aForwardEntryId, |
|
129 TMsvPartList aPartList, |
|
130 TRequestStatus& aCompletionStatus |
|
131 ); |
|
132 |
|
133 /** |
|
134 * (Not supported) Add an addressee. |
|
135 * @param aRealAddress Real address. |
|
136 * @throw KErrNotSupported The specified function is not supported. |
|
137 */ |
|
138 void AddAddresseeL( const TDesC& aRealAddress ); |
|
139 |
|
140 /** |
|
141 * (Not supported) Add an addressee. |
|
142 * @param aRealAddress Real address. |
|
143 * @param aAlias Alias information. |
|
144 * @throw KErrNotSupported The specified function is not supported. |
|
145 */ |
|
146 void AddAddresseeL( const TDesC& aRealAddress, |
|
147 const TDesC& aAlias ); |
|
148 |
|
149 /** |
|
150 * (Not supported) Remove an addressee. |
|
151 * @param aIndex Index of addressee. |
|
152 */ |
|
153 void RemoveAddressee( TInt aIndex ); |
|
154 |
|
155 /** |
|
156 * Call CBaseMtmUiData::QueryCapability. |
|
157 * @param aCapability UID of capability to be queried. |
|
158 * @param aResponse Response value. |
|
159 * @return |
|
160 * - KErrNone: aCapability is a recognised value |
|
161 * and a response is returned. |
|
162 * - KErrNotSupported: aCapability is not a recognised value. |
|
163 */ |
|
164 TInt QueryCapability( TUid aCapability, TInt& aResponse ); |
|
165 |
|
166 /** |
|
167 * Invoke synchronous functions. |
|
168 * Supported function(s): |
|
169 * - EPushMtmCmdCollectGarbage Deleting expired SIs |
|
170 * @param aFunctionId ID of the requested operation. |
|
171 * @param aSelection Selection of message entries to operate on. |
|
172 * EPushMtmCmdFetchContent does not use it. It operates on the |
|
173 * current MTM context. |
|
174 * EPushMtmCmdCollectGarbage uses it. If it is not empty, then |
|
175 * the first element is used as folder specifier, otherwise |
|
176 * if the list s empty then KMsvNullIndexEntryId is passed to |
|
177 * the GC operation. |
|
178 * @param aParameter Ignored. |
|
179 * @return None. |
|
180 * @throw KErrNotSupported The specified function is not supported. |
|
181 */ |
|
182 void InvokeSyncFunctionL |
|
183 ( |
|
184 TInt aFunctionId, |
|
185 const CMsvEntrySelection& aSelection, |
|
186 TDes8& aParameter |
|
187 ); |
|
188 |
|
189 /** |
|
190 * Invoke asynchronous operation. |
|
191 * Supported functions: |
|
192 * - EPushMtmCmdFetchContent (SL specific!) |
|
193 * - EPushMtmCmdCollectGarbage Deleting expired SIs |
|
194 * @param aFunctionId ID of the requested operation. |
|
195 * @param aSelection Selection of message entries to operate on. |
|
196 * EPushMtmCmdFetchContent does not use it. It operates on the |
|
197 * current MTM context. |
|
198 * EPushMtmCmdCollectGarbage uses it. If it is not empty, then |
|
199 * the first element is used as folder specifier, otherwise |
|
200 * if the list s empty then KMsvNullIndexEntryId is passed to |
|
201 * the GC operation. |
|
202 * @param aParameter Buffer containing input and output parameters. |
|
203 * @param aCompletionStatus Completion status. |
|
204 * @return |
|
205 * - If successful, an asynchronously completing operation. |
|
206 * - If failed, a completed operation, with status set to the |
|
207 * relevant error code. |
|
208 * @throw KErrNotSupported The specified function is not supported. |
|
209 */ |
|
210 CMsvOperation* InvokeAsyncFunctionL |
|
211 ( |
|
212 TInt aFunctionId, |
|
213 const CMsvEntrySelection& aSelection, |
|
214 TDes8& aParameter, |
|
215 TRequestStatus& aCompletionStatus |
|
216 ); |
|
217 |
|
218 /** |
|
219 * Context changed callback function. It does nothing. |
|
220 */ |
|
221 void ContextEntrySwitched(); |
|
222 }; |
|
223 |
|
224 #endif // PUSHMTMCLIENT_H |
|
225 |
|
226 // End of file. |