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