homescreensrv_plat/xcfw_api/inc/gecoobjectfactorybase.h
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Base content object factory interface.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CGECOOBJECTFACTORYBASE_H
       
    21 #define CGECOOBJECTFACTORYBASE_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "gecoattributeprovider.h" //MGECOAttributeProvider
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CGECOObjectBase;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 * Abstract base class for object factories. 
       
    34 * All object factories derive from this class.
       
    35 *
       
    36 * @lib XCFW.lib
       
    37 * @since Series 60 3.1
       
    38 */
       
    39 class CGECOObjectFactoryBase: public CBase,
       
    40                               public MGECOAttributeProvider
       
    41     {
       
    42     public: //new functions
       
    43 
       
    44         /**
       
    45         * Get object parser
       
    46         * @param aTypeIdentifier Object type identifier
       
    47         * @return CGECOObjectBase derived object. Caller takes ownership.
       
    48         */
       
    49         virtual CGECOObjectBase* GetContentObjectAndSetContextL(
       
    50             const TDesC& aTypeIdentifier ) = 0;
       
    51 
       
    52         /**
       
    53         * Initializes the current object with attribute provider data
       
    54         * @param aAttributeProvider Attribute provider for data initialization
       
    55         */
       
    56         virtual void InitializeObjectL(
       
    57             MGECOAttributeProvider& aAttributeProvider ) = 0;
       
    58 
       
    59         /**
       
    60         * Set context object for initialize and preparesave operations
       
    61         * @param aContext Object to use in InitializeL operations
       
    62         * @return Error code, e.g. when the factory does not know this object.
       
    63         */
       
    64         virtual TInt SetContext( CGECOObjectBase* aContext ) = 0;
       
    65         
       
    66 
       
    67     public: //from base classes
       
    68         
       
    69         /**
       
    70         * From MGECOAttributeProvider. Returns number of attributes
       
    71         */
       
    72         virtual TInt NumAttributes() = 0;
       
    73         
       
    74         /**
       
    75         * From MGECOAttributeProvider. Returns name, value and localization 
       
    76         * status for attribute in given index.
       
    77         */
       
    78         virtual void AttributeDetailsL( const TInt aIndex, TPtrC& aAttrName, 
       
    79             TPtrC& aAttrValue, TBool& aIsLocalized ) = 0;
       
    80 
       
    81         /**
       
    82         * From MGECOAttributeProvider. Returns name and value  
       
    83         * for attribute in given index.
       
    84         */
       
    85         virtual void AttributeDetailsL( const TInt aIndex, TPtrC& aAttrName, 
       
    86             TPtrC& aAttrValue) = 0;
       
    87 
       
    88         /**
       
    89         * From MGECOAttributeProvider. Returns ETrue if object / tag 
       
    90         * has text data
       
    91         */
       
    92         virtual TBool HasTextData() = 0;
       
    93             
       
    94         /**
       
    95         * From MGECOAttributeProvider. Returns XML node / content object 
       
    96         * text data if any
       
    97         */
       
    98         virtual void TextDetailsL(TPtrC& aText, TBool& aIsLocalized) = 0;
       
    99         
       
   100 
       
   101     protected: //data
       
   102         //Current factory context. Not owned.
       
   103         CGECOObjectBase*             iContext;
       
   104     };
       
   105     
       
   106 
       
   107 #endif //CGECOOBJECTFACTORYBASE_H
       
   108             
       
   109 // End of File