|
1 /* |
|
2 * Copyright (c) 2005-2007 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: |
|
15 * State machine for message sending |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MMSSENDOPERATION_H |
|
22 #define MMSSENDOPERATION_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <badesca.h> |
|
26 |
|
27 #include "mmsbaseoperation.h" |
|
28 |
|
29 // CONSTANTS |
|
30 // MACROS |
|
31 // DATA TYPES |
|
32 // FUNCTION PROTOTYPES |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CMmsHeaders; |
|
36 class CMmsEncode; |
|
37 class CMmsDecode; |
|
38 class CLogClient; |
|
39 class CLogViewEvent; |
|
40 class CLogEvent; |
|
41 class CMmsLog; |
|
42 class MMmsCodecDataSupplier; |
|
43 |
|
44 // CLASS DECLARATION |
|
45 |
|
46 /** |
|
47 * State machine for message sending |
|
48 */ |
|
49 class CMmsSendOperation :public CMmsBaseOperation |
|
50 { |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * C++ default constructor is private. |
|
55 */ |
|
56 |
|
57 /** |
|
58 * Two-phased constructor. |
|
59 * @param aFs file system session |
|
60 */ |
|
61 static CMmsSendOperation* NewL( RFs& aFs, CMmsSettings* aMmsSettings ); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 virtual ~CMmsSendOperation(); |
|
67 |
|
68 public: // New functions |
|
69 |
|
70 /** |
|
71 * Start the state machine. |
|
72 * @param aSelection list of message ids to be sent |
|
73 * @param aServerEntry CMsvServerEntry pointer from CMmsServer |
|
74 * @param aService current MMS service id |
|
75 * @param aStatus TRequestStatus of the calling active object |
|
76 */ |
|
77 void StartL( |
|
78 CMsvEntrySelection& aSelection, |
|
79 CMsvServerEntry& aServerEntry, |
|
80 TMsvId aService, |
|
81 TRequestStatus& aStatus ); |
|
82 |
|
83 /** |
|
84 * Get list of successfully sent messages |
|
85 */ |
|
86 inline CMsvEntrySelection& Sent() const; |
|
87 |
|
88 /** |
|
89 * Get list of failed messages |
|
90 */ |
|
91 inline CMsvEntrySelection& Failed() const; |
|
92 |
|
93 public: // Functions from base classes |
|
94 |
|
95 protected: // New functions |
|
96 |
|
97 protected: // Functions from base classes |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * Default constructor |
|
103 */ |
|
104 CMmsSendOperation( RFs& aFs ); |
|
105 |
|
106 /** |
|
107 * By default Symbian OS constructor is private. |
|
108 */ |
|
109 void ConstructL( CMmsSettings* aMmsSettings ); |
|
110 |
|
111 // We don't need to prohibit copy & assignment constructors here, |
|
112 // as they are in CBase already |
|
113 |
|
114 /** |
|
115 * Encode one message |
|
116 */ |
|
117 void EncodePDUL(); |
|
118 |
|
119 /** |
|
120 * Send one message to MMSC |
|
121 */ |
|
122 void SubmitTransactionL(); |
|
123 |
|
124 /** |
|
125 * Check response to send request (extract message id) |
|
126 */ |
|
127 void StoreResponseL(); |
|
128 |
|
129 /** |
|
130 * Log the send attempt, if we got so far that we really tried |
|
131 * to send something. |
|
132 */ |
|
133 void LogL(); |
|
134 |
|
135 /** |
|
136 * Move message from Outbox to Sent folder, |
|
137 * or move it to message heaven (delete it completely) |
|
138 * Depends on settings. |
|
139 */ |
|
140 void MoveEntryL(); |
|
141 |
|
142 public: // Data |
|
143 |
|
144 protected: // Data |
|
145 |
|
146 private: // Data |
|
147 |
|
148 TParse iParse; // For file name parsing |
|
149 CMmsHeaders* iMmsHeaders; |
|
150 CMsvEntrySelection* iSent; // successfully sent messages |
|
151 RFs iShareProtectedFileSession; |
|
152 TBool iShareProtectedFileSessionOpened; |
|
153 // data supplier for chunked encoding |
|
154 MMmsCodecDataSupplier* iDataSupplier; |
|
155 |
|
156 public: // Friend classes |
|
157 protected: // Friend classes |
|
158 private: // Friend classes |
|
159 }; |
|
160 |
|
161 #include "mmssendoperation.inl" |
|
162 |
|
163 #endif // MMSSENDOPERATION_H |
|
164 |
|
165 // End of File |