svgtopt/SVG/SVGImpl/inc/SVGMediaElementBase.h
changeset 46 88edb906c587
equal deleted inserted replaced
-1:000000000000 46:88edb906c587
       
     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:  SVGT Media Elements common implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CSVGMEDIAELEMENTBASE_H
       
    21 #define CSVGMEDIAELEMENTBASE_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32std.h>
       
    25 #include <e32def.h>
       
    26 #include "SVGAnimationBase.h"
       
    27 #include "SVGTimedEntityInterface.h"
       
    28 
       
    29 // CONSTANTS
       
    30 //const ?type ?constant_var = ?constant;
       
    31 
       
    32 // MACROS
       
    33 //#define ?macro ?macro_def
       
    34 
       
    35 // DATA TYPES
       
    36 //enum ?declaration
       
    37 //typedef ?declaration
       
    38 //extern ?data_type;
       
    39 
       
    40 // FUNCTION PROTOTYPES
       
    41 //?type ?function_name(?arg_list);
       
    42 
       
    43 // FORWARD DECLARATIONS
       
    44 //class ?FORWARD_CLASSNAME;
       
    45 
       
    46 // CLASS DECLARATION
       
    47 
       
    48 /**
       
    49 *  Base class for media elements.
       
    50 *  The base class providing the run time synchronization property handling 
       
    51 *  functionality. The media elements like audio, video, animation derive 
       
    52 *  from this class.
       
    53 *
       
    54 *  @lib SVGTEngine.lib
       
    55 *  @since S60 3.2
       
    56 */
       
    57 NONSHARABLE_CLASS( CSvgMediaElementBase ) : 
       
    58     public CSvgAnimationBase,
       
    59     public MSvgTimedEntityInterface
       
    60     {
       
    61     public:  // Constructors and destructor
       
    62         
       
    63         /**
       
    64         * Destructor.
       
    65         */
       
    66         virtual ~CSvgMediaElementBase();
       
    67 
       
    68     public: // New functions
       
    69 
       
    70         /**
       
    71         * Set the Synchronised behaviour for the media element
       
    72         * @since S60 3.2
       
    73         * @param aValue "canSlip" | "locked" | "independent" | "default"
       
    74         * @return none.
       
    75         */
       
    76         virtual void SetSyncBehavior( const TDesC& aValue );
       
    77         
       
    78         /**
       
    79         * Set the Synchronised Tolerance for the media element
       
    80         * @since S60 3.2
       
    81         * @param aValue Clock-value | "default"
       
    82         * @return none.
       
    83         */        
       
    84         virtual void SetSyncTolerance( const TDesC& aValue );
       
    85         
       
    86         /**
       
    87         * Set the media element as Synchronised Master
       
    88         * @since S60 3.2
       
    89         * @param aValue "true" | "false"
       
    90         * @return none.
       
    91         */        
       
    92         virtual void SetSyncMaster( const TDesC& aValue );
       
    93 
       
    94         /**
       
    95         * Set the Synchronised behaviour for the media element
       
    96         * @since S60 3.2
       
    97         * @param aValue canSlip | locked | independent | default
       
    98         * @return none.
       
    99         */
       
   100         virtual void SetSyncBehavior( 
       
   101             const TSvgSyncBehaviour aValue );
       
   102         
       
   103         /**
       
   104         * Set the Synchronised Tolerance for the media element
       
   105         * @since S60 3.2
       
   106         * @param aValue Clock-value 
       
   107         *        aUseDefault True/False indicates use default from 
       
   108         *                    parent svg element.
       
   109         * @return none.
       
   110         */        
       
   111         virtual void SetSyncTolerance( const TInt32 aValue ,
       
   112              const TBool aUseDefault);
       
   113         
       
   114         /**
       
   115         * Set the media element as Synchronised Master
       
   116         * @since S60 3.2
       
   117         * @param aValue true | false
       
   118         * @return none.
       
   119         */        
       
   120         virtual void SetSyncMaster( const TBool aValue );
       
   121 
       
   122         /**
       
   123         * Accessor for the Synchronised behaviour for the media element
       
   124         * @since S60 3.2
       
   125         * @param none. 
       
   126         * @return TSvgSyncBehavior "canSlip" | "locked" | "independent" | "default"
       
   127         */
       
   128         virtual TSvgSyncBehaviour SyncBehavior();
       
   129         
       
   130         /**
       
   131         * Accessor for the Synchronised Tolerance for the media element
       
   132         * @since S60 3.2
       
   133         * @param none.
       
   134         * @return Clock-value.
       
   135         */        
       
   136         virtual TInt32 SyncTolerance();
       
   137         
       
   138         /**
       
   139         * Accessor for the media element is a Synchronised Master
       
   140         * @since S60 3.2
       
   141         * @param none.
       
   142         * @return TBool "true" | "false"
       
   143         */        
       
   144         virtual TBool SyncMaster();
       
   145         
       
   146         /**
       
   147         * ?member_description.
       
   148         * @since Series ?XX ?SeriesXX_version
       
   149         * @param ?arg1 ?description
       
   150         * @return ?description
       
   151         */
       
   152         //?type ?member_function( ?type ?arg1 );
       
   153 
       
   154     public: // Functions from base classes
       
   155 
       
   156         /**
       
   157         * From CSvgAnimationBase Called by Contenthandler/decoder to set 
       
   158         * attributes
       
   159         * @since S60 3.2
       
   160         * @param aName Name of attribute
       
   161         * @param aValue Value of attribute
       
   162         * @return TInt Error Code
       
   163         */
       
   164         TInt SetAttributeL( const TDesC& aName, const TDesC& aValue );
       
   165 
       
   166         
       
   167     protected:  // New functions
       
   168 
       
   169         /**
       
   170         * C++ default constructor.
       
   171         */
       
   172         CSvgMediaElementBase( CSvgDocumentImpl* aDoc );
       
   173 
       
   174         /**
       
   175         * By default Symbian 2nd phase constructor is private.
       
   176         */
       
   177         void ConstructL( const TUint8 aElemID );
       
   178         
       
   179         /**
       
   180         * ?member_description.
       
   181         * @since Series ?XX ?SeriesXX_version
       
   182         * @param ?arg1 ?description
       
   183         * @return ?description
       
   184         */
       
   185         //?type ?member_function( ?type ?arg1 );
       
   186 
       
   187     protected:  // Functions from base classes
       
   188         /**
       
   189         * From MSvgTimedEntityInterface
       
   190         * The parent time container provides the timing clock to 
       
   191         * the timed entity (audio, video, animation, document) 
       
   192         * using this routine.
       
   193         * @since Series 3.2
       
   194         * @param aTick Current tick information 
       
   195         * @return none.
       
   196         */
       
   197         void ParentTimeContainerTick( TSvgTick aTick );
       
   198 
       
   199 
       
   200     public:
       
   201 
       
   202         /**
       
   203         * From MSvgTimedEntityInterface
       
   204         * Returns the sync behavior of the entity.
       
   205         * @since Series 3.2
       
   206         * @param none. 
       
   207         * @return TSvgSyncBehaviour Element's Sync Behaviour.
       
   208         */
       
   209         TSvgSyncBehaviour GetEntitySyncBehavior();
       
   210     /**
       
   211         * From MSvgTimedEntityInterface
       
   212         * Returns the configured sync master value(as per DOM tree) as specified 
       
   213         * in the SVG content.
       
   214         * @since Series 3.2
       
   215         * @param aIsSyncMaster Indicates whether the element is configured as 
       
   216         *                      Sync Master. 
       
   217         * @return none.
       
   218         */
       
   219         void GetCnfSyncMasterStatus( TBool& aIsSyncMaster );
       
   220     /**
       
   221         * From MSvgTimedEntityInterface
       
   222         * Check if timed entity can provide timing ticks to rest of time 
       
   223         * container elements. This behavior could change dynamically. 
       
   224         * For example, if audio clip is over, the audio element can't generate 
       
   225         * ticks for others.
       
   226         * @since Series 3.2
       
   227         * @param none.
       
   228         * @return TBool True if can generate timing tick.
       
   229         */
       
   230         TBool CanGenerateTick();
       
   231         
       
   232 
       
   233     protected:
       
   234 
       
   235         /**
       
   236         * From MSvgTimedEntityInterface
       
   237         * When the timed entity acts as timing master in the time container, 
       
   238         * the time container gets the timed entity clock using this method 
       
   239         * and feeds to rest of timed entities.
       
   240         * @since Series 3.2
       
   241         * @param aEntityCurTime Current Entity Time in msecs. 
       
   242         * @return none.
       
   243         */
       
   244         void GetEntityCurrentTime( TUint32& 
       
   245             aEntityCurTime );
       
   246 
       
   247         
       
   248 
       
   249     /**
       
   250         * From MSvgTimedEntityInterface
       
   251         * Check if timed entity is going to act as timing master in the 
       
   252         * time container. This behavior could change dynamically.
       
   253         * @since Series 3.2
       
   254         * @param aIsSyncMaster Indicates whether the element is currrently Sync Master. 
       
   255         * @return none.
       
   256         */
       
   257         void GetCurSyncMasterStatus( TBool& isSyncMaster );
       
   258 
       
   259         /**
       
   260         * From MSvgTimedEntityInterface
       
   261         * If some other element is resolved as syncMaster in the time container group, 
       
   262         * this element can not act as sync master. 
       
   263         * @since Series 3.2
       
   264         * @param aSyncMasterStatus Indicates whether the element is currrently 
       
   265         *                          Sync Master. 
       
   266         * @return none.
       
   267         */
       
   268         void SetCurSyncMasterStatus( TBool aSyncMasterStatus );
       
   269 
       
   270     /**
       
   271         * From MSvgTimedEntityInterface
       
   272         * Check if timed entity can use its parent's tick. Usually only the
       
   273         * parent document should return true for this function.
       
   274         * All other elements return false
       
   275         * @since Series 3.2
       
   276         * @param none.
       
   277         * @return TBool True if can use parent's timing tick.
       
   278         */
       
   279         TBool CanUseParentTick();
       
   280         
       
   281         /**
       
   282         * From MSvgTimedEntityInterface
       
   283         * If the timed entity needs to be in sync with the time container and 
       
   284         * it has slipped beyond the sync tolerance limit, the method is called to 
       
   285         * bring the element in sync with the time container.
       
   286         * @since Series 3.2
       
   287         * @param aSynctime Time for resync in msecs.
       
   288         * @return none.
       
   289         */
       
   290         void ResyncTimedEntity( TUint32 aSynctime );
       
   291 
       
   292         /**
       
   293         * From MSvgTimedEntityInterface
       
   294         * This would be used for pausing the timed entity while other locked
       
   295         * timed entities get loaded.
       
   296         * @since S60 3.2
       
   297         * @param none.
       
   298         * @return none.
       
   299         */
       
   300         void PauseTimedEntity();
       
   301 
       
   302         /**
       
   303         * From MSvgTimedEntityInterface
       
   304         * This would be used for resuming the timed entity once all locked
       
   305         * timed entities get loaded.
       
   306         * @since S60 3.2
       
   307         * @param none.
       
   308         * @return none.
       
   309         */
       
   310         void ResumeTimedEntity();
       
   311 
       
   312         /**
       
   313         * From MSvgTimedEntityInterface
       
   314         * This would be used for stopping the timed entity.
       
   315         * @since S60 3.2
       
   316         * @param none.
       
   317         * @return none.
       
   318         */
       
   319         void StopTimedEntity();
       
   320         
       
   321 
       
   322         /*
       
   323         From MSvgTimedEntityInterface
       
   324         Would return the type of object
       
   325         @param none
       
   326         @return type of object
       
   327         */
       
   328         TSvgObjectType ObjectType();
       
   329 
       
   330         
       
   331         CSvgTimeContainer* GetChildTimeContainer();
       
   332         
       
   333         /**
       
   334         * From ?base_class ?member_description
       
   335         */
       
   336         //?type ?member_function();
       
   337 
       
   338     private:
       
   339 
       
   340 
       
   341         // Prohibit copy constructor if not deriving from CBase.
       
   342         // CSvgMediaElementBase( const CSvgMediaElementBase& );
       
   343         // Prohibit assigment operator if not deriving from CBase.
       
   344         // CSvgMediaElementBase& operator=( const CSvgMediaElementBase& );
       
   345 
       
   346     public:     // Data
       
   347         // ?one_line_short_description_of_data
       
   348         //?data_declaration;
       
   349     
       
   350     protected:  // Data
       
   351         // ?one_line_short_description_of_data
       
   352         //?data_declaration;
       
   353         // The media element's sync behavior with respect to its parent 
       
   354         // time container.
       
   355         TSvgSyncBehaviour iSyncBehavior;
       
   356         // Boolean indicating whether the media element is configured 
       
   357         // (as per DOM tree) as a Sync Master
       
   358         TBool iSyncMasterConfig;
       
   359         // Boolean indicating whether media element is currently the Sync Master 
       
   360         // in the time container
       
   361         TBool iSyncMasterCurrent;
       
   362         // Sync Tolerance configured for the media element (in msecs)
       
   363         TUint32 iSyncTolerance;
       
   364         // how much out-of-sync is this media element (in msecs) 
       
   365         TUint32 iSyncOffset;
       
   366 
       
   367 
       
   368     private:    // Data
       
   369         // ?one_line_short_description_of_data
       
   370         //?data_declaration;
       
   371          
       
   372         // Reserved pointer for future extension
       
   373         //TAny* iReserved;
       
   374     };
       
   375 
       
   376 #endif      // CSVGMEDIAELEMENTBASE_H   
       
   377             
       
   378 // End of File