idlehomescreen/inc/xndomproperty.h
changeset 0 f72a12da539e
child 2 08c6ee43b396
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2005,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:  Represents a CSS property.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef XN_DOM_PROPERTY_H
       
    21 #define XN_DOM_PROPERTY_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <s32strm.h>
       
    26 #include "mxndomlistitem.h"
       
    27 
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CXnDomPropertyValue;
       
    31 class CXnDomList;
       
    32 class CXnDomStringPool;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 *  @ingroup group_domdocument
       
    38 *  Represents a CSS property. 
       
    39 *
       
    40 *  @lib xndomdocument.lib
       
    41 *  @since Series 60 3.1
       
    42 */
       
    43 class CXnDomProperty : public CBase, public MXnDomListItem
       
    44     {
       
    45     public:
       
    46         /**
       
    47         * Property value's pseudo class type
       
    48         */
       
    49         enum TPseudoClass
       
    50         	{
       
    51         	ENone=0,
       
    52         	EFocus,
       
    53         	EPassiveFocus,
       
    54         	EActive,
       
    55         	EHold,
       
    56         	EEnabled,
       
    57         	EDisabled,
       
    58         	EHover,
       
    59         	ELink,
       
    60         	EVisited,
       
    61             EEdit,
       
    62             EPressedDown
       
    63         	};
       
    64     public:  // Constructors and destructor
       
    65         /**
       
    66         * Two-phased constructor.
       
    67         */
       
    68         IMPORT_C static CXnDomProperty* NewL( 
       
    69             const TDesC8& aName,
       
    70             CXnDomStringPool& aStringPool );
       
    71         
       
    72         /**
       
    73         * Two-phased stream constructor.
       
    74         */
       
    75         static CXnDomProperty* NewL( 
       
    76             RReadStream& aStream, 
       
    77             CXnDomStringPool& aStringPool );
       
    78         /**
       
    79         * Two-phased constructor.
       
    80         */
       
    81         IMPORT_C static CXnDomProperty* NewL( 
       
    82             TInt16 aStringPoolIndex,
       
    83             CXnDomStringPool& aStringPool );
       
    84         /**
       
    85         * Destructor.
       
    86         */
       
    87         IMPORT_C virtual ~CXnDomProperty();
       
    88 
       
    89     public: // New functions
       
    90         /**
       
    91         * Make a copy from original property.
       
    92         * @since Series 60 3.1
       
    93         * @return Pointer to a property. Ownership is transferred to a caller.
       
    94         */
       
    95         IMPORT_C CXnDomProperty* CloneL();        
       
    96         
       
    97         /**
       
    98         * Make a copy from original property.
       
    99         * @since Series 60 3.1
       
   100         * @param Original string pool clone.
       
   101         * @return Pointer to a property. Ownership is transferred to a caller.
       
   102         */
       
   103         IMPORT_C CXnDomProperty* CloneL( CXnDomStringPool& aStringPool );   
       
   104         
       
   105         /**
       
   106         * Get property value list.
       
   107         * @since Series 60 3.1
       
   108         * @return Reference to property value list.
       
   109         */
       
   110         IMPORT_C CXnDomList& PropertyValueList();
       
   111         
       
   112         /**
       
   113         * Test if property has any value.
       
   114         * @since Series 60 3.1
       
   115         * @return ETrue if at least one value exist
       
   116         */
       
   117         IMPORT_C TBool IsValueSet();
       
   118         
       
   119         /**
       
   120         * Test property's capability to inherit value.
       
   121         * @since Series 60 3.1
       
   122         * @return ETrue if property's value can be inherited
       
   123         */
       
   124         IMPORT_C TBool Inherited();
       
   125         
       
   126         /**
       
   127         * Set property to be capable to inherit value.
       
   128         * @since Series 60 3.1
       
   129         * @param aInherited ETrue inherit capable
       
   130         */
       
   131         IMPORT_C void SetInherited( TBool aInherited );
       
   132         
       
   133         /**
       
   134         * Get reference to the dom's string pool.
       
   135         * @since Series 60 3.1
       
   136         * @return Reference to string pool
       
   137         */
       
   138         IMPORT_C CXnDomStringPool& StringPool() const;
       
   139         
       
   140         /**
       
   141         * Get the property's string pool index. 
       
   142         * @since Series 60 3.1
       
   143         * @return String pool index.
       
   144         */
       
   145         IMPORT_C TInt16 StringPoolIndex()const; 
       
   146         
       
   147      public:  //Pseudo class utility   
       
   148         /**
       
   149         * Get value's pseudo class
       
   150         * @since Series 60 3.1
       
   151         * @return Value's pseudo class
       
   152         */
       
   153         IMPORT_C TPseudoClass PseudoClass()const;
       
   154         
       
   155         /**
       
   156         * Set value's pseudo class
       
   157         * @since Series 60 3.1
       
   158         * @param aPseudoClass Pseudo class enumeration
       
   159         */
       
   160         IMPORT_C void SetPseudoClass( TPseudoClass aPseudoClass ); 
       
   161      
       
   162     public: //From CXnDomListItem
       
   163                
       
   164         /**
       
   165         * Documented in CXnDomListItem::Name
       
   166         */
       
   167         IMPORT_C const TDesC8& Name(); 
       
   168         
       
   169         /**
       
   170         * Documented in CXnDomListItem::Size
       
   171         */
       
   172         TInt Size() const;
       
   173         
       
   174         /**
       
   175         * Documented in CXnDomListItem::ExternalizeL
       
   176         */
       
   177         void ExternalizeL( RWriteStream& aStream ) const;
       
   178        
       
   179         /**
       
   180         * Documented in CXnDomListItem::InternalizeL
       
   181         */
       
   182         void InternalizeL( RReadStream& aStream );
       
   183     
       
   184     private:
       
   185 
       
   186         /**
       
   187         * C++ default constructor.
       
   188         */
       
   189         CXnDomProperty( CXnDomStringPool& aStringPool);
       
   190         
       
   191         /**
       
   192         * C++ constructor with string pool index.
       
   193         */
       
   194         CXnDomProperty( TInt16 aStringPoolIndex, CXnDomStringPool& aStringPool);
       
   195         
       
   196         /**
       
   197         * By default Symbian 2nd phase constructor is private.
       
   198         */
       
   199         void ConstructL( const TDesC8& aName );
       
   200         
       
   201         /**
       
   202         * By default Symbian 2nd phase constructor is private.
       
   203         */
       
   204         void ConstructL();
       
   205         
       
   206     private:    // Data
       
   207         //String pool to get string for references, not owned
       
   208         CXnDomStringPool& iStringPool;
       
   209         
       
   210         // Pseudo class type for value
       
   211         TPseudoClass    iPseudoClass;
       
   212        
       
   213         //Property's name reference to string pool
       
   214         TInt16          iNameRef;
       
   215         
       
   216         //Property owns a value list which has property's values
       
   217         CXnDomList* iPropValList;
       
   218      
       
   219         //Property is capable to inherit
       
   220         TBool       iInherited;
       
   221                 
       
   222         
       
   223     };
       
   224 
       
   225 #endif      // XN_DOM_PROPERTY_H   
       
   226             
       
   227 // End of File