|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * CUniSmilList, List of Smil attachments. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __UNISMILLIST_H |
|
22 #define __UNISMILLIST_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <e32std.h> |
|
27 #include <f32file.h> |
|
28 #include <apmstd.h> |
|
29 #include <cmsvattachment.h> |
|
30 |
|
31 #include <gmxmlcomposer.h> |
|
32 |
|
33 #include <UniModelConst.h> |
|
34 |
|
35 // CONSTANTS |
|
36 |
|
37 // MACROS |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class CUniDataUtils; |
|
41 class CBaseMtm; |
|
42 class CMDXMLDocument; |
|
43 class CMDXMLNode; |
|
44 class CMsvStore; |
|
45 class MMsvAttachmentManager; |
|
46 |
|
47 // DATA TYPES |
|
48 |
|
49 // FUNCTION PROTOTYPES |
|
50 |
|
51 // CLASS DECLARATION |
|
52 |
|
53 /** |
|
54 * MUniSmilComposeObserver - Callback API for SMIL composing. |
|
55 * |
|
56 * @since 3.1 |
|
57 */ |
|
58 class MUniSmilComposeObserver |
|
59 { |
|
60 public: |
|
61 virtual void SmilComposeEvent( TInt aError ) = 0; |
|
62 }; |
|
63 |
|
64 /** |
|
65 * CUniSmilList - List of SMIL attachments of a message. |
|
66 * |
|
67 * @lib UniDataModel.lib |
|
68 * @since 3.1 |
|
69 */ |
|
70 class CUniSmilList : public CActive, |
|
71 public MMDXMLComposerObserver |
|
72 { |
|
73 |
|
74 public: // New methods |
|
75 |
|
76 /** |
|
77 * Factory method that creates this object. |
|
78 * |
|
79 * @param aMtm IN reference to client mtm |
|
80 * @return Pointer to instance |
|
81 */ |
|
82 IMPORT_C static CUniSmilList* NewL( CBaseMtm& aMtm ); |
|
83 |
|
84 /** |
|
85 * Destructor |
|
86 * |
|
87 */ |
|
88 virtual ~CUniSmilList(); |
|
89 |
|
90 /** |
|
91 * AddSmilAttachmentL |
|
92 * Adds SMIL attachment to smil array |
|
93 * |
|
94 * @since 3.1 |
|
95 * @param aAttachmentId IN id of the SMIL attachment |
|
96 * to be added |
|
97 */ |
|
98 IMPORT_C void AddSmilAttachmentL( |
|
99 MMsvAttachmentManager& aManager, |
|
100 TMsvAttachmentId aAttachmentId ); |
|
101 |
|
102 /** |
|
103 * CreateSmilAttachmentL |
|
104 * Creates SMIL attachment from DOM |
|
105 * |
|
106 * @param aAttachmentId OUT id of the created SMIL attachment |
|
107 * @param aDom IN the DOM from which to create the SMIL |
|
108 * @param aFs IN reference to file session |
|
109 */ |
|
110 IMPORT_C void CreateSmilAttachmentL( |
|
111 MUniSmilComposeObserver& aObserver, |
|
112 CMsvStore& aEditStore, |
|
113 CMDXMLDocument* aDom ); |
|
114 |
|
115 /** |
|
116 * GetSmilAttachmentByIndex |
|
117 * Get SMIL attachment by index |
|
118 * |
|
119 * @param aIndex IN index |
|
120 * @return Message id of the SMIL attachment |
|
121 */ |
|
122 IMPORT_C TMsvAttachmentId GetSmilAttachmentByIndex( TInt aIndex ); |
|
123 |
|
124 /** |
|
125 * GetSmilFullPathByIndexL |
|
126 * Get file handle of SMIL attachment by index |
|
127 * |
|
128 * @param aIndex IN index |
|
129 */ |
|
130 IMPORT_C RFile GetSmilFileByIndexL( TInt aIndex ); |
|
131 |
|
132 /** |
|
133 * SmilByteSize |
|
134 * Calculate size of all the SMIL attachments in bytes |
|
135 * |
|
136 * @param aFs IN reference to file session |
|
137 * @return Size in bytes |
|
138 */ |
|
139 inline TInt SmilByteSize() const; |
|
140 |
|
141 /** |
|
142 * Count |
|
143 * |
|
144 * @return Number of objects |
|
145 */ |
|
146 inline TInt Count() const; |
|
147 |
|
148 void ComposeFileCompleteL(); |
|
149 |
|
150 protected: |
|
151 |
|
152 /** |
|
153 * From CActive |
|
154 */ |
|
155 void DoCancel(); |
|
156 |
|
157 /** |
|
158 * From CActive |
|
159 */ |
|
160 void RunL(); |
|
161 |
|
162 /** |
|
163 * From CActive |
|
164 */ |
|
165 TInt RunError( TInt aError ); |
|
166 |
|
167 |
|
168 protected: |
|
169 |
|
170 /** |
|
171 * Constructor. |
|
172 * |
|
173 * @param aMtm IN reference to client mtm |
|
174 */ |
|
175 CUniSmilList( CBaseMtm& aMtm ); |
|
176 |
|
177 /** |
|
178 * 2nd phase constructor. |
|
179 */ |
|
180 void ConstructL(); |
|
181 |
|
182 protected: // data |
|
183 |
|
184 CBaseMtm& iMtm; |
|
185 |
|
186 CArrayFixFlat<TMsvAttachmentId>* iSmilAttachmentArray; |
|
187 TInt iSmilSize; |
|
188 |
|
189 MMsvAttachmentManager* iManager; |
|
190 CMsvAttachment* iAttachment; |
|
191 CMsvStore* iEditStore; |
|
192 RFile* iEditFile; |
|
193 |
|
194 CMDXMLDocument* iDom; |
|
195 CMDXMLComposer* iComposer; |
|
196 MUniSmilComposeObserver* iObserver; |
|
197 CActiveSchedulerWait iObjWait; |
|
198 }; |
|
199 |
|
200 #include <UniSmilList.inl> |
|
201 |
|
202 #endif // __UNISMILLIST_H |