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 * CUniSmilSlide |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __UNISMILSLIDE_H |
|
22 #define __UNISMILSLIDE_H |
|
23 |
|
24 |
|
25 // INCLUDES |
|
26 |
|
27 #include <MsgMedia.hrh> |
|
28 |
|
29 #include <UniModelConst.h> |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 // MACROS |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class CUniObject; |
|
37 |
|
38 // DATA TYPES |
|
39 typedef CArrayPtrFlat<CUniObject> CSmilObjectArray; |
|
40 |
|
41 // FUNCTION PROTOTYPES |
|
42 |
|
43 |
|
44 |
|
45 // CLASS DECLARATION |
|
46 |
|
47 // NOTE: Since slide cannot have same object type twice unique key to object within |
|
48 // slide is it object type ( EImage, EText, EAudio ) |
|
49 // Object can also be referenced by it's position in slide ( 0,1,2 ) |
|
50 |
|
51 /** |
|
52 * CUniSmilSlide - Representation of a single slide in a SMIL presentation. |
|
53 * |
|
54 * @lib UniDataModel.lib |
|
55 * @since 3.1 |
|
56 */ |
|
57 class CUniSmilSlide :public CBase |
|
58 { |
|
59 public: // Constructors and destructor |
|
60 |
|
61 /** |
|
62 * Factory method |
|
63 * |
|
64 * @since 3.1 |
|
65 * @return Pointer to instance in cleanup stack |
|
66 */ |
|
67 static CUniSmilSlide* NewLC( TUniLayout aLayout ); |
|
68 |
|
69 /** |
|
70 * Factory method |
|
71 * |
|
72 * @since 3.1 |
|
73 * @return Pointer to instance |
|
74 */ |
|
75 static CUniSmilSlide* NewL( TUniLayout aLayout ); |
|
76 |
|
77 /** |
|
78 * Destructor. |
|
79 * |
|
80 * @since 3.1 |
|
81 */ |
|
82 ~CUniSmilSlide(); |
|
83 |
|
84 public: // New functions |
|
85 |
|
86 /* |
|
87 * AddObjectL |
|
88 * Add object to slide in position specified by Layout. |
|
89 * NOTE: Takes ownership of the aObject. |
|
90 * NOTE: Leaves with KErrArgument if object cannot be added to slide |
|
91 * |
|
92 * @since 3.1 |
|
93 * @param aObject IN object to be added |
|
94 */ |
|
95 void AddObjectL( CUniObject* aObject ); |
|
96 |
|
97 /* |
|
98 * AddObjectL |
|
99 * Add object to slide in position specified by Layout. |
|
100 * NOTE: Takes ownership of the aObject. |
|
101 * NOTE: Leaves with KErrArgument if object cannot be added to slide |
|
102 * |
|
103 * @since 3.1 |
|
104 * @param aObject IN object to be added |
|
105 * @param aregion IN region where object is in SMIL. |
|
106 */ |
|
107 void AddObjectL( CUniObject* aObject, TUniRegion aRegion ); |
|
108 |
|
109 /** |
|
110 * RemoveObject |
|
111 * Removes object from slide |
|
112 * NOTE: Object is not deleted. |
|
113 * |
|
114 * @since 3.1 |
|
115 * @param aObject IN object to be removed |
|
116 */ |
|
117 void RemoveObject( CUniObject* aObject ); |
|
118 |
|
119 /** |
|
120 * GetObject |
|
121 * Get object of given type from slide. |
|
122 * |
|
123 * @since 3.1 |
|
124 * @param aObjType IN object type |
|
125 * @return Pointer to object, |
|
126 * NULL, if object not found |
|
127 */ |
|
128 CUniObject* GetObject( TUniRegion aRegion ) const; |
|
129 |
|
130 /** |
|
131 * GetObjectByIndex |
|
132 * Get object at given index from slide. |
|
133 * |
|
134 * @since 3.1 |
|
135 * @param aObjNum IN index to slides object array, |
|
136 * 0 (zero) is first object. |
|
137 * @return Pointer to object, |
|
138 * NULL, if object not found |
|
139 */ |
|
140 CUniObject* GetObjectByIndex( TInt aObjNum ) const; |
|
141 |
|
142 /** |
|
143 * IsObject |
|
144 * Checks if slide contains given object. |
|
145 * |
|
146 * @since 3.1 |
|
147 * @param aObject IN object to be checked |
|
148 * @return ETrue slide contains the object, |
|
149 * EFalse, otherwise |
|
150 */ |
|
151 TBool IsObject( CUniObject* aObject ) const; |
|
152 |
|
153 /** |
|
154 * IsObject |
|
155 * Checks if slide has an object of given type |
|
156 * |
|
157 * @since 3.1 |
|
158 * @param aObjType IN object type |
|
159 * @return ETrue slide contains the object, |
|
160 * EFalse, otherwise |
|
161 */ |
|
162 TBool IsObject( TUniRegion aRegion ) const; |
|
163 |
|
164 /** |
|
165 * ObjectCount |
|
166 * Accessor |
|
167 * |
|
168 * @since 3.1 |
|
169 * @return Number of objects in this slide |
|
170 */ |
|
171 TInt ObjectCount() const; |
|
172 |
|
173 /** |
|
174 * UpdateLayoutL |
|
175 * Update the layout of the slide |
|
176 * |
|
177 * @since 3.1 |
|
178 * @param aNewLayout IN new layout |
|
179 */ |
|
180 void UpdateLayoutL( TUniLayout aNewLayout ); |
|
181 |
|
182 private: |
|
183 |
|
184 /* |
|
185 * Constructor |
|
186 * |
|
187 * @since 3.1 |
|
188 */ |
|
189 CUniSmilSlide( TUniLayout aLayout ); |
|
190 |
|
191 /* |
|
192 * 2nd phase constructor |
|
193 * |
|
194 * @since 3.1 |
|
195 */ |
|
196 void ConstructL(); |
|
197 |
|
198 /** |
|
199 * UpdateLayoutL |
|
200 * Update the layout of the slide |
|
201 * |
|
202 * @since 3.1 |
|
203 */ |
|
204 void UpdateLayoutL(); |
|
205 |
|
206 private: |
|
207 |
|
208 CSmilObjectArray* iObjectArray; |
|
209 TUniLayout iLayout; |
|
210 |
|
211 }; |
|
212 |
|
213 #endif // __UNISMILSLIDE_H |
|
214 |
|
215 |
|
216 |
|
217 |
|