|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Provides MMS direct upload service. |
|
15 * Creates and sends as many MMS messages as there are files |
|
16 * to be send. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef CMMSDIRECTUPLOAD_H |
|
23 #define CMMSDIRECTUPLOAD_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <CSendingService.h> |
|
27 #include <ConeResLoader.h> |
|
28 |
|
29 #include <centralrepository.h> |
|
30 #include <MessagingInternalCRKeys.h> |
|
31 #include <MmsEngineInternalCRKeys.h> |
|
32 |
|
33 // DATA TYPES |
|
34 enum TCompressionResult |
|
35 { |
|
36 ECompressionOk = 0, |
|
37 ECompressionNok, |
|
38 EIndexLast |
|
39 }; |
|
40 |
|
41 // FORWARD DECLARATIONS |
|
42 class CCoeEnv; |
|
43 class CSendingServiceInfo; |
|
44 class CMessageData; |
|
45 class CSendUiAttachment; |
|
46 class CSendUiSingleton; |
|
47 |
|
48 // CLASS DECLARATION |
|
49 |
|
50 /** |
|
51 * CMmsDirectUpload provides MMS direct upload service. |
|
52 * Creates and sends as many MMS messages as there are files to be send. |
|
53 * |
|
54 * @lib CMmsDirectUpload.dll |
|
55 * @since Series 60 2.8 |
|
56 */ |
|
57 class CMmsDirectUpload : public CSendingService |
|
58 { |
|
59 public: // Constructors and destructor |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 */ |
|
64 static CMmsDirectUpload* NewL( TSendingServiceParams* aParams ); |
|
65 |
|
66 /** |
|
67 * Destructor. |
|
68 */ |
|
69 virtual ~CMmsDirectUpload(); |
|
70 |
|
71 public: // Functions from base classes |
|
72 |
|
73 /** |
|
74 * From CSendingService |
|
75 * Populates given list with the provided services. |
|
76 * @since Series 60 2.8 |
|
77 * @param aList Service list to be populated. |
|
78 * @return None |
|
79 */ |
|
80 void PopulateServicesListL( |
|
81 RPointerArray<CSendingServiceInfo>& aList ); |
|
82 |
|
83 /** |
|
84 * From CSendingService |
|
85 * Creates to outbox as many MMS messages as there are files to be send. |
|
86 * @since Series 60 2.8 |
|
87 * @param aServiceUid Uid of the sending service. |
|
88 * @param aMessageData Data for the message. |
|
89 * @return none |
|
90 */ |
|
91 void CreateAndSendMessageL( |
|
92 TUid aServiceUid, |
|
93 const CMessageData* aMessageData, |
|
94 TBool aLaunchEditorEmbedded = ETrue ); |
|
95 |
|
96 /** |
|
97 * From CSendingService |
|
98 * Returns the id of the service provider. |
|
99 * @since Series 60 2.8 |
|
100 * @return Id of the service provider. |
|
101 */ |
|
102 TUid ServiceProviderId() const; |
|
103 |
|
104 /** |
|
105 * Return technology type of a given service |
|
106 * |
|
107 * @since Series 60 v3.1 |
|
108 * @return TUid Technology type id |
|
109 */ |
|
110 TUid TechnologyTypeId( ) const; |
|
111 |
|
112 private: // Constructors |
|
113 |
|
114 /** |
|
115 * C++ default constructor. |
|
116 */ |
|
117 CMmsDirectUpload( CCoeEnv& aCoeEnv, CSendUiSingleton& aSingleton ); |
|
118 |
|
119 /** |
|
120 * By default Symbian 2nd phase constructor is private. |
|
121 */ |
|
122 void ConstructL( ); |
|
123 |
|
124 private: // New functions |
|
125 |
|
126 /** |
|
127 * Reads service data from resources and from shared data or from |
|
128 * central repository. |
|
129 * @since Series 60 2.8 |
|
130 * @return None. |
|
131 */ |
|
132 void ReadServiceDataL(); |
|
133 |
|
134 /** |
|
135 * Validates attachments for sending. |
|
136 * DRM protection and MMS validity are checked. |
|
137 * DRM query and error note is shown if needed. |
|
138 * Return value of attachment arrays contains valid attachments. |
|
139 * @since Series 60 3.0 |
|
140 * @param aMessageData Message data package containing original |
|
141 * attachments. |
|
142 * @param aValidAttachmentPaths Return value contains valid |
|
143 * attachment paths. |
|
144 * @param aValidAttachmentHandles Return value contains valid |
|
145 * attachment handles. |
|
146 * @return EFalse, if user cancels sending, otherwise ETrue. |
|
147 */ |
|
148 TBool ValidateAttachmentsL( CArrayPtrFlat<CSendUiAttachment>* aAttachments ); |
|
149 |
|
150 /** |
|
151 * Shows confirmation query about sending of files in separate messages |
|
152 * to user. |
|
153 * @since Series 60 2.8 |
|
154 * @param aQueryId Resource ID for the query type. |
|
155 * @param aQueryTextId Resource ID for the query text. |
|
156 * @param aQueryValue Value to be added to query text. |
|
157 * @return The return value returned by CAknQueryDialog::ExecuteLD. |
|
158 */ |
|
159 TBool ShowConfirmationQueryL( |
|
160 const TUint& aQueryId, |
|
161 const TUint& aQueryTextId, |
|
162 TInt aQueryValue = 0 ) const; |
|
163 |
|
164 void ErrorHandlerL( TInt aErr, TInt aFileCount ) const; |
|
165 |
|
166 /** |
|
167 * Show confirmation query to the user if images have been compressed. |
|
168 * @since Series 60 2.8 |
|
169 * @param aFileCount Total amount of files to be send. |
|
170 * @param |
|
171 * @param |
|
172 * @return None. |
|
173 */ |
|
174 void ResolveCompressionQueryL( |
|
175 TInt aFileCount, |
|
176 TInt aCompressionNok ) const; |
|
177 |
|
178 /** |
|
179 * Show error note to the user. |
|
180 * @since Series 60 2.8 |
|
181 * @param aResourceId Id of the resource for the error note text. |
|
182 * @return None. |
|
183 */ |
|
184 void ShowErrorNoteL( TInt aResourceId ) const; |
|
185 |
|
186 |
|
187 private: // Data |
|
188 |
|
189 |
|
190 // For UI resource loading |
|
191 RConeResourceLoader iResourceLoader; |
|
192 |
|
193 |
|
194 // Contains pointers to the data of the services provided by this plugin. |
|
195 // Pointed service data objects are owned. |
|
196 RPointerArray<CSendingServiceInfo> iServiceArray; |
|
197 |
|
198 // Maximum message size. (Same as maximum size for original MMS message) |
|
199 TInt iMaxMsgSize; |
|
200 |
|
201 }; |
|
202 |
|
203 #endif // CMMSDIRECTUPLOAD_H |
|
204 |
|
205 // End of File |