messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilModel.h
changeset 25 84d9eb65b26f
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
       
     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 *       CUniSmilModel, Storage for Smil presentation data.
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef __UNISMILMODEL_H
       
    22 #define __UNISMILMODEL_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <cmsvattachment.h>
       
    26 
       
    27 #include <UniModelConst.h>
       
    28 #include <UniObjectList.h>
       
    29 #include <UniSmilUtils.h>
       
    30 
       
    31 // CONSTANTS
       
    32 
       
    33 // MACROS
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 
       
    37 class RResourceFile;
       
    38 
       
    39 class CBaseMtm;
       
    40 class CUniSmilSlide;
       
    41 class CSmilPresentation;
       
    42 class TDataType;
       
    43 class CMsvEntrySelection;
       
    44 class CUniDataUtils;
       
    45 class CUniObject;
       
    46 class CUniTextObject;
       
    47 class CEikRichTextEditor;
       
    48 
       
    49 class CMDXMLNode;
       
    50 class CMDXMLElement;
       
    51 class CUniSmilParams;
       
    52 
       
    53 // DATA TYPES
       
    54 
       
    55 typedef CArrayPtrFlat<CUniSmilSlide> CSmilSlideArray;
       
    56 
       
    57 // FUNCTION PROTOTYPES
       
    58 
       
    59 // CLASS DECLARATION
       
    60 
       
    61 /**
       
    62 * CUniSmilModel - Representation of SMIL presentation data.
       
    63 * Hides SMIL syntax from client.
       
    64 *
       
    65 * @lib UniDataModel.lib
       
    66 * @since 3.1
       
    67 */
       
    68 class CUniSmilModel : public CBase
       
    69     {
       
    70     public:  // New methods
       
    71 
       
    72         /**
       
    73         * NewLC
       
    74         * Factory method that creates this object.
       
    75         *
       
    76         * @since    3.1
       
    77         * @param    aFs     IN reference to file session
       
    78         * @param    aMtm    IN reference to client mtm
       
    79         * @param    aData   IN reference to MsgData object
       
    80         * @param    aObjectList IN reference to object list
       
    81         * @return   Pointer to instance in cleanup stack
       
    82         */
       
    83         IMPORT_C static CUniSmilModel* NewLC(
       
    84             RFs& aFs,
       
    85             CBaseMtm& aMtm,
       
    86             CUniDataUtils& aData,
       
    87             CUniObjectList& aObjectList );
       
    88 
       
    89         /**
       
    90         * NewL
       
    91         * Factory method that creates this object.
       
    92         *
       
    93         * @since    3.1
       
    94         * @param    aFs     IN reference to file session
       
    95         * @param    aMtm    IN reference to client mtm
       
    96         * @param    aData   IN reference to MsgData object
       
    97         * @param    aObjectList IN reference to object list
       
    98         * @return   Pointer to instance
       
    99         */
       
   100         IMPORT_C static CUniSmilModel* NewL(
       
   101             RFs& aFs,
       
   102             CBaseMtm& aMtm,
       
   103             CUniDataUtils& aData,
       
   104             CUniObjectList& aObjectList );
       
   105 
       
   106         /**
       
   107         * Destructor
       
   108         *
       
   109         * @since    3.1
       
   110         */
       
   111         virtual ~CUniSmilModel();
       
   112 
       
   113         /**
       
   114         * ParseL
       
   115         * Creates presentation from either from DOM (if set) or
       
   116         * from object list (no SMIL used).
       
   117         * Set various flags according to parse results.
       
   118         *
       
   119         * This function should only leave if model cannot be made
       
   120         * because some basic Symbian OS error for example OOM.
       
   121         * This never leaves if there is some kind of mitchmatch between
       
   122         * presentation and actual message ie smil refers to object
       
   123         * that does not exist. This kind of leaves are TRAPPED here
       
   124         * and if they are not the leave should be considered as an
       
   125         * implementation bug in this function.
       
   126         *
       
   127         * @since    3.1
       
   128         * @return   Parse result flags
       
   129         */
       
   130         IMPORT_C TInt ParseL( CMDXMLDocument* aDom );
       
   131 
       
   132         /**
       
   133         * SetScreenSize
       
   134         * Sets size of physical dislplay in pixels
       
   135         *
       
   136         * @since    3.1
       
   137         * @param    aScreenSize     IN screen size in pixels
       
   138         */
       
   139         inline void SetScreenSize( const TSize& aScreenSize );
       
   140 
       
   141         /*
       
   142         * AddSlideL
       
   143         * Adds slide to model. If aSlideNum is -1 or greater than
       
   144         * current max -> appends. Otherwise adds to given pos.
       
   145         * Zero means first.
       
   146         *
       
   147         * @since    3.1
       
   148         * @param    aSlideNum   IN insert position
       
   149         */
       
   150         IMPORT_C void AddSlideL( TInt aSlideNum = -1 );
       
   151 
       
   152         /**
       
   153         * RemoveSlide
       
   154         * Removes slide. Slide must be empty!
       
   155         *
       
   156         * @since    3.1
       
   157         * @param    aSlideNum   IN position of slide to be removed
       
   158         */
       
   159         IMPORT_C void RemoveSlide( TInt aSlideNum );
       
   160 
       
   161         /**
       
   162         * MoveSlideL
       
   163         * Moves slide.
       
   164         *
       
   165         * @since    3.1
       
   166         * @param    aSlideToMove IN the original position of slide to be moved
       
   167         * @param    aPlaceToMove IN place where slide is moved to
       
   168         */
       
   169         IMPORT_C void MoveSlideL( TInt aSlideToMove, TInt aPlaceToMove );
       
   170 
       
   171         /**
       
   172         * SortSlidesL
       
   173         * Sorts slides accoring to a separate comparison function
       
   174         * called SortSlidesCompare().
       
   175         * Insertion sort algorithm.
       
   176         *
       
   177         * Notice! Intended to be used with SendAs when there
       
   178         * are multiple slides - each slide containing only
       
   179         * one object. (Sorts slides accoring to first object in
       
   180         * the slide.)
       
   181         *
       
   182         * @since    3.1
       
   183         */
       
   184         IMPORT_C void SortSlidesL();
       
   185 
       
   186         /*
       
   187         * IsSlide
       
   188         * Check if model contains given slide
       
   189         *
       
   190         * @since    3.1
       
   191         * @param    aSlideNum   IN slide to check
       
   192         * @return   ETrue, if slide exists,
       
   193         *           EFalse, otherwise
       
   194         */
       
   195         IMPORT_C TBool IsSlide( TInt aSlideNum ) const;
       
   196 
       
   197         /**
       
   198         * Adds text buffer to model.
       
   199         *
       
   200         * @since    3.1
       
   201         * @param    aSlideNum   IN slide number where text is added
       
   202         * @param    aText   IN text buffer to be added
       
   203         * @return   Pointer to the added text object
       
   204         *           Ownership NOT transferred.
       
   205         */
       
   206         IMPORT_C CUniTextObject* AddTextObjectL(
       
   207             TInt aSlideNum, 
       
   208             CEikRichTextEditor* aText );
       
   209 
       
   210         /**
       
   211         * AddObjectL
       
   212         * Adds an object into msg store and smil slide
       
   213         *
       
   214         * @since    3.1
       
   215         * @param    aSlideNum   IN slide number where text is added
       
   216         * @param    aPathToObject   IN file to be added
       
   217         * @return   Pointer to the added object
       
   218         *           Ownership NOT transferred.
       
   219         */
       
   220         IMPORT_C CUniObject* AddObjectL(
       
   221             MUniObjectSaveObserver& aObserver,
       
   222             TInt aSlideNum,
       
   223             CMsgMediaInfo* aMedia );
       
   224 
       
   225         /**
       
   226         * AddStoredObjectL
       
   227         * Adds an object that is already in msg store to smil slide
       
   228         *
       
   229         * @since    3.1
       
   230         * @param    aSlideNum   IN slide number where text is added
       
   231         * @param    aAttachmentId   IN file to be added
       
   232         * @param    aMedia      IN media info - ownership transferred to MsgObject
       
   233         * @return   Pointer to the added object
       
   234         *           Ownership NOT transferred.
       
   235         */
       
   236         IMPORT_C CUniObject* AddStoredObjectL(
       
   237             TInt aSlideNum,
       
   238             TMsvAttachmentId aAttachmentId,
       
   239             CMsgMediaInfo* aMedia );
       
   240 
       
   241         /**
       
   242         * RemoveObjectL
       
   243         * Deletes an object of certain type from a slide and msg store
       
   244         * if needed (last reference to the object removed).
       
   245         *
       
   246         * @since    3.1
       
   247         * @param    aSlideNum   IN slide number where text is added
       
   248         * @param    aObject     IN the object to be removed
       
   249         * @param    aLeaveToStore IN Do not remove attachment from store
       
   250         *                            USE ONLY AS SECOND ATTEMPT IF REMOVING NORMALLY FAILS
       
   251         */
       
   252         IMPORT_C void RemoveObjectL(
       
   253             TInt aSlideNum,
       
   254             CUniObject* aObject,
       
   255             TBool aLeaveToStore = EFalse);
       
   256 
       
   257         /**
       
   258         * RemoveObjectByIndexL
       
   259         * Deletes the N'th object of from a slide and msg store if
       
   260         * needed (last reference to the object removed).
       
   261         *
       
   262         * @since    3.1
       
   263         * @param    aSlideNum   IN slide number
       
   264         * @param    aObjectNum  IN number of the object to be removed
       
   265         */
       
   266         IMPORT_C void RemoveObjectByIndexL(
       
   267             TInt aSlideNum,
       
   268             TInt aObjectNum );
       
   269 
       
   270         /**
       
   271         * GetObjectByIndex
       
   272         * Gets object by it's layout position in slide.
       
   273         * E.g. object number "0" is the first in layout.
       
   274         *
       
   275         * @since    3.1
       
   276         * @param    aSlideNum   IN slide number
       
   277         * @param    aObjectNum  IN number of the object
       
   278         * @return   Pointer to the object,
       
   279         *           NULL if not found
       
   280         */
       
   281         IMPORT_C CUniObject* GetObjectByIndex(
       
   282             TInt aSlideNum,
       
   283             TInt aObjectNum ) const;
       
   284 
       
   285         /**
       
   286         * GetObject
       
   287         * Gets object of certain type from a slide
       
   288         *
       
   289         * @since    3.1
       
   290         * @param    aSlideNum   IN slide number
       
   291         * @param    aObjectType IN type of the object
       
   292         * @return   Pointer to the object,
       
   293         *           NULL if not found
       
   294         */
       
   295         IMPORT_C CUniObject* GetObject(
       
   296             TInt aSlideNum,
       
   297             TUniRegion aRegion ) const;
       
   298 
       
   299         /**
       
   300         * IsObject
       
   301         * Checks if given slide has object of certain type.
       
   302         *
       
   303         * @since    3.1
       
   304         * @param    aSlideNum   IN slide number
       
   305         * @param    aObjectType IN type of the object
       
   306         * @param    aNum    IN the ordinal number of the object
       
   307         * @return   ETrue, slide has object of asked type,
       
   308         *           EFalse, otherwise.
       
   309         */
       
   310         //TBool IsObject(
       
   311         //    TInt aSlideNum,
       
   312         //    TMsgMediaType aObjType ) const;
       
   313 
       
   314         /**
       
   315         * SlideCount
       
   316         * Count of slides in SMIL presentation.
       
   317         *
       
   318         * @since    3.1
       
   319         * @return   Number of slides
       
   320         */
       
   321         inline TInt SlideCount() const;
       
   322 
       
   323         /**
       
   324         * ObjectCount
       
   325         * Count of media objects in SMIL presentation.
       
   326         * NOTE: Smil attachment is _not_ counted as object.
       
   327         *
       
   328         * @since    3.1
       
   329         * @return   Number of objects
       
   330         */
       
   331         IMPORT_C TInt ObjectCount() const;
       
   332 
       
   333         /**
       
   334         * SlideObjectCount
       
   335         * Count of media objects in given slide
       
   336         *
       
   337         * @since    3.1
       
   338         * @param    aSlideNum   IN slide number
       
   339         * @return   Number of objects on the slide
       
   340         */
       
   341         IMPORT_C TInt SlideObjectCount( TInt aSlideNum ) const;
       
   342 
       
   343         /**
       
   344         * Layout
       
   345         * Accessor. Queries current layout. Layout is same for all slides.
       
   346         *
       
   347         * @since    3.1
       
   348         * @return   Layout
       
   349         */
       
   350         inline TUniLayout Layout() const;
       
   351 
       
   352         /**
       
   353         * SetLayoutL
       
   354         * Mutator. All slides have same layout.
       
   355         * NOTE: This should only be called from editor objectsview
       
   356         * ChangeOrder command. Layout is automatically determined
       
   357         * at parse time.
       
   358         *
       
   359         * @since    3.1
       
   360         * @param    aLayout IN new layout to be set
       
   361         */
       
   362         IMPORT_C void SetLayoutL( TUniLayout aNewLayout ); 
       
   363 
       
   364         /**
       
   365         * Returns the (estimate) total size of SMIL.
       
   366         *
       
   367         * @since    3.1
       
   368         * @return   Total size in bytes
       
   369         */
       
   370         IMPORT_C TInt SmilComposeSize();
       
   371 
       
   372         /**
       
   373         * SmilComposeSize
       
   374         * Returns the (estimate) size of SMIL from beginning to the
       
   375         * object given as parameter.
       
   376         *
       
   377         * @since    3.1
       
   378         * @param    aToSlideNum     IN calculate till this slide
       
   379         *                              (From "1" to "SlideCount")
       
   380         * @param    aToObjectNum    IN calculate till this object
       
   381         *                              (From "1" to "SlideObjectCount")
       
   382         * @return   Size in bytes
       
   383         */
       
   384         IMPORT_C TInt SmilComposeSize(
       
   385             TInt aToSlideNum,
       
   386             TInt aToObjectNum );
       
   387 
       
   388         /**
       
   389         * RemoveEmptySlides
       
   390         * Removes empty all slides from the presentation
       
   391         *
       
   392         * @since    3.1
       
   393         */
       
   394         IMPORT_C void RemoveEmptySlides();
       
   395 
       
   396         /**
       
   397         * ComposeL
       
   398         * Composes new SMIL from current model content. SMIL is created as
       
   399         * an attachment to message.
       
   400         * Old SMIL should be deleted before calling this.
       
   401         *
       
   402         * @since    3.1
       
   403         * return    Pointer to new DOM
       
   404         */
       
   405         IMPORT_C CMDXMLDocument* ComposeL();
       
   406 
       
   407         /**
       
   408         * ChangeLayoutL
       
   409         * Changes layout of SMIL to match Series 60 created SMIL
       
   410         *
       
   411         * @since 3.1
       
   412         * @param aDom   SMIL DOM to be changed
       
   413         * @return ETrue if layout could be changed
       
   414         *         EFalse if layout couldn't be changed (e.g. missing head or root-region)
       
   415         */
       
   416         IMPORT_C TBool ChangeLayoutL( CMDXMLDocument* aDom );
       
   417         
       
   418         /**
       
   419         * CorrectTimingL
       
   420         * Correct timing of media objects on SMIL if it is invalid.
       
   421         *
       
   422         * @since  3.1
       
   423         * @param  aDom   SMIL DOM
       
   424         * @return ETrue if timing is valid.
       
   425         *         EFalse if timing couldn't be corrected (e.g. missing body)
       
   426         */
       
   427         IMPORT_C TBool CorrectTimingL( CMDXMLDocument* aDom );
       
   428         
       
   429         /**
       
   430         * Determines if given media type can be added to the SMIL model.
       
   431         *
       
   432         * @since 3.1
       
   433         * @param aMediaType Tested media type
       
   434         * @return ETrue if media type can be added to the SMIL model.
       
   435         *         EFalse if media type cannot be added
       
   436         */
       
   437         IMPORT_C TBool IsSupportedMediaType( TMsgMediaType aMediaType ) const;
       
   438         
       
   439         /**
       
   440         * Maximum number of slide in MMS message.
       
   441         *
       
   442         * @return 0 or less if not specified. Otherwise maximum slide limit.
       
   443         */
       
   444         inline TInt MaxSlideCount() const;
       
   445 
       
   446         /**
       
   447         * Sets maximum slide limit.
       
   448         *
       
   449         * @param aSlideCount Maximum slide count.
       
   450         */
       
   451         inline void SetMaxSlideCount( TInt aSlideCount );
       
   452 
       
   453         /**
       
   454         * Returns whether maximum slide count has been reached.
       
   455         *
       
   456         * @return ETrue if maximum slide count is set and has been reached.
       
   457         *         EFalse otherwise.
       
   458         */
       
   459         inline TBool MaxSlideCountReached() const;
       
   460 
       
   461     private:
       
   462 
       
   463         /**
       
   464         * Constructor.
       
   465         *
       
   466         * @since    3.1
       
   467         * @param    aFs     IN reference to file session
       
   468         * @param    aMtm    IN reference to client mtm
       
   469         * @param    aData   IN reference to MsgData object
       
   470         * @param    aObjectList IN reference to object list
       
   471         */
       
   472         CUniSmilModel(
       
   473             RFs& aFs,
       
   474             CBaseMtm& aMtm,
       
   475             CUniDataUtils& aData,
       
   476             CUniObjectList& aObjectList );
       
   477 
       
   478         /**
       
   479         * 2nd phase constructor.
       
   480         *
       
   481         * @since    3.1
       
   482         */
       
   483         void ConstructL();
       
   484 
       
   485         /**
       
   486         * DoPresentationFromDomL
       
   487         * Makes a presentation (model content) from DOM.
       
   488         *
       
   489         * @since    3.1
       
   490         * @return   ETrue, if created successfully,
       
   491         *           EFalse, otherwise
       
   492         */
       
   493         void DoPresentationFromDomL( CMDXMLDocument* aDom );
       
   494 
       
   495         /**
       
   496         * IsMessageSlide
       
   497         * Check if messages attachments fit into slide (no smil case)
       
   498         *
       
   499         * @since    3.1
       
   500         * @return   ETrue, if all objects fit into slide,
       
   501         *           EFalse, otherwise
       
   502         */
       
   503         TBool IsMessageSlide();
       
   504 
       
   505         /**
       
   506         * DoNoSmilOneSlide
       
   507         * Makes presentation (max one slide) from object list. Message
       
   508         * may contain SMIL, but when calling this function it should be
       
   509         * clear that model cannot be made as SMIL describes.
       
   510         *
       
   511         * @since    3.1
       
   512         */
       
   513         void DoNoSmilOneSlideL();
       
   514 
       
   515         /**
       
   516         * DoNoSmilManySlide
       
   517         * Makes presentation from object list. Message may contain SMIL,
       
   518         * but when calling this function it should be clear that model cannot
       
   519         * be made as SMIL describes.
       
   520         *
       
   521         * @since    3.1
       
   522         */
       
   523         void DoNoSmilManySlideL();
       
   524 
       
   525         /**
       
   526         * AddSlideFromDomL
       
   527         * Used when creating presentation from SMIL
       
   528         *
       
   529         * @since    3.1
       
   530         * @param    aSlideNum   IN slide number
       
   531         * @param    aObj    IN object to be added
       
   532         * @return   ETrue, object added successfully,
       
   533         *           EFalse, otherwise
       
   534         */
       
   535         void AddSlideFromDomL( CMDXMLNode* aPage );
       
   536 
       
   537         /**
       
   538         * AddObjectFromDomL
       
   539         * Used when creating presentation from SMIL
       
   540         *
       
   541         * @since    3.1
       
   542         * @param    aSlideNum   IN slide number
       
   543         * @param    aObj    IN object to be added
       
   544         */
       
   545         void AddObjectFromDomL(
       
   546             CUniSmilSlide* aSlide,
       
   547             CUniObject* aObj,
       
   548             TUniRegion aRegion );
       
   549 
       
   550         /**
       
   551         * Reset
       
   552         * Clears flag & empties slide & object arrays.
       
   553         * NOTE: Mtm pointer is not reseted.
       
   554         *
       
   555         * @since    3.1
       
   556         */
       
   557         void Reset();
       
   558 
       
   559         /**
       
   560         * CreateItemL
       
   561         * Sub function for ComposeL
       
   562         *
       
   563         * @since    3.1
       
   564         * @param    aRoot   IN parent element for the new element(s)
       
   565         * @param    aObj    IN object to be added
       
   566         */
       
   567         TInt CreateItemL( CMDXMLDocument* aDom, CMDXMLElement* aRoot, CUniObject* aObj );
       
   568 
       
   569         /**
       
   570         * CreateParL
       
   571         * Sub function for ComposeL
       
   572         *
       
   573         * @since    3.1
       
   574         * @param    aRoot   IN parent element for the new element(s)
       
   575         * @param    aSlide  IN slide number
       
   576         */
       
   577         void CreateParL( CMDXMLDocument* aDom, CMDXMLElement* aRoot, TInt aSlide );
       
   578 
       
   579         /**
       
   580         * CreateBodyL
       
   581         * Sub function for ComposeL
       
   582         *
       
   583         * @since    3.1
       
   584         * @param    aRoot   IN parent element for the new element(s)
       
   585         */
       
   586         void CreateBodyL( CMDXMLDocument* aDom, CMDXMLElement* aRoot );
       
   587 
       
   588         /**
       
   589         * CreateLayoutL
       
   590         * Sub function for ComposeL
       
   591         *
       
   592         * @since    3.1
       
   593         * @param    aRoot        IN parent element for the new element(s)
       
   594         * @param    aRootLayout  IN root-layout element
       
   595         * @param    aLayout      IN layout element
       
   596         * @param    aTextRegion  IN text region element
       
   597         * @param    aImageRegion IN image region element
       
   598         */
       
   599         void CreateLayoutL(
       
   600             CMDXMLDocument* aDom,
       
   601             CMDXMLElement* aRoot,
       
   602             CMDXMLElement* aRootLayout = NULL,
       
   603             CMDXMLElement* aLayout = NULL,
       
   604             CMDXMLElement* aTextRegion = NULL,
       
   605             CMDXMLElement* aImageRegion = NULL );
       
   606 
       
   607         /**
       
   608         * CreateHeadL
       
   609         * Sub function for ComposeL
       
   610         *
       
   611         * @since    3.1
       
   612         * @param    aRoot   IN parent element for the new element(s)
       
   613         */
       
   614         void CreateHeadL( CMDXMLDocument* aDom, CMDXMLElement* aRoot );
       
   615 
       
   616         /**
       
   617         * DoRemoveObjectL
       
   618         * Deletes object from slide and msg store if needed.
       
   619         *
       
   620         * @since    3.1
       
   621         * @param    aSlideNum   IN slide number where text is added
       
   622         * @param    aObjectType IN type of the object to be removed
       
   623         */
       
   624         void DoRemoveObjectL( TInt aSlideNum,
       
   625                               CUniObject* aObject,
       
   626                               TBool aLeaveToStore = EFalse );
       
   627 
       
   628         /**
       
   629         * Adds slide. Appends if slidenum greater than current max,
       
   630         * otherwise inserts.
       
   631         *
       
   632         * @since    3.1
       
   633         * @param    aSlideNum   IN insert position
       
   634         */
       
   635         CUniSmilSlide* DoAddSlideL( TInt aSlideNum = -1 );
       
   636 
       
   637         /**
       
   638         * SortSlidesCompare
       
   639         * Compares slides according to time. Most recent is greatest.
       
   640         * Empty slides are greater than non-empty slides.
       
   641         *
       
   642         * @since    3.1
       
   643         * @param    aSlide1     IN slide to compare
       
   644         * @param    aSlide2     IN slide to compare
       
   645         * @return If aSlide1 "is greater than" aSlide2 returns positive value.
       
   646         *         If aSlide1 "is smaller than" aSlide2 returns negative value.
       
   647         *         If aSlide1 and aSlide2 "are equal" returns zero.
       
   648         */
       
   649         TInt SortSlidesCompare( CUniSmilSlide* aSlide1, CUniSmilSlide* aSlide2 );
       
   650 
       
   651         /**
       
   652         * Gets the layout of MMS SMIL document.
       
   653         * Assumes that the document is valid MMS SMIL.
       
   654 
       
   655         * @since 3.1
       
   656         * @param    aDom    Root node of the document tree.
       
   657         * @return           Layout of the document.
       
   658         */
       
   659         TUniLayout GetMmsSmilLayout( CMDXMLDocument* aDom );
       
   660 
       
   661         /**
       
   662         * Gets the first element of given name from the SMIL document.
       
   663         *
       
   664         * @since 3.1
       
   665         * @param    aDom    Root node of the document tree.
       
   666         * @param    aName   The name of the node to be searched.
       
   667         * @return           Pointer to the element node.
       
   668         *                   If element not found returns NULL.
       
   669         */
       
   670         CMDXMLNode* GetNode( CMDXMLDocument* aDom, const TDesC& aName );
       
   671 
       
   672         void GetMediaElemRegionIDs( CMDXMLNode* aPage );
       
   673 
       
   674         void GetAllMediaElemRegionIDs( CMDXMLNode* aPage );
       
   675 
       
   676         void GetLayoutElements(
       
   677             CMDXMLNode* aLayout,
       
   678             CMDXMLElement*& aRlEle,
       
   679             CMDXMLElement*& aTxtEle,
       
   680             CMDXMLElement*& aImgEle );
       
   681 
       
   682         void GetRootLayoutSize( CMDXMLElement* aRl, TSize& aSize );
       
   683 
       
   684         void GetRegionRect( CMDXMLElement* aRegion, TSize aRoot, TRect& aRect );
       
   685 
       
   686         TUniRegion GetRegionType( CMDXMLNode* aNodePtr );
       
   687 
       
   688         void RemoveMetaTagsAndComments( CMDXMLDocument* aDom );
       
   689 
       
   690         /**
       
   691         * CorrectSlideTimingL
       
   692         *
       
   693         * @since    3.1
       
   694         */
       
   695         void CorrectSlideTimingL( CMDXMLElement* aPage );
       
   696 
       
   697         /**
       
   698         * TimingSpecified
       
   699         *
       
   700         * @since    3.1
       
   701         */
       
   702         TBool TimingSpecified( CMDXMLElement* aNodePrt );
       
   703 
       
   704     private: // data
       
   705 
       
   706         RFs&                iFs;
       
   707         CBaseMtm&      iMtm;
       
   708         CUniDataUtils&           iData;
       
   709         CUniObjectList&     iObjectList;
       
   710 
       
   711         TUniLayout iSlideLayout; // Defines order of objects in display for slides.
       
   712 
       
   713         CSmilSlideArray*    iSlideArray;    // Holds slides
       
   714         TInt                iParseResult;
       
   715         CUniSmilParams*     iSmilParams;
       
   716         TSize               iScreenSize;
       
   717         TBool               iSizeEstimateUpToDate;
       
   718         TInt                iSizeEstimate;
       
   719 
       
   720         TPtrC               iTextRegionId;
       
   721         TPtrC               iImageRegionId;
       
   722         TInt                iMaxSlideCount;
       
   723     };
       
   724 
       
   725 
       
   726 #include <UniSmilModel.inl>
       
   727 
       
   728 #endif // __UNISMILMODEL_H