|
1 /* |
|
2 * Copyright (c) 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: This is the interface that is to be implemented by |
|
15 * all media elements. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MSVGTIMEDENTITYINTERFACE_H |
|
22 #define MSVGTIMEDENTITYINTERFACE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <e32def.h> |
|
27 |
|
28 // MACROS |
|
29 //#define ?macro ?macro_def |
|
30 |
|
31 // DATA TYPES |
|
32 enum TSvgSyncBehaviour |
|
33 { |
|
34 ESvgSyncDefault = 0, |
|
35 ESvgSyncCanSlip, |
|
36 ESvgSyncLocked, |
|
37 ESvgSyncIndependent |
|
38 }; |
|
39 |
|
40 |
|
41 |
|
42 enum TSvgObjectType |
|
43 { |
|
44 ESvgInvalidReference = 0, |
|
45 ESvgAudioElement, |
|
46 ESvgMediaAnimationElement, |
|
47 ESvgDocumentElement, |
|
48 ESvgLockedRealTimeEntity |
|
49 }; |
|
50 |
|
51 |
|
52 // CONSTANTS |
|
53 //const ?type ?constant_var = ?constant; |
|
54 // Default Sync Behaviour is locked |
|
55 const TSvgSyncBehaviour KSvgDefaultSyncBehaviour = ESvgSyncLocked; |
|
56 // Default Sync Tolerance is 2 sec |
|
57 const TUint32 KSvgDefaultSyncTolerance = 2*1000; |
|
58 |
|
59 // CLASS DECLARATION |
|
60 class CSvgTimeContainer; |
|
61 /** |
|
62 * This class stores the current tick timestamp and the parent time container tick. |
|
63 * This is used to propogate the tick from sync master to the rest of the members |
|
64 * in the time container (or) if the syncmaster cannot generate a tick then the |
|
65 * real time tick is used. |
|
66 * |
|
67 * @lib SVGTEngine.lib |
|
68 * @since S60 3.2 |
|
69 */ |
|
70 class TSvgTick |
|
71 { |
|
72 public: // Data |
|
73 // Real time tick expressed in msecs from start of timer |
|
74 TUint32 iRealTimeTick; |
|
75 // Parent time container tick expressed in msecs |
|
76 TUint32 iParentTcTick; |
|
77 }; |
|
78 |
|
79 |
|
80 /** |
|
81 * Interface exported by all media elements. |
|
82 * This interface class specifies the interface for implementing |
|
83 * runtime synchronisation. This interface is inherited by |
|
84 * media elements such as audio/animation which provide element |
|
85 * specific processing. |
|
86 * Since the root SVG possesses an implicit time container the |
|
87 * document also needs to implement this interface. |
|
88 * |
|
89 * @lib SVGTEngine.lib |
|
90 * @since S60 3.2 |
|
91 */ |
|
92 class MSvgTimedEntityInterface |
|
93 { |
|
94 public: // New functions |
|
95 /** |
|
96 * The parent time container provides the timing clock to |
|
97 * the timed entity (audio, video, animation, document) |
|
98 * using this routine. |
|
99 * @since S60 3.2 |
|
100 * @param aTick Current tick information |
|
101 * @return none. |
|
102 */ |
|
103 virtual void ParentTimeContainerTick( TSvgTick aTick ) = 0; |
|
104 |
|
105 /** |
|
106 * Returns the sync behavior of the entity. |
|
107 * @since S60 3.2 |
|
108 * @param none. |
|
109 * @return TSvgSyncBehaviour Element's Sync Behaviour. |
|
110 */ |
|
111 virtual TSvgSyncBehaviour GetEntitySyncBehavior() = 0; |
|
112 |
|
113 /** |
|
114 * When the timed entity acts as timing master in the time container, |
|
115 * the time container gets the timed entity clock using this method |
|
116 * and feeds to rest of timed entities. |
|
117 * @since S60 3.2 |
|
118 * @param aEntityCurTime Current Entity Time in msecs. |
|
119 * @return none. |
|
120 */ |
|
121 virtual void GetEntityCurrentTime( TUint32& |
|
122 aEntityCurTime ) = 0; |
|
123 |
|
124 /** |
|
125 * Returns the configured sync master value(as per DOM tree) as specified |
|
126 * in the SVG content. |
|
127 * @since S60 3.2 |
|
128 * @param aIsSyncMaster Indicates whether the element is configured as |
|
129 * Sync Master. |
|
130 * @return none. |
|
131 */ |
|
132 virtual void GetCnfSyncMasterStatus( TBool& aIsSyncMaster ) = 0; |
|
133 |
|
134 /** |
|
135 * Check if timed entity is going to act as timing master in the |
|
136 * time container. This behavior could change dynamically. |
|
137 * @since S60 3.2 |
|
138 * @param aIsSyncMaster Indicates whether the element is currrently Sync Master. |
|
139 * @return none. |
|
140 */ |
|
141 virtual void GetCurSyncMasterStatus( TBool& isSyncMaster ) = 0; |
|
142 |
|
143 /** |
|
144 * If some other element is resolved as syncMaster in the time container group, |
|
145 * this element can not act as sync master. |
|
146 * @since S60 3.2 |
|
147 * @param aSyncMasterStatus Indicates whether the element is currrently |
|
148 * Sync Master. |
|
149 * @return none. |
|
150 */ |
|
151 virtual void SetCurSyncMasterStatus( TBool aSyncMasterStatus ) = 0; |
|
152 |
|
153 /** |
|
154 * Check if timed entity can provide timing ticks to rest of time |
|
155 * container elements. This behavior could change dynamically. |
|
156 * For example, if audio clip is over, the audio element can't generate |
|
157 * ticks for others. |
|
158 * @since S60 3.2 |
|
159 * @param none. |
|
160 * @return TBool True if can generate timing tick. |
|
161 */ |
|
162 virtual TBool CanGenerateTick() = 0; |
|
163 |
|
164 /** |
|
165 * Check if timed entity can use its parent's tick. Usually only the |
|
166 * parent document should return true for this function. |
|
167 * All other elements return false |
|
168 * @since S60 3.2 |
|
169 * @param none. |
|
170 * @return TBool True if can use parent's timing tick. |
|
171 */ |
|
172 virtual TBool CanUseParentTick() = 0; |
|
173 |
|
174 /** |
|
175 * If the timed entity needs to be in sync with the time container and |
|
176 * it has slipped beyond the sync tolerance limit, the method is called to |
|
177 * bring the element in sync with the time container. |
|
178 * @since S60 3.2 |
|
179 * @param aSynctime Time for resync in msecs. |
|
180 * @return none. |
|
181 */ |
|
182 virtual void ResyncTimedEntity( TUint32 aSynctime ) = 0; |
|
183 |
|
184 /** |
|
185 * This would be used for pausing the locked timed entity while other locked |
|
186 * timed entities get loaded. |
|
187 * @since S60 3.2 |
|
188 * @param none. |
|
189 * @return none. |
|
190 */ |
|
191 virtual void PauseTimedEntity() = 0; |
|
192 |
|
193 /** |
|
194 * This would be used for resuming the locked timed entity once all locked |
|
195 * timed entities get loaded. |
|
196 * @since S60 3.2 |
|
197 * @param none. |
|
198 * @return none. |
|
199 */ |
|
200 virtual void ResumeTimedEntity() = 0; |
|
201 |
|
202 /** |
|
203 * This would be used for stopping the timed entity. |
|
204 * @since S60 3.2 |
|
205 * @param none. |
|
206 * @return none. |
|
207 */ |
|
208 virtual void StopTimedEntity() = 0; |
|
209 |
|
210 |
|
211 /* Return the type of class |
|
212 @Return Type Enumeration of object type |
|
213 @Parameters none |
|
214 */ |
|
215 virtual TSvgObjectType ObjectType() = 0; |
|
216 |
|
217 |
|
218 virtual CSvgTimeContainer* GetChildTimeContainer() = 0; |
|
219 |
|
220 }; |
|
221 |
|
222 #endif // MSVGTIMEDENTITYINTERFACE_H |
|
223 |
|
224 // End of File |