idlehomescreen/xmluirendering/uiengine/inc/xnodtparser.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Parser for parsing ODT (Object Description Tree) data
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _CXNODTPARSER_H
       
    20 #define _CXNODTPARSER_H
       
    21 
       
    22 //  System includes
       
    23 #include <e32base.h>
       
    24 
       
    25 // Constants
       
    26 
       
    27 // Forward declarations
       
    28 class CXnViewManager;
       
    29 class CXnUiEngine;
       
    30 class CXnEcomHandler;
       
    31 class CXnRootData;
       
    32 class CXnViewData;
       
    33 class CXnPluginData;
       
    34 class CXnDomStringPool;
       
    35 class CXnDomNode;
       
    36 class CXnNode;
       
    37 
       
    38 // Class declaration
       
    39 
       
    40 /**
       
    41  *  Layout file parser for reading ODT data to create the UI tree.
       
    42  *  
       
    43  *  @ingroup group_xnlayoutengine
       
    44  *  @lib xn3layoutengine.lib
       
    45  *  @since Series 60 3.1
       
    46  */
       
    47 NONSHARABLE_CLASS( CXnODTParser ) : public CBase
       
    48     {
       
    49 public:
       
    50     // Constructors and destructor
       
    51 
       
    52     /**
       
    53      * Two-phased constructor.
       
    54      * 
       
    55      * @param aManager View Manager
       
    56      * @param aXnEcomHandler Ecom handler
       
    57      */
       
    58     static CXnODTParser* NewL( CXnViewManager& aManager,
       
    59             CXnEcomHandler& aXnEcomHandler );
       
    60 
       
    61     /**
       
    62      * Destructor.
       
    63      */
       
    64     virtual ~CXnODTParser();
       
    65 
       
    66 public:
       
    67     // New functions
       
    68 
       
    69     /**
       
    70      * Loads application root
       
    71      * 
       
    72      * @param aRootData Root data
       
    73      * @param aAppUid Application uid
       
    74      */    
       
    75     void LoadRootL( CXnRootData& aRootData, TUid aAppUid );
       
    76 
       
    77     /**
       
    78      * Loads view
       
    79      * 
       
    80      * @param aViewData View data
       
    81      */        
       
    82     void LoadViewL( CXnViewData& aViewData );
       
    83 
       
    84     /**
       
    85      * Destroys view
       
    86      * 
       
    87      * @param aViewData View data
       
    88      */            
       
    89     void DestroyView( CXnViewData& aViewData );
       
    90 
       
    91     /**
       
    92      * Loads widget
       
    93      * 
       
    94      * @param aPluginData Plugin data
       
    95      */                
       
    96     void LoadWidgetL( CXnPluginData& aPluginData );
       
    97 
       
    98     /**
       
    99      * Destroys widget
       
   100      * 
       
   101      * @param aPluginData Plugin data
       
   102      */                    
       
   103     void DestroyWidgetL( CXnPluginData& aPluginData );
       
   104     
       
   105 private:
       
   106     
       
   107     /**
       
   108      * 2nd phase constructor. 
       
   109      */
       
   110     void ConstructL();
       
   111 
       
   112     /**
       
   113      * C++ default constructor. 
       
   114      */
       
   115     CXnODTParser( CXnViewManager& aManager,
       
   116             CXnEcomHandler& aXnEcomHandler );
       
   117 
       
   118 private:
       
   119     // new functions
       
   120     void CreateNodesL( CXnDomNode* aSourceNode, CXnDomStringPool& aSp,
       
   121                           CXnPluginData& aPluginData );
       
   122 
       
   123     void ConstructNodeL( CXnDomNode& aSource,        
       
   124         CXnDomStringPool& aSp,    
       
   125         CXnPluginData& aPluginData );
       
   126 
       
   127     void CreateControlsL( CXnDomNode* aNode, CXnPluginData& aPluginData );
       
   128     
       
   129     void ConstructControlL( CXnNode* aNode, CXnPluginData& aPluginData );
       
   130 
       
   131     TBool CreateBuiltInControlL( CXnNode& aNode, const TDesC8& aName );
       
   132     
       
   133     TBool CreateExternalControlL( CXnNode& aNode, const TDesC8& aName );
       
   134 
       
   135     void CreateFactoryControlL( CXnNode& aNode, const TDesC8& aName );
       
   136 
       
   137     void HandleWidgetBackgroundL( CXnNode* aWidgetNode );
       
   138 
       
   139 private:
       
   140     // Data               
       
   141     
       
   142     /** View manager, not owned */    
       
   143     CXnViewManager& iManager;
       
   144     /** UiEngine, not owned */    
       
   145     CXnUiEngine& iUiEngine;
       
   146     /** ECOM helper object, not owned */
       
   147     CXnEcomHandler& iEcomHandler;
       
   148     };
       
   149 
       
   150 #endif // _CXNODTPARSER_H