|
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: MMBox related headers present in message PDUs |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MMSMMBOXMESSAGEHEADERS_H |
|
22 #define MMSMMBOXMESSAGEHEADERS_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include "mmsmmboxflags.h" |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // MACROS |
|
31 |
|
32 // DATA TYPES |
|
33 |
|
34 // FUNCTION PROTOTYPES |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class RMsvReadStream; |
|
38 class RMsvWriteStream; |
|
39 class CDesC8Array; |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * MMBox related headers present in message PDUs. |
|
45 * |
|
46 * @lib mmsutil.lib |
|
47 * @since 2.6 |
|
48 */ |
|
49 class CMmsMMBoxMessageHeaders : public CBase |
|
50 { |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 */ |
|
56 static CMmsMMBoxMessageHeaders* NewL(); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CMmsMMBoxMessageHeaders(); |
|
62 |
|
63 public: // New functions |
|
64 |
|
65 /** |
|
66 * Internalize. |
|
67 * @since 2.6 |
|
68 * @param aStream opened read stream |
|
69 */ |
|
70 void InternalizeL( RMsvReadStream& aStream ); |
|
71 |
|
72 /** |
|
73 * Externalize. |
|
74 * @since 2.6 |
|
75 * @param aStream opened write stream |
|
76 */ |
|
77 void ExternalizeL( RMsvWriteStream& aStream ) const; |
|
78 |
|
79 /* |
|
80 * How much room this needs on disk |
|
81 * @since 2.6 |
|
82 * @return amount of bytes the data in this item needs |
|
83 */ |
|
84 TInt Size() const; |
|
85 |
|
86 /** |
|
87 * MMBox Store request accessor |
|
88 * @since 2.6 |
|
89 * @return Should message be stored to Mmbox? (KMmsYes/KMmsNo) |
|
90 */ |
|
91 inline TInt MmsStore() const; |
|
92 |
|
93 /** |
|
94 * MMBox Store request mutator |
|
95 * @since 2.6 |
|
96 * @param aMmsStore Should message be stored to Mmbox? (KMmsYes/KMmsNo) |
|
97 */ |
|
98 inline void SetMmsStore ( TInt aMmsStore ); |
|
99 |
|
100 /** |
|
101 * Message MMBoxState accessor |
|
102 * @since 2.6 |
|
103 * @return message MMBox State Draft/Sent/New/Retrieved/Forwarded |
|
104 */ |
|
105 inline TInt MmsMMState() const; |
|
106 |
|
107 /** |
|
108 * Message MMBoxState mutator |
|
109 * @since 2.6 |
|
110 * @param aMmsMMState message MMBox State Draft/Sent/New/Retrieved/Forwarded |
|
111 */ |
|
112 inline void SetMMState( TInt aMmsMMState ); |
|
113 |
|
114 /** |
|
115 * MMBox store state accessor |
|
116 * @since 2.6 |
|
117 * @return Has MMS message been stored in MMBox? (KMmsYes/KMmsNo) |
|
118 */ |
|
119 inline TInt MmsStored() const; |
|
120 |
|
121 /** |
|
122 * MMBox store state mutator - needed by decode |
|
123 * @since 2.6 |
|
124 * @param aMmsStored Has MMS message been stored in MMBox? (KMmsYes/KMmsNo) |
|
125 */ |
|
126 inline void SetMmsStored( TInt aMmsStored ); |
|
127 |
|
128 /** |
|
129 * Status code from operation where message storing to MMBox was requested. |
|
130 * @since 2.6 |
|
131 * @return Message MMBox Store status (Success or error code) |
|
132 */ |
|
133 inline TInt MmsStoreStatus() const; |
|
134 |
|
135 /** |
|
136 * Set Status code from operation where message storing to MMBox was requested. |
|
137 * @since 2.6 |
|
138 * @param aMmsStoreStatus Message MMBox Store status (Success or error code) |
|
139 */ |
|
140 inline void SetMmsStoreStatus( TInt aMmsStoreStatus ); |
|
141 |
|
142 /** |
|
143 * Store status text accessor. |
|
144 * @since 2.6 |
|
145 * @return MMBox MmsStoreStatus text string. |
|
146 */ |
|
147 IMPORT_C TPtrC MmsStoreStatusText() const; |
|
148 |
|
149 /** |
|
150 * Store status text mutator. |
|
151 * @since 2.6 |
|
152 * @param aText MMBox MmsStoreStatus text string, |
|
153 */ |
|
154 IMPORT_C void SetMmsStoreStatusTextL( const TDesC& aText ); |
|
155 |
|
156 /** |
|
157 * Give access to the content location array |
|
158 * @return Content location array |
|
159 */ |
|
160 inline CDesC8Array& ContentLocationList() const; |
|
161 |
|
162 /** |
|
163 * Keyword array accessor |
|
164 * @since 2.6 |
|
165 * @return reference to the keyword array. |
|
166 */ |
|
167 inline RPointerArray<CMmsMMBoxFlags>& KeywordArray(); |
|
168 |
|
169 /** |
|
170 * Add item to keyword array |
|
171 * Items are always appended (no sorting order defined). |
|
172 * If item with specified keyword exists, token is updated. |
|
173 * @since 2.6 |
|
174 * @param aToken MMBox Operation connected with keyword (Add/Remove/Filter) |
|
175 * @param aKeyword Keyword connected to object |
|
176 */ |
|
177 IMPORT_C void AppendKeywordItemL( TInt aToken, const TDesC& aKeyword ); |
|
178 |
|
179 /** |
|
180 * Remove keyword item from MMBox flags array |
|
181 * @since 2.6 |
|
182 * @param aKeyword first item with this keyword is deleted. |
|
183 */ |
|
184 IMPORT_C void DeleteKeywordItem( const TDesC& aKeyword ); |
|
185 |
|
186 /** |
|
187 * Find item corresponding to given keyword from array |
|
188 * @since 2.6 |
|
189 * @return index of item with keyword, |
|
190 * KErr NotFound, if keyword not in array |
|
191 */ |
|
192 IMPORT_C TInt FindItemWithKeyword( const TDesC& aKeyword ); |
|
193 |
|
194 public: // Functions from base classes |
|
195 |
|
196 protected: // New functions |
|
197 |
|
198 protected: // Functions from base classes |
|
199 |
|
200 private: |
|
201 |
|
202 /** |
|
203 * C++ default constructor. |
|
204 */ |
|
205 CMmsMMBoxMessageHeaders(); |
|
206 |
|
207 /** |
|
208 * By default Symbian OS constructor is private. |
|
209 */ |
|
210 void ConstructL(); |
|
211 |
|
212 /** |
|
213 * Delete old data before internalizing |
|
214 */ |
|
215 void Reset(); |
|
216 |
|
217 public: // Data |
|
218 |
|
219 protected: // Data |
|
220 |
|
221 private: // Data |
|
222 // MMBox store request |
|
223 TInt32 iMmsStore; // Yes/No |
|
224 // Message state in MMBox |
|
225 TInt32 iMmsMMState; // Draft/Sent/New/Retrieved/Forwarded |
|
226 // Message stored flag |
|
227 TInt32 iMmsStored; // Yes/No |
|
228 // MMBox store status |
|
229 TInt32 iMmsStoreStatus; // error code |
|
230 // Operator response text in case of error |
|
231 HBufC* iMmsStoreStatusText; |
|
232 // Content location array to support PDUs that contain more than one |
|
233 // content location header |
|
234 CDesC8Array* iContentLocationArray; |
|
235 // MMS flags array, no ordering |
|
236 // collection keywords with add/remove/filter status |
|
237 RPointerArray<CMmsMMBoxFlags> iKeywordArray; |
|
238 |
|
239 public: // Friend classes |
|
240 protected: // Friend classes |
|
241 private: // Friend classes |
|
242 |
|
243 }; |
|
244 |
|
245 #include "mmsmmboxmessageheaders.inl" |
|
246 |
|
247 #endif // MMSMMBOXMESSAGEHEADERS_H |
|
248 |
|
249 // End of File |