uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiVisual.h
changeset 0 15bf7259bb7c
child 3 d8a3531bc6b8
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:   Defines CHuiVisual. Visuals are graphical entities visible on a display
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __HUIVISUAL_H__
       
    21 #define __HUIVISUAL_H__
       
    22 
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <e32std.h>
       
    26 #include <uiacceltk/HuiTimedPoint.h>
       
    27 #include <uiacceltk/huimetric.h>
       
    28 #include <uiacceltk/HuiRealRect.h>
       
    29 #include <uiacceltk/HuiRealPoint.h>
       
    30 #include <uiacceltk/HuiRealSize.h>
       
    31 #include <uiacceltk/HuiOwnedPointer.h>
       
    32 #include <uiacceltk/HuiBrush.h>
       
    33 #include <uiacceltk/HuiBrushArray.h>
       
    34 #include <uiacceltk/HuiSessionObject.h>
       
    35 
       
    36 
       
    37 /* Forward declarations. */
       
    38 class CHuiEnv;
       
    39 class CHuiControlGroup;
       
    40 class CHuiSkin;
       
    41 class CHuiControl;
       
    42 class MHuiEventHandler;
       
    43 class CHuiDisplay;
       
    44 class CHuiLayout;
       
    45 class CHuiGc;
       
    46 class CHuiVisual;
       
    47 class CHuiTransformation;
       
    48 class CHuiDropShadow;
       
    49 class CHuiFxEffect;
       
    50 class CHuiFxEffectParser;
       
    51 class MHuiEffectable;
       
    52 class CHuiCanvasRenderBuffer;
       
    53 /** Visual types. */
       
    54 enum THuiVisualType
       
    55     {
       
    56     EHuiVisualTypeVisual,
       
    57     EHuiVisualTypeLine,
       
    58     EHuiVisualTypeText,
       
    59     EHuiVisualTypeImage,
       
    60     EHuiVisualTypeMesh,
       
    61     EHuiVisualTypeCanvas
       
    62     };
       
    63 
       
    64 
       
    65 /**
       
    66  * Visual flags.
       
    67  *
       
    68  * @see CHuiVisual::SetFlag()
       
    69  * @see CHuiVisual::SetFlags()
       
    70  * @see CHuiVisual::Flags() 
       
    71  * @see CHuiVisual::ClearFlag() 
       
    72  * @see CHuiVisual::ClearFlags()  
       
    73  */
       
    74 enum THuiVisualFlags
       
    75     {
       
    76     /** Manual layout means that layouts can't change the position and
       
    77         size of the visual; the owner of the visual is expected to
       
    78         manually maintain the visual's placement. */
       
    79     EHuiVisualFlagManualSize = 0x1,
       
    80     EHuiVisualFlagManualPosition = 0x2,
       
    81     EHuiVisualFlagManualLayout = EHuiVisualFlagManualSize |
       
    82                                  EHuiVisualFlagManualPosition,
       
    83 
       
    84     EHuiVisualFlagBlendAdd = 0x4,
       
    85 
       
    86     /** Notify owner control when the visual's layout has been updated.
       
    87         Notication is sent after all children have been updated. */
       
    88     EHuiVisualFlagLayoutUpdateNotification = 0x8,
       
    89 
       
    90     /** When the visual is drawn it will use a 3D projection. */
       
    91     EHuiVisualFlag3DProjection = 0x10,
       
    92 
       
    93     /** No depth test when drawing with a 3D projection. */
       
    94     EHuiVisualFlagNoDepthOcclusion = 0x20,
       
    95 
       
    96     /** Use a local horizon with a 3D projection. Otherwise, the global
       
    97         display horizon is used instead. */
       
    98     EHuiVisualFlagLocalHorizon = 0x40,
       
    99 
       
   100     /** Contents of the visual are clipped to its display rectangle. */
       
   101     EHuiVisualFlagClipping = 0x80,
       
   102 
       
   103     /** Visual is using a horizontal center origin, i.e., the X coordinate
       
   104         of the visual's position defines its horizontal center point. */
       
   105     EHuiVisualFlagHOriginCenter = 0x100,
       
   106 
       
   107     /** Visual is using a right edge origin, i.e., the X coordinate
       
   108         of the visual's position defines its right edge. */
       
   109     EHuiVisualFlagHOriginRight = 0x200,
       
   110 
       
   111     /** Visual is using a vertical center origin, i.e., the Y coordinate
       
   112         of the visual's position defines its vertical center point. */
       
   113     EHuiVisualFlagVOriginCenter = 0x400,
       
   114 
       
   115     /** Visual is using a bottom edge origin, i.e., the Y coordinate
       
   116         of the visual's position defines its bottom edge. */
       
   117     EHuiVisualFlagVOriginBottom = 0x800,
       
   118 
       
   119     /** Visual has changed and needs refresh. */
       
   120     EHuiVisualChanged = 0x1000,
       
   121 
       
   122     /** When the visual is drawn, the depth buffer shouldn't be updated. */
       
   123     EHuiVisualFlagNoDepthUpdate = 0x2000,
       
   124 
       
   125     /** Use the visual's local layout transition time, do not inherit from parent. */
       
   126     EHuiVisualFlagManualTransitionTime = 0x4000,
       
   127 
       
   128     /** Draw above the normal drawing order. */
       
   129     EHuiVisualFlagDrawAfterOthers = 0x10000,
       
   130     
       
   131     /** Do not automatically update the layout of children when doing 
       
   132         changes in a layout (e.g., when reordering children). */
       
   133     EHuiVisualFlagFreezeLayout = 0x20000,
       
   134 
       
   135     /** The visual will be ignored when checking for possible pointer event
       
   136         interaction. */
       
   137     EHuiVisualFlagIgnorePointer = 0x40000,
       
   138 
       
   139     /** 
       
   140      * automatically reverse the base unit sign in the X axis if the current locale setting is 
       
   141      * for mirrored layout
       
   142      *
       
   143      * @note this will only affect the positions of visuals contained
       
   144      * within layout visuals, the contents within a visual such as a text visual will not be 
       
   145      * affected. 
       
   146      */
       
   147     EHuiVisualFlagAutomaticLocaleMirroringEnabled = 0x80000,
       
   148     
       
   149     /** 
       
   150      * RnD: if set, some of the debug features are enabled. See programmers'
       
   151      * guide for more info.
       
   152      *
       
   153      * If the central repository has the setting to draw selected visual outline, 
       
   154      * setting this flag will draw outline for the visual and its child visuals
       
   155      */    
       
   156     EHuiVisualFlagEnableDebugMode  = 0x100000,
       
   157 
       
   158     /** 
       
   159      * Setting this flag makes visual and its children Inactive i.e. it is ignored from roster operations 
       
   160      * - Draw, Handle event, change notifications etc.
       
   161      * Unsetting flag can again make visual tree active.
       
   162      * Note that flag change does not take effect unless that display area is refreshed.
       
   163      **/
       
   164     EHuiVisualFlagInactive = 0x200000,
       
   165 
       
   166     /** 
       
   167      * Setting this flag informs renderer that visual is to be considered as opaque and thus
       
   168      * renderer may choose not to draw visuals behind opaque visual. Note that visual
       
   169      * attribute "opacity" is not affected by this flag.
       
   170      **/
       
   171     EHuiVisualFlagOpaqueHint = 0x400000,
       
   172     
       
   173     /** 
       
   174      * \internal
       
   175      * Setting this flag means that visual is not drawn to the normal place in visual tree.
       
   176      * If some canvas visual has set this visual as an external content visual, it is drawn there.
       
   177      * This is used only for canvas visuals and this is for internal use only.
       
   178      **/    
       
   179     EHuiVisualFlagDrawOnlyAsExternalContent = 0x800000,
       
   180     
       
   181     EHuiVisualFlagShouldBeHidden = 0x1000000,
       
   182     
       
   183     EHuiVisualFlagShouldDestroy = 0x2000000,
       
   184             
       
   185     EHuiVisualFlagShouldBeInactive = 0x4000000,
       
   186     
       
   187 	EHuiVisualFlagAlwaysDraw = 0x8000000,
       
   188 
       
   189     /**
       
   190      * This indicates that this visual is completely under another opaque visual.
       
   191      * So this is a hint, set by client, that the toolkit can use to optimize drawing.
       
   192      */
       
   193     EHuiVisualFlagUnderOpaqueHint = 0x10000000,
       
   194 
       
   195     EHuiVisualFlagShouldBeUnderOpaqueHint = 0x20000000,
       
   196     
       
   197     EHuiVisualFlagShouldBeShown = 0x40000000,
       
   198     
       
   199     EHuiVisualFlagLast = 0xFFFFFFFF
       
   200     };
       
   201 
       
   202 
       
   203 /** Horizontal origin of a visual. */
       
   204 enum THuiVisualHOrigin
       
   205     {
       
   206     EHuiVisualHOriginLeft = 0,
       
   207     EHuiVisualHOriginCenter = 1,
       
   208     EHuiVisualHOriginRight = 2
       
   209     };
       
   210 
       
   211 
       
   212 /** Vertical origin of a visual. */
       
   213 enum THuiVisualVOrigin
       
   214     {
       
   215     EHuiVisualVOriginTop = 0,
       
   216     EHuiVisualVOriginCenter = 1,
       
   217     EHuiVisualVOriginBottom = 2
       
   218     };
       
   219 
       
   220 enum THuiReferenceState
       
   221  	{
       
   222   	EHuiReferenceStateNow = 0,
       
   223   	EHuiReferenceStateTarget = 1
       
   224   	};
       
   225   	
       
   226 const TInt KHuiTactileFeedbackEventTypeNone = -1;
       
   227 
       
   228 /**
       
   229  * Interface for visual owners. A class that owns a visual must implement 
       
   230  * this interface. Visual owners are expected to destroy their visuals when
       
   231  * the owner is destroyed.
       
   232  */
       
   233 class MHuiVisualOwner
       
   234     {
       
   235 public:
       
   236 
       
   237     IMPORT_C virtual ~MHuiVisualOwner();
       
   238 
       
   239     /**
       
   240      * Returns the environment where this visual belongs into.
       
   241      *
       
   242      * @return  Environment.
       
   243      */
       
   244     virtual CHuiEnv& Env() const = 0;
       
   245 
       
   246     /**
       
   247      * Determines the control group in which the owner belong to. If the owner
       
   248      * does not belong to a control group, <code>NULL</code> is returned.
       
   249      *
       
   250      * @return Control group or <code>NULL</code>.
       
   251      */
       
   252     virtual CHuiControlGroup* ControlGroup() const = 0;
       
   253     
       
   254     /**
       
   255      * Returns the event handler resposible for handling events related to 
       
   256      * the visual, for example when the visual receives a pointer down event.
       
   257      */
       
   258     virtual MHuiEventHandler* EventHandler() = 0;
       
   259 
       
   260 	/**
       
   261 	 * Appends a visual to the visual owner. 
       
   262 	 *
       
   263 	 * @param aVisual  Visual to append. The owner receives ownership
       
   264 	 * of the visual.
       
   265 	 *
       
   266      * @return Reference to appended visual.
       
   267 	 */
       
   268     virtual void AppendL(CHuiVisual* aVisual) = 0;
       
   269 
       
   270 	/**
       
   271 	 * Removes a visual from the owner. 
       
   272 	 *
       
   273 	 * @param aVisual  Visual to remove. 
       
   274 	 *
       
   275 	 * @return Pointer to removed visual. Caller gets ownership.
       
   276 	 */
       
   277 	virtual void Remove(CHuiVisual* aVisual) = 0;
       
   278 
       
   279     /**
       
   280      * Removes a visual from the ownership of the owner. This is called when
       
   281      * the visual is being destroyed.
       
   282      *
       
   283      * @param aVisual  Visual to remove.
       
   284      */
       
   285     virtual void VisualDestroyed(CHuiVisual& aVisual) = 0;
       
   286 
       
   287     /**
       
   288      * Notifies the owner that the layout of a visual has been recalculated.
       
   289      * Called only when the EHuiVisualFlagLayoutUpdateNotification flag has
       
   290      * been set for the visual.
       
   291      *
       
   292      * @param aVisual  Visual that has been laid out.
       
   293      */
       
   294     virtual void VisualLayoutUpdated(CHuiVisual& aVisual) = 0;
       
   295    
       
   296 	/**
       
   297 	 * Notifies the visual owner if there was an error (a leave happened)
       
   298 	 * when preparing the visual for drawing. Typically the resource alloc
       
   299 	 * errors such as out of memory is escalated through this callback.
       
   300 	 * 
       
   301      * @param aVisual    Visual that caused the error.
       
   302      * @param aErrorCode Symbian KErr error code for the failure.
       
   303 	 */
       
   304     virtual void VisualPrepareDrawFailed(CHuiVisual& aVisual, TInt aErrorCode) = 0;
       
   305 
       
   306     };
       
   307 
       
   308 
       
   309 /**
       
   310  * Visuals are graphical entities visible on a display. They are responsible
       
   311  * for maintaining their state independently.
       
   312  *
       
   313  * Visuals use a hierarchical coordinate system. All coordinate values are
       
   314  * specified in the base unit of the parent layout, relative to the parent 
       
   315  * visual's upper left corner. This is called the local coordinate system of
       
   316  * the visual. Visuals that have no parent are relative to the upper left 
       
   317  * corner of the HuiDisplay.
       
   318  *
       
   319  * In practice, this means that when a layout is moved 10 pixels to the right,
       
   320  * all of its children are automatically also moved 10 pixels to the right
       
   321  * on the screen.
       
   322  *
       
   323  * Visuals can be tagged with human-readable descriptors. @see SetTagL()
       
   324  *
       
   325  * Note that all layouts are derived from CHuiVisual. Layout visuals are
       
   326  * used for building visual trees. @see CHuiLayout
       
   327  */
       
   328 class CHuiVisual : public CBase, public MHuiBrushGuide, public MHuiSessionObject
       
   329     {
       
   330 public:
       
   331 
       
   332     /* Constructors and destructor. */
       
   333 
       
   334     /** @beginAPI */
       
   335 
       
   336     /**
       
   337      * Constructs and appends a new visual to the owner control.
       
   338      *
       
   339      * @param aOwnerControl  Control that will own the new visual.
       
   340      *
       
   341      * @return  The new visual.
       
   342      */
       
   343     IMPORT_C static CHuiVisual* AddNewL(CHuiControl& aOwnerControl,
       
   344                                         CHuiLayout* aParentLayout = 0);
       
   345 
       
   346     /**
       
   347      * Constructor.
       
   348      *
       
   349      * @param aEnv    The environment where this visuals belongs to.
       
   350      * @param aOwner  Owner control.
       
   351      */
       
   352     IMPORT_C CHuiVisual(MHuiVisualOwner& aOwner);
       
   353 
       
   354     /**
       
   355      * Second-phase constructor, must be called in deriving class.
       
   356      */
       
   357     IMPORT_C virtual void ConstructL();
       
   358 
       
   359     /**
       
   360      * Destructor.
       
   361      */
       
   362     IMPORT_C ~CHuiVisual();
       
   363 
       
   364 
       
   365     /* New Methods. */
       
   366 
       
   367     /**
       
   368      * Destroys a hierarchy of visuals, along with this visual. The visuals
       
   369      * are first removed from their owner.
       
   370      */
       
   371     IMPORT_C virtual void RemoveAndDestroyAllD();
       
   372 
       
   373     /**
       
   374      * Sets the tag of the visual.
       
   375      *
       
   376      * The tag is a descriptor, in the form of one or more colon-separated
       
   377      * character sequences. By default, visuals have no tag (""). Normally,
       
   378      * a visual could have a single tag, for example ("caption").
       
   379      * The tag descriptor of the visual may contain multiple tags,
       
   380      * for example: "tag1:tag2:tag3".
       
   381      *
       
   382      * Tags can be used for identifying visuals. In a typical use case, a control
       
   383      * could identify which of its visuals represent certain elements of the
       
   384      * control based on the tag descriptors. In this case, the tags would be
       
   385      * set by an outside party that also sets the tags of the visuals.
       
   386      *
       
   387      * @param aTag  Tag descriptor for the visual.
       
   388      *
       
   389      * @see CHuiVisual::Tag()
       
   390      * @see CHuiVisual::IsTagged()
       
   391      * @see CHuiVisual::FindTag()
       
   392      */
       
   393     IMPORT_C void SetTagL(const TDesC8& aTag);
       
   394 
       
   395     /**
       
   396      * Determines the tag of the visual.
       
   397      *
       
   398      * @return  Tag descriptor of the visual.
       
   399      *
       
   400      * @see CHuiVisual::SetTagL()
       
   401      * @see CHuiVisual::IsTagged()
       
   402      * @see CHuiVisual::FindTag()
       
   403      */
       
   404     IMPORT_C const TDesC8& Tag() const;
       
   405 
       
   406     /**
       
   407      * Determines if the visual has a tag.
       
   408      *
       
   409      * @return  <code>ETrue</code>, if the visual has been tagged with SetTagL().
       
   410      *          <code>EFalse</code> otherwise.
       
   411      *
       
   412      * @see CHuiVisual::Tag()
       
   413      * @see CHuiVisual::SetTagL()
       
   414      * @see CHuiVisual::FindTag()
       
   415      */
       
   416     IMPORT_C TBool IsTagged() const;
       
   417 
       
   418     /**
       
   419      * Finds a visual whose tag descriptor contains a specific tag.
       
   420      *
       
   421      * CHuiVisual::FindTag() is the basic implementation that checks if
       
   422      * this visual's tag matches the specified tag. CHuiLayout::FindTag()
       
   423      * extends the search into child visuals, covering recursively entire
       
   424      * visual hierarchies.
       
   425      *
       
   426      * @param aTag  Tag to look for. If this tag is found as a part of a
       
   427      *              visual's colon-separated tag descriptor, it is treated
       
   428      *              as a match and the visual is returned. The tag to look
       
   429      *              for cannot contain separator characters (:).
       
   430      *
       
   431      * @return  Visual whose tag descriptor matches the tag. <code>NULL</code>,
       
   432      *          if no such visual could be found.
       
   433      *
       
   434      * @see CHuiVisual::Tag()
       
   435      * @see CHuiVisual::SetTagL()
       
   436      * @see CHuiVisual::IsTagged()
       
   437      * @see CHuiLayout::FindTag()
       
   438      */
       
   439     IMPORT_C virtual CHuiVisual* FindTag(const TDesC8& aTag);
       
   440 
       
   441     /**
       
   442      * Set a flag that affects the visual's behaviour.
       
   443      *
       
   444      * @param aFlag  Flag to set.
       
   445      */
       
   446     IMPORT_C void SetFlag(THuiVisualFlags aFlag);
       
   447 
       
   448     /**
       
   449      * Sets one or more flags that affect the visual's behaviour.
       
   450      *
       
   451      * @param aAnyFlags  One or more flags to set.
       
   452      */
       
   453     IMPORT_C void SetFlags(TInt aAnyFlags);
       
   454 
       
   455     /**
       
   456      * Unset flags that affect the visual's behaviour.
       
   457      *
       
   458      * @param aFlag  Flag to clear.
       
   459      */
       
   460     IMPORT_C void ClearFlag(THuiVisualFlags aFlag);
       
   461 
       
   462     /**
       
   463      * Clear one or more flags that affect the visual's behaviour.
       
   464      *
       
   465      * @param aAnyFlags  One or more flags to clear.
       
   466      */
       
   467     IMPORT_C void ClearFlags(TInt aAnyFlags);
       
   468 
       
   469     /**
       
   470      * Returns the flags of the visual.
       
   471      */
       
   472     inline TInt Flags() const;
       
   473 
       
   474     /**
       
   475      * Returns the owner of the visual.
       
   476      */
       
   477     IMPORT_C MHuiVisualOwner& Owner() const;
       
   478 
       
   479     /**
       
   480      * Sets the owner of the visual.
       
   481      *
       
   482      * @param aOwner  New owner of the visual.
       
   483      */
       
   484     IMPORT_C void SetOwner(MHuiVisualOwner& aOwner);
       
   485     
       
   486     /**
       
   487      * Returns the number of child visuals.
       
   488      */
       
   489     IMPORT_C virtual TInt Count() const;
       
   490 
       
   491     /**
       
   492      * Returns a child visual.
       
   493      *
       
   494      * @param aIndex  Index of the child visual.
       
   495      *
       
   496      * @return  Reference to a child visual.
       
   497      */
       
   498     IMPORT_C virtual CHuiVisual& Visual(TInt aIndex) const;
       
   499 
       
   500     /**
       
   501      * Returns the layout this visual belongs to.
       
   502      */
       
   503     IMPORT_C CHuiLayout* Layout() const;
       
   504 
       
   505     /**
       
   506      * Sets the layout this visual belongs to.
       
   507      */
       
   508     void SetLayout(CHuiLayout* aLayout);
       
   509 
       
   510     /**
       
   511      * Returns the environment of the visual.
       
   512      */
       
   513     IMPORT_C CHuiEnv& Env() const;
       
   514 
       
   515     /**
       
   516      * Returns the skin of the owner control's environment.
       
   517      */
       
   518     IMPORT_C CHuiSkin& Skin() const;
       
   519 
       
   520     /**
       
   521      * Returns the display of the visual (if shown).
       
   522      *
       
   523      * @return  Pointer to <code>CHuiDisplay</code> instance, or
       
   524      * <code>NULL</code> if no display is associated with the visual.
       
   525      */
       
   526     IMPORT_C CHuiDisplay* Display() const;
       
   527 
       
   528     /**
       
   529      * Sets the display on which the visual is being shown.
       
   530      */
       
   531     void SetDisplay(CHuiDisplay* aDisplay);
       
   532 
       
   533     /**
       
   534      * Sets the origin of the visual. The origin defines the location of the
       
   535      * visual's position in relation to its DisplayRect. By default the visual's
       
   536      * position defines its top left corner.
       
   537      *
       
   538      * Calling this method is equivalent to setting/clearing the corresponding
       
   539      * flags.
       
   540      */
       
   541     IMPORT_C void SetOrigin(THuiVisualHOrigin aHoriz, THuiVisualVOrigin aVert);
       
   542 
       
   543     /**
       
   544      * Determines the horizontal origin.
       
   545      */
       
   546     IMPORT_C THuiVisualHOrigin HorizontalOrigin() const;
       
   547 
       
   548     /**
       
   549      * Determines the vertical origin.
       
   550      */
       
   551     IMPORT_C THuiVisualVOrigin VerticalOrigin() const;
       
   552     
       
   553     /**
       
   554      * Moves a point according to the visual's origin position. If this is called
       
   555      * on both the iTl and iBr corners of a rectangle, the result is that the
       
   556      * rectangle is aligned by the origin. This method is used during the calculations 
       
   557      * to determine a visual's display rectangle.
       
   558      *
       
   559      * @param aPoint  Point to move.
       
   560      * @param aUndo   Which way to offset the point (apply or undo the alignment).
       
   561      */
       
   562     IMPORT_C void AlignByOrigin(THuiRealPoint& aPoint, TBool aUndo = EFalse) const;
       
   563 
       
   564     /**
       
   565      * @deprecated  Use base unit version instead
       
   566      *
       
   567      * Sets the minimum size of the visual.
       
   568      *
       
   569      * @param aMinSize  Minimum size of the visual.
       
   570      */
       
   571     IMPORT_C void SetMinSize(const TSize& aMinSize);
       
   572 
       
   573     /**
       
   574      * Sets the minimum size of the visual.
       
   575      *
       
   576      * @param aMinSize  Minimum size of the visual in base units.
       
   577      */
       
   578     IMPORT_C void SetMinSize(const THuiRealSize& aMinSize);
       
   579 
       
   580     /**
       
   581      * @deprecated  Use base unit version instead
       
   582      *
       
   583      * Returns the minimum size of the visual.
       
   584      */
       
   585     IMPORT_C TSize MinSize() const;
       
   586 
       
   587     /**
       
   588      * Returns the minimum size of the visual in base units.
       
   589      */
       
   590     IMPORT_C THuiRealSize MinSizeInBaseUnits() const __SOFTFP;
       
   591 
       
   592     /**
       
   593      * @deprecated  Use base unit version instead
       
   594      *    
       
   595      * Sets the maximum size of the visual.
       
   596      *
       
   597      * @param aMaxSize  Maximum size of the visual.
       
   598      */
       
   599     IMPORT_C void SetMaxSize(const TSize& aMaxSize);
       
   600 
       
   601     /**
       
   602      * Sets the maximum size of the visual.
       
   603      *
       
   604      * @param aMaxSize  Maximum size of the visual in base units.
       
   605      */
       
   606     IMPORT_C void SetMaxSize(const THuiRealSize& aMaxSize);
       
   607 
       
   608     /**
       
   609      * @deprecated  Use base unit version instead
       
   610      *    
       
   611      * Returns the maximum size of the visual.
       
   612      */
       
   613     IMPORT_C TSize MaxSize() const;
       
   614 
       
   615     /**
       
   616      * Returns the maximum size of the visual in base units.
       
   617      */
       
   618     IMPORT_C THuiRealSize MaxSizeInBaseUnits() const __SOFTFP;
       
   619 
       
   620     /**
       
   621      * Returns the position of the visual. This is set by UpdateLayout().
       
   622      */
       
   623     IMPORT_C const THuiTimedPoint& Pos() const;
       
   624 
       
   625     /**
       
   626      * Returns the size of the visual. This is set by UpdateLayout().
       
   627      */
       
   628     IMPORT_C const THuiTimedPoint& Size() const;
       
   629 
       
   630     inline THuiTimedPoint& Size();
       
   631  
       
   632     /**
       
   633      * Sets the position of the visual.
       
   634      * 
       
   635      * This method should be used only when doing manual layouting. 
       
   636      * If the visuals are under a layout that defines positions for its children (such
       
   637      * as CHuiGridLayout), then the layout class's facilities should be used instead.
       
   638      * 
       
   639      * If you want to move or otherwise layout the visual manually, you should 
       
   640      * set the EHuiVisualFlagManualLayout flag using the SetFlag() method.
       
   641      * 
       
   642      * @note Even if the visual has no parent -- the roster will automatically 
       
   643      * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
       
   644      * will be needed if you want to assign the position yourself.
       
   645      * 
       
   646      * @param aPos             Target position, in the local coordinate system as
       
   647      *                         defined by the parent layout (or the display, 
       
   648      *                         if there is no parent).
       
   649      * @param aTransitionTime  Transition time in milliseconds.
       
   650      */
       
   651     IMPORT_C virtual void SetPos(const THuiRealPoint& aPos, TInt aTransitionTime = 0);
       
   652 
       
   653     /**
       
   654      * Sets the size of the visual.
       
   655      * 
       
   656      * This method should be used only when doing manual layouting. 
       
   657      * If the visuals are under a layout that defines sizes for its children (such
       
   658      * as CHuiGridLayout), then the layout class's facilities should be used instead.
       
   659      *
       
   660      * If you want to move or otherwise layout the visual manually, you should 
       
   661      * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
       
   662      * 
       
   663      * @note Even if the visual has no parent -- the roster will automatically 
       
   664      * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
       
   665      * will be needed if you want to assign the size yourself.
       
   666      * 
       
   667      * @param aSize            New size for this visual, in the local coordinate 
       
   668      *                         system as defined by the parent layout (or the display, 
       
   669      *                         if there is no parent).
       
   670      * @param aTransitionTime  Transition time in milliseconds.
       
   671      */
       
   672     IMPORT_C virtual void SetSize(const THuiRealSize& aSize, TInt aTransitionTime = 0);
       
   673 
       
   674     /**
       
   675      * Sets the position and size of the visual.
       
   676      *
       
   677      * This method should be used only when doing manual layouting. 
       
   678      * If the visuals are under a layout that defines positions and sizes for 
       
   679      * its children (such as CHuiGridLayout), then the layout class's facilities 
       
   680      * should be used instead.
       
   681      *
       
   682      * If you want to move or otherwise layout the visual manually, you should 
       
   683      * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
       
   684      * 
       
   685      * @note Even if the visual has no parent -- the roster will automatically 
       
   686      * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
       
   687      * will be needed if you want to assign the rectangle yourself.
       
   688      * 
       
   689      * @param aRect            Target rectangle, in the local coordinate 
       
   690      *                         system as defined by the parent layout (or the display, 
       
   691      *                         if there is no parent).
       
   692      * @param aTransitionTime  Transition time in milliseconds.
       
   693      */
       
   694     IMPORT_C void SetRect(const THuiRealRect& aRect, TInt aTransitionTime = 0);
       
   695 
       
   696     /**
       
   697      * @deprecated  Use base unit version instead
       
   698      *    
       
   699      * Moves the visual's position.
       
   700      * 
       
   701      * Move() should be used only when doing manual layouting (same goes for 
       
   702      * SetPos() and SetSize()). 
       
   703      * If the visuals are under a layout that defines positions for its children (such
       
   704      * as CHuiGridLayout), then the layout class's facilities should be used instead.
       
   705      * 
       
   706      * If you want to move or otherwise layout the visual manually, you should 
       
   707      * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
       
   708      * 
       
   709      * @note Even if the visual has no parent -- the roster will automatically 
       
   710      * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
       
   711      * will be needed if you want to move this visual.
       
   712      *
       
   713      * @param aOffset          Offset from the current target.
       
   714      * @param aTransitionTime  Transition time in milliseconds.
       
   715      */
       
   716     IMPORT_C void Move(const TPoint& aOffset, TInt aTransitionTime = 0);
       
   717 
       
   718     /**
       
   719      * Moves the visual's position.
       
   720      * 
       
   721      * Move() should be used only when doing manual layouting (same goes for 
       
   722      * SetPos() and SetSize()). 
       
   723      * If the visuals are under a layout that defines positions for its children (such
       
   724      * as CHuiGridLayout), then the layout class's facilities should be used instead.
       
   725      * 
       
   726      * If you want to move or otherwise layout the visual manually, you should 
       
   727      * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
       
   728      * 
       
   729      * @note Even if the visual has no parent -- the roster will automatically 
       
   730      * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
       
   731      * will be needed if you want to move this visual.
       
   732      *
       
   733      * @param aOffset          Offset from the current target.
       
   734      * @param aTransitionTime  Transition time in milliseconds.     
       
   735      */
       
   736     IMPORT_C void Move(const THuiRealPoint& aOffset, TInt aTransitionTime = 0);
       
   737 
       
   738     /**
       
   739      * Positions and sizes this visual to match another.
       
   740      * 
       
   741      * This method should be used only when doing manual layouting. If the visuals are under 
       
   742      * a layout, then the layout class's facilities should be used instead.
       
   743      *
       
   744      * If you want to move or otherwise layout the visual manually, you should 
       
   745      * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
       
   746      * 
       
   747      * @note Even if the visual has no parent -- the roster will automatically 
       
   748      * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
       
   749      * will be needed if you want to mimic other visuals.
       
   750      * 
       
   751      * @param aVisual  Visual whose position and size to copy.
       
   752      */
       
   753     IMPORT_C void Mimic(const CHuiVisual& aVisual, TInt aTransitionTime = 0);
       
   754 
       
   755     /**
       
   756      * @deprecated  Use base unit version instead
       
   757      *        
       
   758      * Sets the position and size of the visual.
       
   759      * 
       
   760      * This method should be used only when doing manual layouting. If the visuals are under 
       
   761      * a layout, then the layout class's facilities should be used instead.
       
   762      *
       
   763      * If you want to move or otherwise layout the visual manually, you should 
       
   764      * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
       
   765      * 
       
   766      * @note Even if the visual has no parent -- the roster will automatically 
       
   767      * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
       
   768      * will be needed if you want to assign the position and size yourself.
       
   769      *
       
   770      * @param aCenterPoint     New center point of the visual.
       
   771      * @param aSize            New size of the visual.
       
   772      * @param aTransitionTime  Number of milliseconds for transitioning to new values.
       
   773      */
       
   774     IMPORT_C void SetCenteredPosAndSize(const TPoint& aCenterPoint,
       
   775                                         const TSize& aSize,
       
   776                                         TInt aTransitionTime = 0);
       
   777     /**
       
   778      * Sets the position and size of the visual.
       
   779      * 
       
   780      * This method should be used only when doing manual layouting. If the visuals are under 
       
   781      * a layout, then the layout class's facilities should be used instead.
       
   782      *
       
   783      * If you want to move or otherwise layout the visual manually, you should 
       
   784      * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
       
   785      * 
       
   786      * @note Even if the visual has no parent -- the roster will automatically 
       
   787      * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
       
   788      * will be needed if you want to assign the position and size yourself.
       
   789      *
       
   790      * @param aCenterPoint     New center point of the visual in metric units.
       
   791      * @param aSize            New size of the visual in metric units.
       
   792      * @param aTransitionTime  Number of milliseconds for transitioning to new values.     
       
   793      */
       
   794     IMPORT_C void SetCenteredPosAndSize(const THuiRealPoint& aCenterPoint,
       
   795                                         const THuiRealSize& aSize,
       
   796                                         TInt aTransitionTime = 0);
       
   797 
       
   798     /**
       
   799      * Update the layout of all children. Subclasses can call this to
       
   800      * recalculate the layout of all children.
       
   801      *
       
   802      * @param aTransitionTime  Time for layout transition.
       
   803      *      CHuiStatic::LayoutTransitionTime() should be used
       
   804      *      as the default value, if an immediate transition is not required.
       
   805      *
       
   806      * @see CHuiStatic::LayoutTransitionTime()
       
   807      */
       
   808     IMPORT_C virtual void UpdateChildrenLayout(TInt aTransitionTime = 0);
       
   809 
       
   810     /**
       
   811      * For convenience. Updates the layout of the siblings of this visual. In other words,
       
   812      * asks the parent layout to do a children layout.
       
   813      *
       
   814      * @param aTransitionTime  Time for layout transition.
       
   815      */
       
   816     IMPORT_C void UpdateSiblingLayout(TInt aTransitionTime = 0);
       
   817 
       
   818     /**
       
   819      * Calculates the visual's bounding rectangle in display coordinates.
       
   820      * Display coordinates are defined relative to the display's visible area.
       
   821      * Uses the current values of the position and size. Only calculated once 
       
   822      * per frame. The rect is always in pixels.
       
   823      */
       
   824     IMPORT_C THuiRealRect DisplayRect() const __SOFTFP;
       
   825 
       
   826     /**
       
   827      * Calculates the visual's bounding rectangle animation target 
       
   828      * in display coordinates. Display coordinates are defined 
       
   829      * relative to the display's visible area. Uses the target 
       
   830      * values of the rectangle position and size, which means 
       
   831      * transitions are always immediate in the returned rectangle. 
       
   832      * Only calculated once per frame. The rect is always in pixels.
       
   833      */
       
   834     IMPORT_C THuiRealRect DisplayRectTarget() const __SOFTFP;
       
   835     
       
   836     /**
       
   837      * Determines the base unit of the local coordinate system, in which
       
   838      * this visual's position and size are stored. The position and size
       
   839      * of the visual are multiplied by this metric to get the actual
       
   840      * position and size.
       
   841      *
       
   842      * @return  Base unit of the local coordinate system, as defined by the
       
   843      *          parent layout, or the display if there is no parent.
       
   844      */
       
   845     IMPORT_C THuiXYMetric LocalBaseUnit() const;
       
   846 
       
   847     /**
       
   848      * ! deprecated, use method with THuiReferenceState instead
       
   849      */
       
   850     IMPORT_C THuiRealPoint LocalPointInPixels(const THuiRealPoint& aLocalPoint) const __SOFTFP;
       
   851 
       
   852     /**
       
   853      * Converts a point in the local coordinate system to pixels in the 
       
   854      * local coordinate system. The local coordinate system is relative to 
       
   855      * the top left corner of the parent. This method only
       
   856      * does a unit conversion from the base units to pixels.
       
   857      *
       
   858      * @param aLocalPoint  Point to convert, which is using the local
       
   859      *                     base unit.
       
   860      * @param aReferenceState Defines whether now or target value is used in case 
       
   861      *                        there are metrics transformations taking place
       
   862      *
       
   863      * @return  @c aLocalPoint converted to pixels in the local coordinate system.
       
   864      */
       
   865     IMPORT_C THuiRealPoint LocalPointInPixels(const THuiRealPoint& aLocalPoint, 
       
   866                                               THuiReferenceState aReferenceState) const __SOFTFP;
       
   867     
       
   868 
       
   869     /**
       
   870      * ! deprecated, use method with THuiReferenceState instead
       
   871      */
       
   872     IMPORT_C THuiRealPoint PixelPointInLocal(const THuiRealPoint& aPixelPoint) const __SOFTFP;
       
   873 
       
   874     /**
       
   875      * Converts a pixel point in the local coordinate system to a point that
       
   876      * uses the base unit of the local coordinate system. 
       
   877      * The local coordinate system is relative to the top left corner 
       
   878      * of the parent. This method only does a unit conversion from pixels to
       
   879      * the base units.
       
   880      *
       
   881      * @param aPixelPoint  Point to convert, which is in pixels.
       
   882      * @param aReferenceState Defines whether now or target value is used in case 
       
   883      *                        there are metrics transformations taking place
       
   884      *
       
   885      * @return @c aPixelPoint converts to the local base unit.
       
   886      */
       
   887     IMPORT_C THuiRealPoint PixelPointInLocal(const THuiRealPoint& aPixelPoint,
       
   888                                              THuiReferenceState aReferenceState) const __SOFTFP;
       
   889 
       
   890 
       
   891     /**
       
   892      * Converts a pixel point to a specific unit.
       
   893      *
       
   894      * @param aPixelPoint  Point to convert, in pixels.
       
   895      * @param aUnit        Unit to which the point is to be converted.
       
   896      * @param aReferenceState Defines whether now or target value is used in case 
       
   897      *                        there are metrics transformations taking place
       
   898      *
       
   899      * @return  The point as a multiple of @c aUnit.
       
   900      */
       
   901     THuiRealPoint PixelPointInUnits(const THuiRealPoint& aPixelPoint, 
       
   902         const THuiXYMetric& aUnit, THuiReferenceState aReferenceState) const __SOFTFP;
       
   903 
       
   904 
       
   905     /**
       
   906      * ! deprecated, use method with THuiReferenceState instead
       
   907      */
       
   908     IMPORT_C THuiRealPoint MetricToPixels(const THuiXYMetric& aMetric) const __SOFTFP;
       
   909 
       
   910     /**
       
   911      * Converts an XY metric to a pixel point.
       
   912      *
       
   913      * @param aMetric  Metric to convert.
       
   914      * @param aReferenceState Defines whether now or target value is used in case 
       
   915      *                        there are metrics transformations taking place
       
   916      *
       
   917      * @return  The metric in pixels.
       
   918      */
       
   919     IMPORT_C THuiRealPoint MetricToPixels(const THuiXYMetric& aMetric,
       
   920                                           THuiReferenceState aReferenceState) const __SOFTFP;
       
   921 
       
   922     /**
       
   923      * ! deprecated, use method with THuiReferenceState instead
       
   924      */
       
   925     IMPORT_C void PixelsToMetric(const THuiRealPoint& aPixels, THuiXYMetric& aMetric) const;
       
   926 
       
   927     /**
       
   928      * Converts a pixel point to an XY metric. The destination unit of the 
       
   929      * conversion is taken from the @c aMetric parameter.
       
   930      *
       
   931      * @param aPixels  Pixel point to convert.
       
   932      * @param aMetric  The result is written here. Only the magnitudes of the
       
   933      *                 metric are modified. The @c iUnit of the conversion 
       
   934      *                 is read from this metric.
       
   935      */
       
   936     IMPORT_C void PixelsToMetric(const THuiRealPoint& aPixels, THuiXYMetric& aMetric,
       
   937                                  THuiReferenceState aReferenceState) const;
       
   938     
       
   939  
       
   940      /**
       
   941      * ! deprecated, use method with THuiReferenceState instead
       
   942      */
       
   943     IMPORT_C THuiRealPoint MetricReferenceInPixels(const THuiXYMetric& aMetric) const __SOFTFP;               
       
   944    
       
   945     
       
   946     /**
       
   947      * Calculates the reference size for a metric. The reference size is, for
       
   948      * example, the size of the parent layout in the case of the 
       
   949      * EHuiUnitNormalized unit.
       
   950      * 
       
   951      * @param aMetric  Metric whose reference size is to be determined.
       
   952      * @param aReferenceState Defines whether now or target value is used in case 
       
   953      *                        there are metrics transformations taking place
       
   954      * 
       
   955      * @return  Reference size.
       
   956      */
       
   957     IMPORT_C THuiRealPoint MetricReferenceInPixels(const THuiXYMetric& aMetric,               
       
   958                                  THuiReferenceState aReferenceState) const __SOFTFP;
       
   959 
       
   960     /**
       
   961      * Converts local coordinates to display coordinates. This method is used
       
   962      * for calculating the position of the visual on the display when the visual
       
   963      * is about to be drawn. Display coordinates are defined relative to the 
       
   964      * display's visible area.
       
   965      *
       
   966      * @param aPoint  Point in the local coordinate system. This might be,
       
   967      *                for example, the position or size of this visual.
       
   968      *
       
   969      * @return  The point in the display's coordinate system, in pixels.
       
   970      */
       
   971     IMPORT_C TPoint LocalToDisplay(const TPoint& aPoint) const;
       
   972 
       
   973     /**
       
   974      * Converts local coordinates to display coordinates. This method is used
       
   975      * for calculating the position of the visual on the display when the visual
       
   976      * is about to be drawn. Display coordinates are defined relative to the 
       
   977      * display's visible area.
       
   978      *
       
   979      * @param aPoint  Point in the local coordinate system. This might be,
       
   980      *                for example, the position or size of this visual.
       
   981      *
       
   982      * @return  The point in the display's coordinate system, in pixels.
       
   983      */
       
   984     IMPORT_C THuiRealPoint LocalToDisplay(const THuiRealPoint& aPoint) const __SOFTFP;
       
   985 
       
   986     /**
       
   987      * Converts display coordinates to local coordinates. This method can be
       
   988      * used when determining where a particular point on the display is 
       
   989      * in the local coordinate system of a layout, for instance when handling
       
   990      * pointer input events. Display coordinates are defined relative to 
       
   991      * the display's visible area.
       
   992      *
       
   993      * @param aPoint  Point in the display coordinate system. 
       
   994      *
       
   995      * @return  The point in this visual's local coordinate system, in the
       
   996      *          base units of the parent layout (or display, if there is
       
   997      *          no parent layout).
       
   998      */
       
   999     IMPORT_C TPoint DisplayToLocal(const TPoint& aPoint) const;
       
  1000 
       
  1001     /**
       
  1002      * Converts display coordinates to local coordinates. This method can be
       
  1003      * used when determining where a particular point on the display is 
       
  1004      * in the local coordinate system of a layout, for instance when handling
       
  1005      * pointer input events. Display coordinates are defined relative to 
       
  1006      * the display's visible area.
       
  1007      *
       
  1008      * @param aPoint  Point in the display coordinate system. 
       
  1009      *
       
  1010      * @return  The point in this visual's local coordinate system, in the
       
  1011      *          base units of the parent layout (or display, if there is
       
  1012      *          no parent layout).
       
  1013      */
       
  1014     IMPORT_C THuiRealPoint DisplayToLocal(const THuiRealPoint& aPoint) const __SOFTFP;
       
  1015 
       
  1016 
       
  1017     IMPORT_C void BoxMetricToPixelRect(const THuiBoxMetric& aBox, 
       
  1018         THuiRealRect& aRectInPixels) const;
       
  1019 
       
  1020     /**
       
  1021      * Converts a box metric to a pixel rectangle. This method is used for
       
  1022      * converting visual padding boxes to pixels.
       
  1023      *
       
  1024      * @param aBox  Box metric to be interpreted in the context of this visual.
       
  1025      * @param aRectInPixels  Resulting rectangle in pixels. Note that the width
       
  1026      *                       and height of this box are meaningless, because 
       
  1027      *                       each of the four sides is defined independently of
       
  1028      *                       each other.
       
  1029      * @param aReferenceState Defines whether now or target value is used in case 
       
  1030      *                        there are metrics transformations taking place
       
  1031      */
       
  1032     IMPORT_C void BoxMetricToPixelRect(const THuiBoxMetric& aBox, 
       
  1033         THuiRealRect& aRectInPixels, THuiReferenceState aReferenceState) const;
       
  1034 
       
  1035     /**
       
  1036      * Converts a box metric to a rectangle in local coordinates. This method
       
  1037      * is used for converting visual padding boxes to local coordinate units
       
  1038      * when doing layout.
       
  1039      *
       
  1040      * @param aBox  Box metric to be interpreted in the context of this visual.
       
  1041      * @param aLocalRect  Top, left, right, and bottom values of the box in 
       
  1042      *                    the visual's local coordinate system.
       
  1043      *                    Note that the width and height of this box are meaningless, 
       
  1044      *                    because each of the four sides is defined independently of
       
  1045      *                    each other.
       
  1046      */
       
  1047     /*IMPORT_C void BoxMetricToLocalRect(const THuiBoxMetric& aBox,
       
  1048         THuiRealRect& aLocalRect) const;*/
       
  1049 
       
  1050     /**
       
  1051      * Moves the visual to the front inside its parent layout. 
       
  1052      * In other words, the visual becames the last child of the parent.
       
  1053      * Causes layout recalculation.
       
  1054      */
       
  1055     IMPORT_C void MoveToFront(TInt aTransitionTime = 0);
       
  1056 
       
  1057     /**
       
  1058      * Returns the position of the visual.
       
  1059      */
       
  1060     inline THuiTimedPoint& Pos();
       
  1061 
       
  1062     /**
       
  1063      * Returns the opacity of the visual, taking into account the opacity
       
  1064      * of parent visuals.
       
  1065      *
       
  1066      * @return  Effective opacity level of the visual.
       
  1067      */
       
  1068     IMPORT_C TReal32 EffectiveOpacity() const __SOFTFP;
       
  1069 
       
  1070     /**
       
  1071      * Sets the clipping mode of the layout.
       
  1072      *
       
  1073      * @param aClipping  <code>ETrue</code> to hide children that are outside
       
  1074      *                   the layout's real size.
       
  1075      */
       
  1076     IMPORT_C void SetClipping(TBool aClipping = ETrue);
       
  1077 
       
  1078     /**
       
  1079      * Determines whether the visual is clipping its contents.
       
  1080      */
       
  1081     IMPORT_C TBool Clipping() const;
       
  1082 
       
  1083     /**
       
  1084      * Enables or disables transformation of the visual.
       
  1085      */
       
  1086     IMPORT_C void EnableTransformationL(TBool aIsTransformed = ETrue);
       
  1087 
       
  1088     /**
       
  1089      * Returns the transformation of the visual.
       
  1090      *
       
  1091      * @panic  THuiPanic::EVisualTransformNotEnabled
       
  1092      */
       
  1093     IMPORT_C CHuiTransformation& Transformation();
       
  1094 
       
  1095     /**
       
  1096      * Sets the number of pixels that the visual uses for padding its contents.
       
  1097      * Sets both the horizontal and vertical padding.
       
  1098      *
       
  1099      * @param aPadding  Number of padding pixels.
       
  1100      */
       
  1101     IMPORT_C void SetPadding(TInt aPadding);
       
  1102 
       
  1103     /**
       
  1104      * Sets the number of pixels that the visual uses for padding its contents.
       
  1105      * Sets the horizontal and vertical padding separately.
       
  1106      *
       
  1107      * @param aPadding  Number of padding pixels.
       
  1108      */
       
  1109     IMPORT_C void SetPadding(const TPoint& aPadding);
       
  1110 
       
  1111     /**
       
  1112      * Sets the amount of padding that the visual uses for padding its contents.
       
  1113      * The box metric can have a different amount on all sides.
       
  1114      *
       
  1115      * @note as paddings are relative to the visual, if relative units are required for a layout, 
       
  1116      * it is advisable to use EHuiUnitRelativeToMySize so that the paddings are relative
       
  1117      * to the size of this layout visual
       
  1118      *
       
  1119      * @param aPadding  Amount of padding.
       
  1120      */
       
  1121     IMPORT_C void SetPadding(const THuiBoxMetric& aPadding);
       
  1122 
       
  1123     /**
       
  1124      * Returns the padding of the visual.
       
  1125      *
       
  1126      * @return  Padding as a box metric.
       
  1127      */
       
  1128     IMPORT_C const THuiBoxMetric& Padding() const;
       
  1129 
       
  1130      /**
       
  1131      * ! deprecated, use method with THuiReferenceState instead
       
  1132      */
       
  1133     IMPORT_C THuiRealRect PaddingInPixels() const __SOFTFP;
       
  1134 
       
  1135     /**
       
  1136      * Returns the padding of the visual, in pixels.
       
  1137      *
       
  1138      * @param aReferenceState Defines whether now or target value is used in case 
       
  1139      *                        there are metrics transformations taking place
       
  1140      * @return  Padding, in pixels. iTl.iX is the left padding, iTl.iY is 
       
  1141      *          the top padding, iBr.iX is the right padding, and iBr.iY
       
  1142      *          is the bottom padding. The width and height of the returned 
       
  1143      *          rectangle are meaningless.
       
  1144      */
       
  1145     IMPORT_C THuiRealRect PaddingInPixels(THuiReferenceState aReferenceState) const __SOFTFP;
       
  1146 
       
  1147 	/**
       
  1148 	 * PrepareDrawL prepares the visual for drawing (screen refresh).
       
  1149 	 * Can be used to update the visual or execute any Leaving 
       
  1150 	 * operations such as resource allocation needed for the 
       
  1151 	 * actual drawing.
       
  1152 	 * 
       
  1153 	 * @return ETrue if the prepare succeeded, or EFail if 
       
  1154 	 * the prepare failed. Failing to prepare a draw 
       
  1155 	 * terminates the screen refresh and drawing 
       
  1156 	 * for the frame that is currently been drawn.
       
  1157 	 * 
       
  1158 	 * By default the base class PrepareDrawL does not do anything.
       
  1159 	 */
       
  1160 	IMPORT_C virtual TBool PrepareDrawL();
       
  1161 
       
  1162     /**
       
  1163      * Draws the visual. 
       
  1164      * 
       
  1165      * This default implementation applies local transformation,
       
  1166      * draws foreground brushes (over the content), 
       
  1167      * background brushes (under the content) and 
       
  1168      * content itself (by calling DrawSelf()) with clipping.
       
  1169      * 
       
  1170      * @note DrawSelf() should bee overridden by subclasses to 
       
  1171      * draw the content of the visual.
       
  1172      * 
       
  1173      * @see DrawSelf()
       
  1174      * @see PrepareDrawL()
       
  1175      */
       
  1176     IMPORT_C virtual void Draw(CHuiGc& aGc) const;
       
  1177 
       
  1178     /**
       
  1179      * Draws a layer of brushes for the visual.
       
  1180      *
       
  1181      * @param aGc     Graphics context.
       
  1182      * @param aLayer  Brush layer.
       
  1183      */
       
  1184     IMPORT_C void DrawBrushes(CHuiGc& aGc, THuiBrushLayer aLayer) const;
       
  1185 
       
  1186     /**
       
  1187      * Overridden by subclasses to draw the content of the visual.
       
  1188      * By default the base class DrawSelf does not draw anything.
       
  1189      * 
       
  1190      * @param aGc 			The graphics context to be used to draw the visual.
       
  1191      * @param aDisplayRect  The bounding rectangle of the visual content,
       
  1192      * 						in display coordinates. Same as calling 
       
  1193      *                      CHuiVisual::DisplayRect().
       
  1194      * 
       
  1195      * @note DrawSelf won't be called for fully transparent visuals.
       
  1196      * @see Draw()
       
  1197      * @see PrepareDrawL()
       
  1198      */
       
  1199     IMPORT_C virtual void DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const;
       
  1200 
       
  1201     /**
       
  1202      * Raises the change flag for this visual. Visual will be updated as soon
       
  1203      * as possible.
       
  1204      */
       
  1205     IMPORT_C virtual void SetChanged();
       
  1206 
       
  1207     /**
       
  1208      * Determines if the visual has changed since the last change
       
  1209      * notification. Changed means becoming dirty, so that the area
       
  1210      * of the visual has to be redrawn.
       
  1211      */
       
  1212     IMPORT_C virtual TBool Changed() const;
       
  1213 
       
  1214     /**
       
  1215      * Called to inform the display that a dirty region has to be defined.
       
  1216      */
       
  1217     IMPORT_C virtual void ReportChanged();
       
  1218 
       
  1219     /**
       
  1220      * Clears the changed status of the visual. This is called automatically
       
  1221      * by the refresh loop after a frame has been drawn.
       
  1222      */
       
  1223     IMPORT_C virtual void ClearChanged();
       
  1224 
       
  1225     /**
       
  1226      * Enables or disables brushes for the visual.
       
  1227      */
       
  1228     IMPORT_C void EnableBrushesL(TBool aEnabled = ETrue);
       
  1229 
       
  1230     /**
       
  1231      * Returns the brushes of the visual.
       
  1232      *
       
  1233      * @return  Brush array. <code>NULL</code>, if not enabled.
       
  1234      */
       
  1235     IMPORT_C CHuiBrushArray* Brushes();
       
  1236 
       
  1237     /**
       
  1238      * Debug method for dumping the structure of a visual tree into the
       
  1239      * console.
       
  1240      */
       
  1241     IMPORT_C virtual void DumpTree() const;
       
  1242 
       
  1243     IMPORT_C virtual void GetInstanceName(TDes& aName) const;
       
  1244 
       
  1245     /**
       
  1246      * Returns the name of the class.
       
  1247      *
       
  1248      * @param aName  Name of the visual class.
       
  1249      */
       
  1250     IMPORT_C virtual void GetClassName(TDes& aName) const;
       
  1251 
       
  1252     /**
       
  1253      * Applies or restores the local projection of the visual.
       
  1254      */
       
  1255     IMPORT_C void EnterLocalProjection(CHuiGc& aGc, TBool aApply,
       
  1256                                        TReal32 aExtraOffset = 0.0,
       
  1257                                        const THuiRealRect* aVisibleRect = 0) const __SOFTFP;
       
  1258 
       
  1259     /**
       
  1260      * Notifies the visual that the environment's skin has been changed
       
  1261      * or updated. The visual should update its state (e.g., fonts)
       
  1262      * accordingly.
       
  1263      */
       
  1264     IMPORT_C virtual void NotifySkinChangedL();
       
  1265     
       
  1266     
       
  1267     /**
       
  1268      * Sets an automatic tactile feedback. If this visual is a layout,
       
  1269      * the feedback affects to the child visuals as well. This can 
       
  1270      * be overridden in child visuals.
       
  1271      * 
       
  1272      * @param aEventType Event which triggers the automatic feedback.
       
  1273      * @param aFeedbackType Feedback type.
       
  1274      *
       
  1275      * @see TTouchEventType from touchlogicalfeedback.h
       
  1276      * @see TTouchLogicalFeedback from touchlogicalfeedback.h
       
  1277      */
       
  1278     IMPORT_C void SetTactileFeedbackL( TInt aEventType, TInt aFeedbackType );
       
  1279         
       
  1280     /**
       
  1281      * Checks whether a tactile feedback has been assigned.
       
  1282      * Eventhough, this returns EFalse the layout may have feedback defined.
       
  1283      * @param aEventType Event type which needs to match
       
  1284      *        If KHuiTactileFeedbackEventTypeNone, the event type is irrelevant.
       
  1285      * 
       
  1286      * @return ETrue if the visual has a tactile feedback defined.
       
  1287      */
       
  1288     IMPORT_C TBool HasTactileFeedback( 
       
  1289         TInt aEventType = KHuiTactileFeedbackEventTypeNone ) const;
       
  1290        
       
  1291     /**
       
  1292      * Removes tactile feedback for the visual.
       
  1293      * 
       
  1294      * @param aEventType Event type which feedback to remove.
       
  1295      *        If KHuiTactileFeedbackEventTypeNone, all the feedbacks are removed.
       
  1296      */
       
  1297     IMPORT_C void RemoveTactileFeedback( TInt aEventType = KHuiTactileFeedbackEventTypeNone );
       
  1298     
       
  1299     /**
       
  1300      * Enables the drop shadow. Currently implemented for the image and text visuals.
       
  1301      * 
       
  1302      * @param aEnable ETrue to enable, EFalse to disable.
       
  1303      */
       
  1304     IMPORT_C void EnableDropShadowL( TBool aEnable = ETrue );
       
  1305     
       
  1306     /**
       
  1307      * Returns the drop shadow parameter handler.
       
  1308      *
       
  1309      * @return Drop shadow handler. NULL if drop shadow is disabled.
       
  1310      */
       
  1311     IMPORT_C CHuiDropShadow* DropShadowHandler() const;
       
  1312 
       
  1313 public: // From MHuiBrushGuide. 
       
  1314 
       
  1315     IMPORT_C TReal32 BrushOpacity() const __SOFTFP;
       
  1316 
       
  1317     IMPORT_C THuiRealRect BrushRect() const __SOFTFP;
       
  1318 
       
  1319     IMPORT_C CHuiSkin& BrushSkin() const;
       
  1320 
       
  1321 public: // From MHuiSessionObject
       
  1322     
       
  1323     /**
       
  1324      * Gets the object type.
       
  1325      */
       
  1326     IMPORT_C TType Type() const;
       
  1327 
       
  1328     /**
       
  1329      * Gets the session id for object.
       
  1330      */
       
  1331     IMPORT_C TInt SessionId() const;
       
  1332 
       
  1333     /**
       
  1334      * Sets the session id for object.
       
  1335      */
       
  1336     IMPORT_C void SetSessionId(TInt aSessionId);
       
  1337 
       
  1338     /** @endAPI */
       
  1339 
       
  1340 public: // Internal utilities
       
  1341 
       
  1342     /**
       
  1343      * Reports a layout update to the owner. The owner is notified of
       
  1344      * the layout update if the layout update notification flag is set
       
  1345      * for the visual.
       
  1346      *
       
  1347      * @see EHuiVisualFlagLayoutUpdateNotification
       
  1348      */
       
  1349     void ReportLayoutUpdate();
       
  1350 
       
  1351 
       
  1352     /* Static member functions. */
       
  1353 
       
  1354     /**
       
  1355      * Calculate dual alpha levels. Used when crossfading images.
       
  1356      */
       
  1357     IMPORT_C static void GetDualAlpha(TReal32 aOpacity, TReal32 aSecondary,
       
  1358                              TInt& aPrimaryAlpha, TInt& aSecondaryAlpha);
       
  1359                              
       
  1360    /**
       
  1361     * Return tactile feedback of the event. Checks the parent layouts
       
  1362     * if this visual has not defined a feedback.
       
  1363     * @param aEventType Event type 
       
  1364     * @return Feedback type. KErrNotFound if not found.
       
  1365     */
       
  1366    TInt TactileFeedback( TInt aEventType ) const;
       
  1367    
       
  1368       
       
  1369    /**
       
  1370     * Finds a tacticon from this visual.
       
  1371     * @param aEventType Event type to match
       
  1372     * @return Index of the found event. KErrNotFound if not found-
       
  1373     */
       
  1374    TInt FindTacticon( TInt aEventType ) const;
       
  1375 
       
  1376     /**
       
  1377      * Gets the visual's bounding rectangle in display coordinates that were
       
  1378      * calculated during previous frame.
       
  1379      * Display coordinates are defined relative to the display's visible area.
       
  1380      * Uses the current values of the position and size. Only calculated once 
       
  1381      * per frame. The rect is always in pixels.
       
  1382      */
       
  1383    THuiRealRect CachedDisplayRect() const;
       
  1384 
       
  1385     /**
       
  1386      * Returns the brushes of the visual.
       
  1387      *
       
  1388      * @return  Brush array. <code>NULL</code>, if not enabled.
       
  1389      */
       
  1390     CHuiBrushArray* Brushes() const; 
       
  1391 
       
  1392     /**
       
  1393      *  Returns the currently active effect for the visual
       
  1394      *  or NULL if no effect is active.
       
  1395      *
       
  1396      *  @return CEffect instance or NULL.
       
  1397      */
       
  1398     IMPORT_C CHuiFxEffect* Effect() const;
       
  1399 
       
  1400     IMPORT_C MHuiEffectable *Effectable() const;
       
  1401 
       
  1402     IMPORT_C CHuiCanvasRenderBuffer *StoredRenderBuffer() const;
       
  1403     IMPORT_C void SetStoredRenderBuffer(CHuiCanvasRenderBuffer *aRenderBuffer);
       
  1404     IMPORT_C void SetStoredRenderBufferModificationsEnabled(TBool aEnabled);
       
  1405     IMPORT_C void SetFreezeState(TBool aEnabled);
       
  1406     IMPORT_C TBool Freezed() const;
       
  1407 
       
  1408     /**
       
  1409      *  Assign an effect for the visual. The ownership of the
       
  1410      *  effect is transferred to the visual.
       
  1411      *
       
  1412      *  @param aEffect Effect instance.
       
  1413      */
       
  1414     IMPORT_C void SetEffect(CHuiFxEffect* aEffect);
       
  1415 
       
  1416     /**
       
  1417      * Assign the effect parser to the visual. The ownership is transferred to the visual
       
  1418      * This must be done because the parsing is asynchronous, and we must be sure that the 
       
  1419      * visual is still alive when the parsing completes.
       
  1420      * 
       
  1421      * @param aEffectParser Effect parser instance
       
  1422      * 
       
  1423      */
       
  1424     void SetEffectParser( CHuiFxEffectParser* aEffectParser );
       
  1425     
       
  1426 #ifdef HUI_DEBUG_TRACK_DRAWING
       
  1427     inline void SetTracking( TBool aValue )
       
  1428         {
       
  1429         iTrackVisual = aValue;
       
  1430         }
       
  1431        
       
  1432     inline TBool Tracking( ) const
       
  1433         {
       
  1434         return iTrackVisual;
       
  1435         }
       
  1436 #endif      
       
  1437 
       
  1438     inline TBool LoadingEffect() const
       
  1439         {
       
  1440         return iLoadingEffect;
       
  1441         };
       
  1442     inline void SetLoadingEffect( TBool aLoading )
       
  1443         {
       
  1444         iLoadingEffect = aLoading;
       
  1445         };
       
  1446     
       
  1447 protected:
       
  1448 
       
  1449     /* Transformation. */
       
  1450 
       
  1451     /** @beginAPI */
       
  1452 
       
  1453     /**
       
  1454      * Applies or restores the local transformation matrix of the visual.
       
  1455      * Should be called before and after drawing the visual.
       
  1456      *
       
  1457      * @param aGc     Graphics context.
       
  1458      * @param aApply  <code>ETrue</code>, if the local transformation should
       
  1459      *                be applied; <code>EFalse</code>, if it should be
       
  1460      *                removed.
       
  1461      */
       
  1462     IMPORT_C void Transform(CHuiGc& aGc, TBool aApply,
       
  1463                             const THuiRealRect* aVisibleRect = 0) const;
       
  1464 
       
  1465     /** @endAPI */
       
  1466 
       
  1467 
       
  1468 protected:
       
  1469 
       
  1470     /* Protected methods. */
       
  1471 
       
  1472     /**
       
  1473      * Expands the dirty region of the visual depending on the content of
       
  1474      * the visual. This includes any brushes attached to the visual. Used
       
  1475      * during dirty region reporting.
       
  1476      *
       
  1477      * @param aRect  Dirty region.
       
  1478      */
       
  1479     IMPORT_C virtual void ExpandRectWithContent(TRect& aRect) const;
       
  1480 
       
  1481     /**
       
  1482      * Applies mirroring to a coordinate point according to the base unit
       
  1483      * of the local coordinate system. 
       
  1484      *
       
  1485      * @param aPixels  Point to mirror in pixels. The mirrored result is
       
  1486      *                 returned here.
       
  1487      * @param aReferenceState Defines whether now or target value is used in case 
       
  1488      *                        there are metrics transformations taking place
       
  1489      */
       
  1490     void ApplyMirroring(THuiRealPoint& aPixels, THuiReferenceState aReferenceState) const;
       
  1491 
       
  1492     IMPORT_C virtual void VisualExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
       
  1493    
       
  1494    /*
       
  1495     * Convert a metric, measured in its own units, using a metric reference value suitable for 
       
  1496     * that unit, into pixels.
       
  1497     *
       
  1498     * @note aReference will usually be supplied by calling MetricReferenceInPixels, or in the case of
       
  1499     * a layout that needs to convert from pixels into the metric for its child visuals, will be supplied by 
       
  1500     * calling CHuiLayout::MetricReferenceForLayoutInPixels
       
  1501     *
       
  1502     * @param aResult output the result of the calculation in pixels
       
  1503     * @param aMetric the metric to convert
       
  1504     * @param aReference the reference value, which must correspond to the unit type in the 
       
  1505     *       provided metric, and which must always be supplied in pixels
       
  1506     *
       
  1507     */
       
  1508    static void ConvertMetricLengthToPixels(TReal32& aResult, const THuiMetric& aMetric, TReal32 aReference);
       
  1509    
       
  1510    /*
       
  1511     * Convert a value measured in pixels, into a metric value (whose unit type is supplied), using a 
       
  1512     * metric reference value suitable for that unit type.
       
  1513     *
       
  1514     * @note aReference will usually be supplied by calling MetricReferenceInPixels, or in the case of
       
  1515     * a layout that needs to convert from pixels into the metric for its child visuals, will be supplied by 
       
  1516     * calling CHuiLayout::MetricReferenceForLayoutInPixels
       
  1517     *
       
  1518     * @param aResult when input, the metric unit type is used as the required unit type, and is not modified.
       
  1519     *       The metric magnitude is replaced with the result of the calculation in that unit type
       
  1520     * @param aPixles the pixel quantity to convert
       
  1521     * @param aReference the reference value, which must correspond to the unit type in the 
       
  1522     *       provided metric, and which must always be supplied in pixels
       
  1523     */
       
  1524    static void ConvertPixelsToMetricLength(THuiMetric& aResult, TReal32 aPixels, TReal32 aReference);
       
  1525 
       
  1526    TBool IsDelayedEffectSource() const;
       
  1527 
       
  1528 private:
       
  1529 
       
  1530     /**
       
  1531      * Converts local coordinates to display coordinates. This method is used
       
  1532      * for calculating the position of the visual on the display when the visual
       
  1533      * is about to be drawn. Display coordinates are defined relative to the 
       
  1534      * display's visible area.
       
  1535      *
       
  1536      * @param aPoint  Point in the local coordinate system. This might be,
       
  1537      *                for example, the position or size of this visual.
       
  1538      * @param aReferenceState Defines whether now or target value is used in case 
       
  1539      *                        there are metrics transformations taking place
       
  1540      *
       
  1541      * @return  The point in the display's coordinate system, in pixels.
       
  1542      */
       
  1543     THuiRealPoint LocalToDisplay(const THuiRealPoint& aPoint,
       
  1544         THuiReferenceState aReferenceState) const;
       
  1545 
       
  1546 
       
  1547     /**
       
  1548      * Converts display coordinates to local coordinates. This method can be
       
  1549      * used when determining where a particular point on the display is 
       
  1550      * in the local coordinate system of a layout, for instance when handling
       
  1551      * pointer input events. Display coordinates are defined relative to 
       
  1552      * the display's visible area.
       
  1553      *
       
  1554      * @param aPoint  Point in the display coordinate system. 
       
  1555      * @param aReferenceState Defines whether now or target value is used in case 
       
  1556      *                        there are metrics transformations taking place
       
  1557      *
       
  1558      * @return  The point in this visual's local coordinate system, in the
       
  1559      *          base units of the parent layout (or display, if there is
       
  1560      *          no parent layout).
       
  1561      */
       
  1562     THuiRealPoint DisplayToLocal(const THuiRealPoint& aPoint,
       
  1563             THuiReferenceState aReferenceState) const;
       
  1564 
       
  1565 
       
  1566     /**
       
  1567      * Determines if the visuals parent has changed since the last change
       
  1568      * notification so that it may require also this visual to report itself
       
  1569      * as changed.
       
  1570      */
       
  1571     TBool ParentChanged() const;
       
  1572 
       
  1573     /**
       
  1574      * Checks if this visual is transformed.
       
  1575      */
       
  1576     TBool IsTransformed() const;
       
  1577     
       
  1578     /**
       
  1579      * Retruns pointer to transformation if this visual is transformed. Otherwise NULL is returned.
       
  1580      */
       
  1581     CHuiTransformation* Transformation() const;
       
  1582 
       
  1583     /**
       
  1584      * Handle flags changes.
       
  1585      * @param aOldFlags flags previous to the changes.
       
  1586      */
       
  1587     void HandleFlagsChanged( TInt aOldFlags );
       
  1588 
       
  1589 protected:
       
  1590 
       
  1591     /** Display area that was in effect during the previous draw operation.
       
  1592         This will be included in the dirty rectangle. */
       
  1593     mutable TRect iPreviousDrawn; 
       
  1594 
       
  1595 public:
       
  1596 
       
  1597     /* Public properties. */
       
  1598     /** ! Position / order / size of public variables must not change */
       
  1599 
       
  1600     /** Depth offset. */
       
  1601     THuiTimedValue iDepthOffset;
       
  1602 
       
  1603     /**
       
  1604      * Opacity of this visual.
       
  1605      * The interpolation style of opacity values by default is linear.
       
  1606      * A value of 0 is fully transparent, a value of 1 is fully opaque.
       
  1607      */
       
  1608     THuiTimedValue iOpacity;
       
  1609 
       
  1610 private:
       
  1611 
       
  1612     /** ! Following three members are accessed by inline methods:
       
  1613      * - Their location (at the beginning of member data) must not change
       
  1614      * - Their order and size must not change
       
  1615      */ 
       
  1616     
       
  1617     /** Flags. */
       
  1618     TInt iFlags;
       
  1619 
       
  1620     /** Position of the visual. */
       
  1621     THuiTimedPoint iPos;
       
  1622 
       
  1623     /** Size of the visual. */
       
  1624     THuiTimedPoint iSize;
       
  1625 
       
  1626     /** ! ------------------------------- */
       
  1627 
       
  1628 protected: // RnD utils
       
  1629     /** Session id */
       
  1630     TInt iSessionId;
       
  1631     
       
  1632 
       
  1633     /** Owner of the visual. */
       
  1634     MHuiVisualOwner* iOwner;
       
  1635 
       
  1636 #ifdef HUI_DEBUG_TRACK_DRAWING
       
  1637     /** Used for tracking the visual in different stages of rendering */
       
  1638 	TBool iTrackVisual;
       
  1639 #endif
       
  1640     
       
  1641 private:
       
  1642 
       
  1643     /** The display on which the visual is being shown. */
       
  1644     CHuiDisplay* iDisplay;
       
  1645 
       
  1646     /** Layout this visual belongs to (may be <code>NULL</code>). */
       
  1647     CHuiLayout* iLayout;
       
  1648 
       
  1649     /**
       
  1650      * Minimum allowed size for the visual. Layouts will respect this value
       
  1651      * when layout is being updated.
       
  1652      *
       
  1653      * @todo  Needs to be implemented.
       
  1654      */
       
  1655     THuiRealSize iMinSize;
       
  1656 
       
  1657     /**
       
  1658      * Maximum allowed size for the visual. Layouts will respect this value
       
  1659      * when layout is being updated.
       
  1660      *
       
  1661      * @todo  Needs to be implemented.
       
  1662      */
       
  1663     THuiRealSize iMaxSize;
       
  1664 
       
  1665     /**
       
  1666      * Padding between visual edges and content. The box metric can have a 
       
  1667      * different amount of padding on each of the four sides.
       
  1668      */
       
  1669     //TPoint iPadding;
       
  1670     THuiBoxMetric iPadding;
       
  1671 
       
  1672     /** If not <code>NULL</code>, this transformation is used when the
       
  1673         content visual is drawn. */
       
  1674     CHuiTransformation* iTransform;
       
  1675 
       
  1676     /** Background brushes. */
       
  1677     CHuiBrushArray* iBrushes;
       
  1678 
       
  1679     /** If effect is still being loaded (parsing), visual may need to be hided */
       
  1680     TBool iLoadingEffect;
       
  1681 
       
  1682     /** Tag. */
       
  1683     HBufC8* iTag;
       
  1684 
       
  1685 	/** 
       
  1686 	 * Cached display rectangle for the current frame. Defines 
       
  1687 	 * Calculates the visual's bounding rectangle in display coordinates. 
       
  1688 	 * The rect is always in pixels.
       
  1689 	 * @see DisplayRect()
       
  1690 	 */
       
  1691 	mutable THuiRealRect iDisplayRect;
       
  1692 
       
  1693 	/**
       
  1694 	 * Describes during which frame the display rectance cache (iDisplayRect)
       
  1695 	 * is valid.
       
  1696 	 */
       
  1697 	mutable TUint iDisplayRectFrameNumber;
       
  1698 
       
  1699 	/**	
       
  1700      * Cached visual's bounding rectangle animation target in display 
       
  1701      * coordinates. Uses the target values of the position and size, 
       
  1702      * which means transitions are always immediate in the returned 
       
  1703      * rectangle.
       
  1704      */
       
  1705 	mutable THuiRealRect iDisplayRectTarget;
       
  1706 
       
  1707 	/**
       
  1708 	 * Describes during which frame the display rectance target cache 
       
  1709 	 * (iDisplayRectTarget) is valid.
       
  1710 	 */
       
  1711 	mutable TUint iDisplayRectTargetFrameNumber;
       
  1712     
       
  1713     // Rest of the private data
       
  1714     struct THuiVisualPrivateData;
       
  1715     THuiVisualPrivateData* iVisualData;
       
  1716     };
       
  1717 
       
  1718 
       
  1719 /* Inline methods. */
       
  1720 
       
  1721 TInt CHuiVisual::Flags() const
       
  1722     {
       
  1723     return iFlags;
       
  1724     }
       
  1725 
       
  1726 inline THuiTimedPoint& CHuiVisual::Pos()
       
  1727     {
       
  1728     return iPos;
       
  1729     }
       
  1730 
       
  1731 inline THuiTimedPoint& CHuiVisual::Size()
       
  1732     {
       
  1733     return iSize;
       
  1734     }
       
  1735 
       
  1736 #endif  // __HUIVISUAL_H__