idlehomescreen/inc/xnnodeappif.h
changeset 0 f72a12da539e
child 9 f966699dea19
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:
       
    15 * Application interface to node of layout tree
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef XNNODEAPPIF_H
       
    20 #define XNNODEAPPIF_H
       
    21 
       
    22 // System includes
       
    23 #include <coedef.h>
       
    24 #include <e32base.h>
       
    25 #include <w32std.h>
       
    26 #include <coecobs.h>
       
    27 
       
    28 // Forward declarations
       
    29 class CXnType;
       
    30 class CXnProperty;
       
    31 class CXnNode;
       
    32 class TXnUiEngineAppIf;
       
    33 
       
    34 namespace XnComponentInterface
       
    35     {
       
    36     class MXnComponentInterface;
       
    37     }
       
    38 
       
    39 // Class declaration
       
    40 /**
       
    41  * Application interface to node of layout tree
       
    42  *
       
    43  * @ingroup group_xnlayoutengine
       
    44  * @lib xn3layoutengine.lib
       
    45  * @since Series 60 3.1
       
    46  */
       
    47 class CXnNodeAppIf : public CBase
       
    48     {
       
    49 public:
       
    50     /**
       
    51      * C++ default constructor.
       
    52      */
       
    53     CXnNodeAppIf( CXnNode& aNode );
       
    54 
       
    55 public:
       
    56     // New functions
       
    57 
       
    58     /**
       
    59      * Get the UI engine
       
    60      *
       
    61      * @since Series 60 3.1
       
    62      * @return UI engine
       
    63      */
       
    64     IMPORT_C TXnUiEngineAppIf* UiEngineL();
       
    65 
       
    66     /**
       
    67      * Set the node's characted data
       
    68      *
       
    69      * @since Series 60 3.1
       
    70      * @param aData Character data
       
    71      */
       
    72     IMPORT_C void SetPCDataL( const TDesC8& aData );
       
    73 
       
    74     /**
       
    75      * Get the node's characted data
       
    76      *
       
    77      * @since Series 60 3.1
       
    78      * @return Character data
       
    79      */
       
    80     IMPORT_C const TDesC8& GetPCData() const;
       
    81 
       
    82     /**
       
    83      * Set a property.
       
    84      *
       
    85      * The list will assume ownership of the property.
       
    86      * If an equal property is already in the list, it will be
       
    87      * replaced with the new property and the old property will be destroyed.
       
    88      * @since Series 60 3.1
       
    89      * @param aProperty Property to set.
       
    90      */
       
    91     IMPORT_C void SetPropertyL( CXnProperty* aProperty );
       
    92 
       
    93     /**
       
    94      * Set an array of properties.
       
    95      *
       
    96      * Improves the performance when many properties need to be
       
    97      * set e.g. in construction phase.
       
    98      * The list will assume ownership of the property.
       
    99      * If an equal property is already in the list, it will be
       
   100      * replaced with the new property and the old property will be destroyed.
       
   101      * @since Series 60 3.1
       
   102      * @param aPropertyArray Properties to set.
       
   103      */
       
   104     IMPORT_C void SetPropertyArrayL(
       
   105         RPointerArray< CXnProperty >* aPropertyArray );
       
   106 
       
   107     /**
       
   108      * Gets a property.
       
   109      *
       
   110      * The list will retain ownership of the property,
       
   111      * the caller must not destroy the property. The returned pointer will
       
   112      * become invalid if the property is replaced in the list by a subsequent
       
   113      * SetL().
       
   114      * @since Series 60 3.1
       
   115      * @param aProperty Property key
       
   116      * @return The property mapped to the key or NULL if not found.
       
   117      */
       
   118     IMPORT_C CXnProperty* GetPropertyL( CXnProperty& aProperty ) const;
       
   119 
       
   120     /**
       
   121      * Gets a property.
       
   122      *
       
   123      * The list will retain ownership of the property,
       
   124      * the caller must not destroy the property. The returned pointer will
       
   125      * become invalid if the property is replaced in the list by a subsequent
       
   126      * SetL().
       
   127      * @since Series 60 3.1
       
   128      * @param aKey Name of the property
       
   129      * @return The property mapped to the key or NULL if not found.
       
   130      */
       
   131     IMPORT_C CXnProperty* GetPropertyL( const TDesC8& aKey ) const;
       
   132 
       
   133     /**
       
   134      * Set a state
       
   135      *
       
   136      * @since Series 60 3.1
       
   137      * @param aState State to set.
       
   138      */
       
   139     IMPORT_C void SetStateL( const TDesC8& aState );
       
   140 
       
   141     /**
       
   142      * Check whether a state is set
       
   143      *
       
   144      * @since Series 60 3.1
       
   145      * @return ETrue if set, EFalse if not
       
   146      */
       
   147     IMPORT_C TBool IsStateSet( const TDesC8& aState );
       
   148 
       
   149     /**
       
   150      * Unset a state
       
   151      *
       
   152      * @since Series 60 3.1
       
   153      * @param aState State to unset.
       
   154      */
       
   155     IMPORT_C void UnsetStateL( const TDesC8& aState );
       
   156 
       
   157     /**
       
   158      * Get node type
       
   159      *
       
   160      * @since Series 60 3.1
       
   161      * @return Node type
       
   162      */
       
   163     IMPORT_C CXnType* Type();
       
   164 
       
   165     /**
       
   166      * Get node's content rect
       
   167      *
       
   168      * @since Series 60 3.1
       
   169      * @return Content rect
       
   170      */
       
   171     IMPORT_C TRect Rect();
       
   172 
       
   173     /**
       
   174      * Get node's border rect
       
   175      *
       
   176      * @since Series 60 3.1
       
   177      * @return Border rect
       
   178      */
       
   179     IMPORT_C TRect BorderRect();
       
   180 
       
   181     /**
       
   182      * Get node's margin rect
       
   183      *
       
   184      * @since Series 60 3.1
       
   185      * @return Margin rect
       
   186      */
       
   187     IMPORT_C TRect MarginRect();
       
   188 
       
   189     /**
       
   190      * Get node's padding rect
       
   191      *
       
   192      * @since Series 60 3.1
       
   193      * @return Padding rect
       
   194      */
       
   195     IMPORT_C TRect PaddingRect();
       
   196 
       
   197     /**
       
   198      * Get the internal node
       
   199      * @since Series 60 3.1
       
   200      * @return Internal node
       
   201      */
       
   202     CXnNode& Node();
       
   203 
       
   204     /**
       
   205      * Create a component interface according to the given type.
       
   206      *
       
   207      * @param aType Type of the interface to create
       
   208      * @return Created interface or NULL if the provided type is not supported.
       
   209      */
       
   210     IMPORT_C XnComponentInterface::MXnComponentInterface* MakeInterfaceL(
       
   211         const TDesC8& aType );
       
   212 
       
   213     /**
       
   214      * Get the child nodes
       
   215      *
       
   216      * @since Series 60 3.1
       
   217      * @return Child nodes
       
   218      */
       
   219     IMPORT_C RPointerArray< CXnNodeAppIf > ChildrenL();
       
   220 
       
   221     /**
       
   222      * Get the parent node
       
   223      *
       
   224      * @since Series 60 3.1
       
   225      * @return parent node
       
   226      */
       
   227     IMPORT_C CXnNodeAppIf* ParentL() const;
       
   228 
       
   229     /**
       
   230      * Get internal dom node type
       
   231      *
       
   232      * @return Reference to node type
       
   233      */
       
   234     IMPORT_C const TDesC8& InternalDomNodeType() const;
       
   235 
       
   236     /**
       
   237      * Shows all tooltip nodes associated to this node
       
   238      */
       
   239     IMPORT_C void ShowTooltipsL();
       
   240 
       
   241     /**
       
   242      * Hides all tooltip nodes associated to this node
       
   243      */
       
   244     IMPORT_C void HideTooltipsL();
       
   245 
       
   246     /**
       
   247      * Get namespace of this node
       
   248      */
       
   249     IMPORT_C const TDesC8& Namespace();
       
   250 
       
   251 private:
       
   252     // Data
       
   253 
       
   254     /**
       
   255      * Pointer to internal node object.
       
   256      * Not own.
       
   257      */
       
   258     CXnNode* iNode;
       
   259     };
       
   260 
       
   261 #endif