mobilemessaging/smilui/playersrc/SmilPlayerSynchXmlParser.cpp
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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: SmilPlayerSynchXmlParser implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "SmilPlayerSynchXmlParser.h"
       
    22 
       
    23 // CONSTANTS
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // ----------------------------------------------------------------------------
       
    28 // CSmilPlayerSynchXmlParser::CSmilPlayerSynchXmlParser
       
    29 // Default C++ constructor.
       
    30 // ----------------------------------------------------------------------------
       
    31 // 
       
    32 CSmilPlayerSynchXmlParser::CSmilPlayerSynchXmlParser()
       
    33     {
       
    34     }
       
    35 
       
    36 // ----------------------------------------------------------------------------
       
    37 // CSmilPlayerSynchXmlParser::~CSmilPlayerSynchXmlParser
       
    38 // Destructor.
       
    39 // ----------------------------------------------------------------------------
       
    40 // 
       
    41 CSmilPlayerSynchXmlParser::~CSmilPlayerSynchXmlParser()
       
    42     {
       
    43     }
       
    44 
       
    45 
       
    46 // ----------------------------------------------------------------------------
       
    47 // CSmilPlayerSynchXmlParser::ParseL
       
    48 // Performs parsing. 
       
    49 // ----------------------------------------------------------------------------
       
    50 // 
       
    51 CMDXMLDocument* CSmilPlayerSynchXmlParser::ParseL( RFile& aFileHandle )
       
    52     {
       
    53     CMDXMLParser* xmlParser = CMDXMLParser::NewL( this ); 
       
    54     CleanupStack::PushL( xmlParser );
       
    55 
       
    56     RFile parseHandle;
       
    57     User::LeaveIfError( parseHandle.Duplicate( aFileHandle ) );
       
    58     User::LeaveIfError( xmlParser->ParseFile( parseHandle ) ); // XML parser closes the given handle.
       
    59     
       
    60     iWaitScheduler.Start();
       
    61     
       
    62     CMDXMLDocument* dom = xmlParser->DetachXMLDoc();
       
    63     CleanupStack::PopAndDestroy( xmlParser );
       
    64     return dom;
       
    65     }
       
    66 
       
    67 // ----------------------------------------------------------------------------
       
    68 // CSmilPlayerSynchXmlParser::ParseFileCompleteL
       
    69 // Called when parsing has been completed. 
       
    70 // ----------------------------------------------------------------------------
       
    71 //            
       
    72 void CSmilPlayerSynchXmlParser::ParseFileCompleteL()
       
    73     {
       
    74     if ( iWaitScheduler.IsStarted() )
       
    75         {
       
    76         iWaitScheduler.AsyncStop(); 
       
    77         }
       
    78     }
       
    79     
       
    80 //  End of File  
       
    81