|
1 /* |
|
2 * Copyright (c) 2004 - 2005 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: State machine for mmbox list |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MMSMMBOXLIST_H |
|
22 #define MMSMMBOXLIST_H |
|
23 |
|
24 // INCLUDES |
|
25 #include "mmsbaseoperation.h" |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // DATA TYPES |
|
32 |
|
33 // FUNCTION PROTOTYPES |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * State machine for mmbox list |
|
42 * |
|
43 * @lib mmssrv.lib |
|
44 * @since 2.8 |
|
45 */ |
|
46 class CMmsMmboxList : public CMmsBaseOperation |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 static CMmsMmboxList* NewL( RFs& aFs, CMmsSettings* aMmsSettings ); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 virtual ~CMmsMmboxList(); |
|
59 |
|
60 public: // New functions |
|
61 |
|
62 |
|
63 |
|
64 public: // Functions from base classes |
|
65 |
|
66 /** |
|
67 * Start the state machine. |
|
68 * @param aSelection list of message entry ids to be handled. |
|
69 * @param aServerEntry CMsvServerEntry pointer from CMmsServer |
|
70 * @param aSettings MMSC settings (entry points) |
|
71 * @param aService current MMS service id |
|
72 * @param aStatus TRequestStatus of the calling active object |
|
73 */ |
|
74 void StartL( |
|
75 CMsvEntrySelection& aSelection, |
|
76 CMsvServerEntry& aServerEntry, |
|
77 TMsvId aService, |
|
78 TRequestStatus& aStatus ); |
|
79 |
|
80 |
|
81 |
|
82 protected: // New functions |
|
83 |
|
84 |
|
85 protected: // Functions from base classes |
|
86 |
|
87 /** |
|
88 * From CMsgActive: Active object cancellation |
|
89 */ |
|
90 void DoCancel(); |
|
91 |
|
92 private: // New functions |
|
93 |
|
94 /** |
|
95 * Default constructor |
|
96 */ |
|
97 CMmsMmboxList( RFs& aFs ); |
|
98 |
|
99 /** |
|
100 * Set flags for a new entry |
|
101 */ |
|
102 void SetFirstFlagsToNewEntry( TMsvEntry& aEntry ); |
|
103 |
|
104 /** |
|
105 * Set flags for an entry being finalized |
|
106 */ |
|
107 void SetFlagsToEntryBeingFinalized( TMsvEntry& aEntry ); |
|
108 |
|
109 /** |
|
110 * Remove old notifications from mmbox folder |
|
111 */ |
|
112 TInt RemoveOldNotifications(); |
|
113 |
|
114 /** |
|
115 * New notifications become visible |
|
116 */ |
|
117 |
|
118 TInt MakeNewNotificationsVisible(); |
|
119 |
|
120 /** |
|
121 * Store content subject, sender etc. to notification entry |
|
122 */ |
|
123 TInt StoreContentToNotificationEntryL( TMsvEntry aEntry ); |
|
124 |
|
125 /** |
|
126 * Get old quota entry id |
|
127 */ |
|
128 TMsvId OldQuotaEntryL(); |
|
129 |
|
130 /** |
|
131 * The server time of the mmbox notification. |
|
132 */ |
|
133 TTime ServerDate(); |
|
134 |
|
135 /** |
|
136 * Local mode fetch |
|
137 */ |
|
138 void LocalModeFetchL(); |
|
139 |
|
140 |
|
141 private: |
|
142 |
|
143 void ConstructL( CMmsSettings* aMmsSettings ); |
|
144 |
|
145 /** |
|
146 * Functions from CMmsBaseOperation |
|
147 */ |
|
148 |
|
149 /** |
|
150 * Encode the m-mbox-view.req PDU to be sent to MMSC. |
|
151 */ |
|
152 void EncodePDUL(); |
|
153 |
|
154 /** |
|
155 * Submit a POST transaction. |
|
156 */ |
|
157 void SubmitTransactionL(); |
|
158 |
|
159 |
|
160 /** |
|
161 * Create new entry to receive data from MMSC. |
|
162 */ |
|
163 void CreateEntryL(); |
|
164 |
|
165 /** |
|
166 * Decode response m-mbox-view.conf and many |
|
167 * m-mbox-desc PDU from MMSC. |
|
168 */ |
|
169 void DecodeResponseL(); |
|
170 |
|
171 /** |
|
172 * Move trigger entry after handling. |
|
173 * Remove old notifications from mmbox folder. |
|
174 * New notifications become visible in mmbox folder. |
|
175 * Remove old quota entry. Finalize new quota entry. |
|
176 */ |
|
177 void MoveEntryL(); |
|
178 |
|
179 /** |
|
180 * Disconnect and do any other finalizing steps. |
|
181 */ |
|
182 void FinalizeL(); |
|
183 |
|
184 |
|
185 public: // Data |
|
186 protected: // Data |
|
187 private: // Data |
|
188 |
|
189 CMmsHeaders* iMmsHeaders; // mms headers |
|
190 TMsvId iEntryUnderConstruction; // when list is updated the new quota info will be in this entry. |
|
191 |
|
192 CMsvEntrySelection* iOldNotifications; // notifications in mmbox folder, when updating begins |
|
193 TMsvId iMmboxFolder; // mmbox folder entry |
|
194 TMsvId iOldQuotaEntryId; // old quota entry |
|
195 public: // Friend classes |
|
196 protected: // Friend classes |
|
197 private: // Friend classes |
|
198 |
|
199 }; |
|
200 |
|
201 #endif // MMSMMBOXLIST |
|
202 |
|
203 // End of File |