brandingserver/tools/bsimport/inc/cbsimportfilereader.h
changeset 0 e6b17d312c8b
child 21 cfd5c2994f10
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2006-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:  Import reader opens and reads the XML file to CMDXMLDocument 
       
    15 
       
    16 *                object
       
    17 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef CBSIMPORTFILEREADER_H
       
    23 
       
    24 #define CBSIMPORTFILEREADER_H
       
    25 
       
    26 
       
    27 
       
    28 #include <e32base.h>
       
    29 
       
    30 #include <gmxmlparser.h>
       
    31 
       
    32 
       
    33 
       
    34 class CMDXMLDocument;
       
    35 
       
    36 class CActiveScheduler;
       
    37 
       
    38 
       
    39 
       
    40 /**
       
    41 
       
    42  *  Import reader opens and reads the XML file to CMDXMLDocument object
       
    43 
       
    44  *
       
    45 
       
    46  *  @lib brandimporter.exe
       
    47 
       
    48  *  @since S60 v3.2
       
    49 
       
    50  */
       
    51 
       
    52 class CBSImportFileReader : public CBase,
       
    53 
       
    54                             public MMDXMLParserObserver
       
    55 
       
    56     {
       
    57 
       
    58 public:
       
    59 
       
    60 
       
    61 
       
    62     static CBSImportFileReader* NewL( TBool aUseScheduler );
       
    63 
       
    64     
       
    65 
       
    66     static CBSImportFileReader* NewLC( TBool aUseScheduler );
       
    67 
       
    68     
       
    69 
       
    70     ~CBSImportFileReader();
       
    71 
       
    72 
       
    73 
       
    74     /**
       
    75 
       
    76      * Reads XML file to CMDXMLDocument object
       
    77 
       
    78      *
       
    79 
       
    80      * @since S60 v3.2
       
    81 
       
    82      * @param aFs file system handle
       
    83 
       
    84      * @param aFileName XML file to read
       
    85 
       
    86      */
       
    87 
       
    88     CMDXMLDocument* ReadXMLFileL( RFs& aFs, const TDesC& aFileName );
       
    89 
       
    90     
       
    91 
       
    92 private:
       
    93 
       
    94 
       
    95 
       
    96     void ConstructL();
       
    97 
       
    98 
       
    99 
       
   100     CBSImportFileReader( TBool aUseScheduler );
       
   101 
       
   102 
       
   103 
       
   104 // from base class MMDXMLParserObserver
       
   105 
       
   106 
       
   107 
       
   108     /**
       
   109 
       
   110      * From MMDXMLParserObserver.
       
   111 
       
   112      * Writes text to log
       
   113 
       
   114      *
       
   115 
       
   116      * @since S60 v3.2
       
   117 
       
   118      * @param aText text to write
       
   119 
       
   120      */
       
   121 
       
   122     void ParseFileCompleteL();
       
   123 
       
   124             
       
   125 
       
   126 private: // Data
       
   127 
       
   128     
       
   129 
       
   130     // Own. XML parser
       
   131 
       
   132     CMDXMLParser* iParser;
       
   133 
       
   134     
       
   135 
       
   136     // Own. XML document from parser
       
   137 
       
   138     CMDXMLDocument* iDocument;
       
   139 
       
   140 
       
   141 
       
   142     // Own. ActiveScheduler
       
   143 
       
   144     CActiveScheduler* iScheduler;
       
   145 
       
   146 
       
   147 
       
   148     // Own. Scheduler waiter. Used when we can't use scheduler directly.    
       
   149 
       
   150     CActiveSchedulerWait* iWaiter;
       
   151 
       
   152     
       
   153 
       
   154     // Wheter we use CActiveScheduler or CActiveSchedulerWait
       
   155 
       
   156     TBool iUseScheduler;
       
   157 
       
   158     };
       
   159 
       
   160 
       
   161 
       
   162 #endif //CBSIMPORTFILEREADER_H
       
   163