uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiControl.h
changeset 0 15bf7259bb7c
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:   CHuiControl provides a base class for a generic logical control 
       
    15 *                element in the HUITK UI.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __HUICONTROL_H__
       
    22 #define __HUICONTROL_H__
       
    23 
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <barsread.h>
       
    27 #include <uiacceltk/HuiVisual.h>
       
    28 #include <uiacceltk/HuiLayout.h>
       
    29 #include <uiacceltk/HuiSessionObject.h>
       
    30 #include <uiacceltk/huieventhandler.h>
       
    31 
       
    32 /* Forward declarations. */
       
    33 class CHuiEnv;
       
    34 class CHuiTextureManager;
       
    35 class CHuiDisplay;
       
    36 class THuiEvent;
       
    37 class CHuiControlGroup;
       
    38 
       
    39 
       
    40 /**
       
    41  * CHuiControl provides a base class for gathering logical functionality in
       
    42  * the UI.
       
    43  *
       
    44  * For example a list control could gather (and _control_) all visuals that form
       
    45  * a listbox UI element. A thumbnail view control could be used to control visuals
       
    46  * that form a thumbnail view in an image gallery application.
       
    47  *
       
    48  * Their main use is to handle interaction with the user - Controls handle input
       
    49  * events by overriding OfferEventL().
       
    50  *
       
    51  * Controls are not visible by themselves, but controls create and manipulate
       
    52  * visuals (@see CHuiVisual) - set target values for visual properties and/or
       
    53  * schedule animation commands.
       
    54  *
       
    55  * Controls are collected in groups (e.g., one group per view), but do not have a
       
    56  * hierarchical organization. However controls can be connected to each other
       
    57  * for collaboration between multiple controls. @see AddConnectionL()
       
    58  */
       
    59 class CHuiControl : public CBase, 
       
    60                     public MHuiVisualOwner, 
       
    61                     public MHuiEventHandler,
       
    62                     public MHuiSessionObject
       
    63 	{
       
    64 public:
       
    65 
       
    66 	/** @beginAPI */
       
    67 	
       
    68 	/* Constructors and destructor. */
       
    69 
       
    70 	/**
       
    71 	 * Constructs this control. An unique ID for this control is
       
    72 	 * generated for this control using CHuiStatic::GenerateId();
       
    73 	 * @see Id()
       
    74 	 * 
       
    75 	 * @todo This constructor is public, explain rationale.
       
    76 	 */
       
    77 	IMPORT_C CHuiControl(CHuiEnv& aEnv);
       
    78 
       
    79 	/**
       
    80 	 * Destructs this control. Cancels all scheduled commands for this control.
       
    81      * Removes the host and any other connections (if any) and destroys
       
    82      * the visuals owned by this control.
       
    83 	 */
       
    84 	IMPORT_C ~CHuiControl();
       
    85 
       
    86     void ConstructL()
       
    87         {
       
    88         BaseConstructL();
       
    89         }
       
    90 
       
    91 	/* Methods. */
       
    92 
       
    93 	/**
       
    94 	 * Set an id value for this control.
       
    95 	 */
       
    96 	IMPORT_C void SetId(TInt aId);
       
    97 
       
    98 	/**
       
    99 	 * Returns the id of this control. Zero (0) id the control has no id.
       
   100 	 */
       
   101 	IMPORT_C TInt Id() const;
       
   102 
       
   103 	/**
       
   104 	 * From MHuiVisualOwner. Returns the environment of the visual.
       
   105 	 */
       
   106 	IMPORT_C CHuiEnv& Env() const;
       
   107 
       
   108 	/**
       
   109 	 * From MHuiVisualOwner. Returns the control group of the visual's owner control.
       
   110 	 *
       
   111 	 * @return  Control group, or <code>NULL</code> if there isn't one.
       
   112 	 */
       
   113 	IMPORT_C CHuiControlGroup* ControlGroup() const;
       
   114 
       
   115     /**
       
   116      * Returns the texture manager of the environment of the visual.
       
   117      */
       
   118     IMPORT_C CHuiTextureManager& TextureManager() const;
       
   119 
       
   120     /**
       
   121      * Returns the display this control is bound to, or <code>NULL</code>.
       
   122      */
       
   123     IMPORT_C CHuiDisplay* Display() const;
       
   124 
       
   125     /**
       
   126      * Binds the control to a display. Called automatically by 
       
   127      * CHuiControl::ShowL().
       
   128      */
       
   129     IMPORT_C void BindDisplay(CHuiDisplay& aDisplay);
       
   130 
       
   131 	/**
       
   132 	 * From MHuiVisualOwner. Appends a visual to the control. The control also receives ownership
       
   133 	 * of the visual. This method is specifically intended to be used when
       
   134 	 * adding previously created visuals to the control.
       
   135 	 *
       
   136 	 * @param aVisual  Visual to add. Control gets ownership.
       
   137 	 */
       
   138     IMPORT_C void AppendL(CHuiVisual* aVisual);
       
   139 
       
   140 	/**
       
   141 	 * Appends a new visual to the list of visuals owned by the control.
       
   142 	 * This method is specifically intended to be used during construction
       
   143 	 * of visual trees.
       
   144 	 *
       
   145 	 * @param aVisual  Visual to append.
       
   146 	 */
       
   147 	IMPORT_C void AppendL(CHuiVisual* aVisual, CHuiLayout* aParentLayout);
       
   148 
       
   149 	/**
       
   150 	 * From MHuiVisualOwner. Removes a visual from the control. The caller also receives ownership
       
   151 	 * of the visual.
       
   152 	 *
       
   153 	 * @param aVisual  Visual to remove. Caller gets ownership.
       
   154 	 */
       
   155 	IMPORT_C void Remove(CHuiVisual* aVisual);
       
   156 
       
   157 	/**
       
   158 	 * Creates a new visual using the visual factory and appends it.
       
   159 	 *
       
   160 	 * @param aVisualType  Type of the visual to create.
       
   161 	 *
       
   162 	 * @return  Pointer to the created visual.
       
   163 	 */
       
   164     IMPORT_C CHuiVisual* AppendVisualL(THuiVisualType aVisualType,
       
   165                                        CHuiLayout* aParentLayout=NULL);
       
   166 
       
   167     /**
       
   168      * Creates a new layout using the visual factory and appends it.
       
   169      *
       
   170      * @param aLayoutType  Type of the layout to create.
       
   171      *
       
   172      * @return  Pointer to the created layout.
       
   173      */
       
   174     IMPORT_C CHuiLayout* AppendLayoutL(THuiLayoutType aLayoutType,
       
   175                                        CHuiLayout* aParentLayout=NULL);
       
   176 
       
   177     /**
       
   178      * Returns one of the visuals owned by the control.
       
   179      *
       
   180      * @param aIndex  Index number of the visual to return.
       
   181      *
       
   182      * @return  Visual.
       
   183      */
       
   184     IMPORT_C CHuiVisual& Visual(TInt aIndex) const;
       
   185 
       
   186     /**
       
   187      * Determines the number of visuals owned by the control. 
       
   188      *
       
   189      * Note that in visual hierarchies, child visuals are not owned by 
       
   190      * their parent visuals, but a control. This means that a control 
       
   191      * that owns a tree of visuals will return the total number of visuals 
       
   192      * in the tree, and not just the number of root visuals.
       
   193      *
       
   194      * @return  Number of visuals owned by the control.
       
   195      */
       
   196     IMPORT_C TInt VisualCount() const;
       
   197 
       
   198     /**
       
   199      * Finds the visual that matches a tag. Only the visuals owned by 
       
   200      * this control are searched.
       
   201      *
       
   202      * @param aTag  Tag descriptor to match against.
       
   203      *
       
   204      * @return  The first visual that matches the tag, or <code>NULL</code>
       
   205      *          if no visual matched the tag.
       
   206      */
       
   207     IMPORT_C CHuiVisual* FindTag(const TDesC8& aTag) const;
       
   208       
       
   209 	/**
       
   210 	 * Returns the visual host control.
       
   211 	 *
       
   212 	 * @return  Host control. NULL if not connected.
       
   213 	 */
       
   214 	IMPORT_C CHuiControl* Host() const;
       
   215 
       
   216 	/**
       
   217 	 * New virtual method. Establishes a connection between this control and another control.
       
   218 	 * Instead of supporting a treelike parent-child control hierarchy, Hitchcock
       
   219 	 * allows defining a set of links between any controls. These links are called
       
   220 	 * connections. Connections can be used to construct a parent-child
       
   221      * based hierarchy of controls, if that is considered necessary from the point
       
   222      * of view of input event handling or some other data passing scenario. They
       
   223      * can be utilized for observation purposes or keeping track of associated controls.
       
   224 	 *
       
   225 	 * @param aConnectedControl  Control to connect.
       
   226 	 * @param aRole              Role of the control. Interpretation depends on
       
   227 	 *                           the host.
       
   228 	 * @see HUITK Programmer's Guide for examples of how to connect controls.
       
   229 	 */
       
   230 	IMPORT_C virtual void AddConnectionL(CHuiControl* aConnectedControl, TInt aRole=0);
       
   231 
       
   232 	/**
       
   233 	 * Removes a client.
       
   234 	 *
       
   235 	 * @param aConnectedControl  Connected control to remove.
       
   236 	 */
       
   237 	IMPORT_C void RemoveConnection(CHuiControl* aConnectedControl);
       
   238 
       
   239     /**
       
   240      * Find a client's index number.
       
   241      *
       
   242      * @param aConnected  Connected control to find.
       
   243      *
       
   244      * @return  Index number.
       
   245      */
       
   246     IMPORT_C TInt FindConnection(const CHuiControl* aConnected) const;
       
   247 
       
   248 	/**
       
   249 	 * Returns the number of clients.
       
   250 	 *
       
   251 	 * @return  Number of client controls.
       
   252 	 */
       
   253     IMPORT_C TInt ConnectionCount() const;
       
   254 
       
   255 	/**
       
   256 	 * Returns a client control.
       
   257 	 *
       
   258 	 * @param aIndex  Index of the client.
       
   259 	 *
       
   260 	 * @return  Reference to the client control.
       
   261 	 */
       
   262     IMPORT_C CHuiControl& Connection(TInt aIndex) const;
       
   263 
       
   264     /**
       
   265      * @deprecated
       
   266      *
       
   267      * Returns a client control.
       
   268      *
       
   269      * @param aOrdinal  Role or index.
       
   270      */
       
   271     IMPORT_C CHuiControl& ConnectionByOrdinal(TInt aOrdinal) const;
       
   272 
       
   273 	/**
       
   274 	 * Returns the role of a client control.
       
   275 	 *
       
   276 	 * Roles are defined by the application developer - a user interface framework
       
   277 	 * built on top of Hitchcock can define a suitable set of roles for the controls
       
   278 	 * implemented in the framework.
       
   279 	 *
       
   280 	 * @param aIndex  Index of the client.
       
   281 	 *
       
   282 	 * @return  Role of the client control.
       
   283 	 * @see AddConnectionL()
       
   284 	 */
       
   285     IMPORT_C TInt ConnectionRole(TInt aIndex) const;
       
   286 
       
   287     /**
       
   288      * @deprecated
       
   289      *
       
   290      * Ordinal is the effective index. Role overrides index.
       
   291      * @see AddConnectionL()
       
   292      */
       
   293     IMPORT_C TInt ConnectionOrdinal(TInt aIndex) const;
       
   294 
       
   295     /**
       
   296      * Returns the control's role.
       
   297      * 
       
   298      * @return Role. Zero by default.
       
   299      *
       
   300      * @see AddConnectionL()
       
   301      */
       
   302     IMPORT_C TInt Role() const;
       
   303 
       
   304     /**
       
   305      * Sets the control's role.
       
   306      * 
       
   307      * @param aRole Connection role.
       
   308      *
       
   309      * @see AddConnectionL()
       
   310      */
       
   311     IMPORT_C void SetRole(TInt aRole);
       
   312 
       
   313     /**
       
   314      * Returns the automatic visual host identification.
       
   315      *
       
   316      * @return Automatic visual host identification. Zero id not set.
       
   317      */
       
   318     IMPORT_C TInt HostId() const;
       
   319 
       
   320     /**
       
   321      * Sets the automatic visual host identification (non zero).
       
   322      * Needs to be unique in the CHuiEnv. If using this automatic mechanism, 
       
   323      * do not use the AddConnectionL() function - it will be automatically 
       
   324      * called when this control is shown.
       
   325      *
       
   326      * @return Automatic visual host identification.
       
   327      */
       
   328     IMPORT_C void SetHostId(TInt aHostId);
       
   329 
       
   330 	/**
       
   331 	 * @internal
       
   332 	 *
       
   333 	 * Do not call outside the toolkit library!
       
   334 	 *
       
   335 	 * Sets the host of the control. This will be called by the AddConnectioL()
       
   336 	 *
       
   337 	 * @param aHost Host control.
       
   338 	 */
       
   339     IMPORT_C void SetHost(CHuiControl* aHost);
       
   340 
       
   341     /**
       
   342      * Returns a container layout for the specified child control. 
       
   343      * A container layout contains all the visuals of a child control.
       
   344      *
       
   345      * @param aConnected Child connection, which is querying for the visual host.
       
   346      * 
       
   347      * @return Container layout for the child controls' root visuals.
       
   348      */
       
   349     IMPORT_C virtual CHuiLayout* ContainerLayout(const CHuiControl* aConnected) const;
       
   350 
       
   351     /**
       
   352      * Coordinate conversion.
       
   353      */
       
   354     IMPORT_C TPoint HostToDisplay(const TPoint& aPoint) const;
       
   355 
       
   356     /**
       
   357      * Coordinate conversion.
       
   358      */
       
   359     IMPORT_C TPoint DisplayToHost(const TPoint& aPoint) const;
       
   360 
       
   361     /**
       
   362      * Calculates the region of the screen where the control's visuals are.
       
   363      *
       
   364      * @return  Rectangle in display coordinates.
       
   365      */
       
   366     IMPORT_C TRect Bounds() const;
       
   367 
       
   368     /**
       
   369      * Tests whether a point is inside the control.
       
   370      *
       
   371      * @param aPoint  Point in display coordinates.
       
   372      *
       
   373      * @return  <code>ETrue</code>, if the point is inside one of the
       
   374      *          control's visuals. Otherwise <code>EFalse</code>.
       
   375      */
       
   376     IMPORT_C TBool HitTest(const TPoint& aPoint) const;
       
   377 
       
   378     /**
       
   379      * Acquires focus for this control.
       
   380      */
       
   381     IMPORT_C void AcquireFocus();
       
   382 
       
   383     /**
       
   384      * Determines whether the control has input focus.
       
   385      */
       
   386     IMPORT_C TBool Focus() const;
       
   387 
       
   388     /**
       
   389      * New virtual method. Determines whether the control wants to receive focus.
       
   390      */
       
   391     IMPORT_C virtual TBool IsFocusing() const;
       
   392 
       
   393     /**
       
   394      * New virtual method. Called when the control's focus state changes.
       
   395      */
       
   396     IMPORT_C virtual void FocusChanged(CHuiDisplay& aDisplay, TBool iFocused);
       
   397 
       
   398     /**
       
   399      * Determines whether the control accepts input events.
       
   400      */
       
   401     IMPORT_C TBool AcceptInput() const;
       
   402 
       
   403     /**
       
   404      * From MHuiEventHandler. Called when an input event is being offered to the control.
       
   405      *
       
   406      * @param aEvent  Event to be handled.
       
   407      *
       
   408      * @return  <code>ETrue</code>, if the event was handled.
       
   409      *          Otherwise <code>EFalse</code>.
       
   410      */
       
   411     IMPORT_C TBool OfferEventL(const THuiEvent& aEvent);
       
   412 
       
   413     /**
       
   414      * Determines the display area.
       
   415      *
       
   416      * @return  Area of the display on which the control is shown.
       
   417      */
       
   418     IMPORT_C TRect DisplayArea() const;
       
   419 
       
   420     /**
       
   421      * Determines the coordinates of the center of the display.
       
   422      *
       
   423      * @return  Center of the display on which the control is shown.
       
   424      */
       
   425     IMPORT_C THuiRealPoint DisplayCenter() const __SOFTFP;
       
   426 
       
   427     /**
       
   428      * Cancel all scheduled commands related to this control and the control's
       
   429      * visuals.
       
   430      */
       
   431     IMPORT_C void CancelAllCommands();
       
   432 
       
   433     /**
       
   434      * From MHuiVisualOwner. Notifies the control that one of the visuals it ows has been laid out.
       
   435      * Called automatically from CHuiVisual::UpdateChildrenLayout().
       
   436      * For example, occurs when a parent layout is resized.
       
   437      *
       
   438      * @param aVisual  Visual whose layout was updated.
       
   439      */
       
   440     IMPORT_C void VisualLayoutUpdated(CHuiVisual& aVisual);
       
   441     
       
   442     /**
       
   443      * From MHuiVisualOwner. Called when a visual owned by the control is being destroyed.
       
   444      * Visual is removed from the control.
       
   445      *
       
   446      * @param aVisual  Visual about to the destroyed.
       
   447      */
       
   448     IMPORT_C void VisualDestroyed(CHuiVisual& aVisual);
       
   449 
       
   450 	/**
       
   451 	 * From MHuiVisualOwner. Called when there was an error (a leave happened)
       
   452 	 * while preparing one of the controls visual for drawing. 
       
   453 	 * Typically the resource alloc errors such as out of 
       
   454 	 * memory is escalated through this callback.
       
   455 	 * 
       
   456 	 * By default this callback causes a panic with the
       
   457 	 * error code, so you should override this if you
       
   458 	 * want different behavior.
       
   459 	 * 
       
   460      * @param aVisual    Visual that caused the error.
       
   461      * @param aErrorCode Symbian KErr error code for the failure.
       
   462 	 */
       
   463     IMPORT_C void VisualPrepareDrawFailed(CHuiVisual& aVisual, TInt aErrorCode); 
       
   464 
       
   465     /**
       
   466      * From MHuiVisualOwner. Returns a pointer to the event handler responsible for handling
       
   467      * events related this control's visuals (i.e. the handler is this
       
   468      * control).
       
   469      */
       
   470     IMPORT_C MHuiEventHandler* EventHandler();
       
   471 
       
   472     /** @endAPI */
       
   473 
       
   474 
       
   475     /**
       
   476      * Sets the group that owns the control. Called by the control group
       
   477      * when the control is added to the group.
       
   478      *
       
   479      * @param aOwnerGroup  Owner group.
       
   480      */
       
   481     void SetControlGroup(CHuiControlGroup& aOwnerGroup);
       
   482 
       
   483     /**
       
   484      * Shows all the unshown visuals of the control on the specified display.
       
   485      * Visuals that are currently shown on another display are not affected.
       
   486      *
       
   487      * @param aDisplay  Display to add visuals to.
       
   488      *
       
   489      * @see CHuiControl::BindDisplay()
       
   490      */
       
   491     void ShowL(CHuiDisplay& aDisplay);
       
   492 
       
   493     /**
       
   494      * Hides those visuals that are displayed on the specified display. Other
       
   495      * visuals are not affected.
       
   496      *
       
   497      * @param aDisplay  Display to remove visuals from.
       
   498      */
       
   499     void Hide(CHuiDisplay& aDisplay);
       
   500 
       
   501     /**
       
   502      * Changes the control's focus state.
       
   503      */
       
   504     void SetFocus(CHuiDisplay& aDisplay, TBool aHasFocus);
       
   505 
       
   506     /**
       
   507      * Sets the flag that tells whether the control wants to receive focus.
       
   508      */
       
   509     void SetFocusing(TBool aFocusing);
       
   510 
       
   511     /**
       
   512      * Clears the change flags of the control.
       
   513      */
       
   514     void ClearChanged();
       
   515 
       
   516 
       
   517 protected:
       
   518 
       
   519     /** @beginAPI */
       
   520 
       
   521     /* Methods. */
       
   522 
       
   523     /**
       
   524      * New virtual method. Notifies the control that its visible has been changed on a display.
       
   525      * This is the earliest time when the control knows the dimensions of
       
   526      * the display it is being shown on.
       
   527      *
       
   528      * @param aIsVisible  ETrue, if the control is now visible on the display.
       
   529      *                    EFalse, if the control is about to the hidden on the display.
       
   530      * @param aDisplay    The display on which the control's visibility is changing.
       
   531      */
       
   532     IMPORT_C virtual void NotifyControlVisibility(TBool aIsVisible, CHuiDisplay& aDisplay);
       
   533 
       
   534 
       
   535     /* Utility methods. */
       
   536 
       
   537     /**
       
   538      * New virtual method. Called when a visual has been added to the control.
       
   539      *
       
   540      * @param aVisual  Visual that was added.
       
   541      */
       
   542     IMPORT_C virtual void VisualAddedL(CHuiVisual* aVisual);
       
   543 
       
   544     /**
       
   545      * New virtual method. Called when a visual has been removed from the control.
       
   546      *
       
   547      * @param aVisual  Visual that was removed.
       
   548      */
       
   549     IMPORT_C virtual void VisualRemoved(CHuiVisual* aVisual);
       
   550 
       
   551     /**
       
   552      * New virtual method. Called when a client control is added to the control.
       
   553      * 
       
   554      * @see AddConnectionL()
       
   555      */
       
   556     IMPORT_C virtual void ConnectionAddedL(CHuiControl* aConnectedControl, TInt aRole);
       
   557 
       
   558     /**
       
   559      * New virtual method. Called when a client control is removed from the control.
       
   560      *
       
   561      * @see RemoveConnection()
       
   562      */
       
   563     IMPORT_C virtual void ConnectionRemoved(CHuiControl* aConnectedControl, TInt aRole);
       
   564 
       
   565     /**
       
   566      * New virtual method. The host control is about to be changed. The control needs to
       
   567      * add its visuals to the container layout provided by the new host.
       
   568      *
       
   569      * @see SetHost()
       
   570      */
       
   571     IMPORT_C virtual void HostChangingL(CHuiControl* aNewHost);
       
   572 
       
   573     /**
       
   574      * Virtual second phase constructor. Must be base called in deriving class.
       
   575      */
       
   576     IMPORT_C virtual void BaseConstructL();
       
   577 
       
   578     IMPORT_C virtual void ControlExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
       
   579 
       
   580    /** @endAPI */
       
   581  
       
   582 
       
   583 protected: // from MHuiSessionObject
       
   584     
       
   585     /**
       
   586      * ! Gets the object type.
       
   587      */
       
   588     IMPORT_C TType Type() const;
       
   589 
       
   590     /**
       
   591      * ! Gets the session id for object.
       
   592      */
       
   593     IMPORT_C TInt SessionId() const;
       
   594 
       
   595     /**
       
   596      * ! Sets the session id for object.
       
   597      */
       
   598     IMPORT_C void SetSessionId(TInt aSessionId);
       
   599 
       
   600 
       
   601 public: // internal utilities    
       
   602     
       
   603     /**
       
   604      * Remove this control's visuals from the specified container layout.
       
   605      *
       
   606      * @param aHostControl Host control.
       
   607      */
       
   608     void RemoveVisualsFromHostControl( CHuiControl& aHostControl );
       
   609 
       
   610 private:
       
   611 
       
   612     /** The environment where this visual belong to. */
       
   613     CHuiEnv& iEnv;
       
   614 
       
   615     /** The group into which this control belongs to. */
       
   616     CHuiControlGroup* iOwnerGroup;
       
   617 
       
   618     /** The display this control is currently bound to. */
       
   619     CHuiDisplay* iBoundDisplay;
       
   620 
       
   621     /** Identifier of the control. */
       
   622     TInt iId;
       
   623 
       
   624     /** Identifier of the host control. */
       
   625     TInt iHostId;
       
   626 
       
   627     /** Control's role. */
       
   628     TInt iRole;
       
   629 
       
   630     /** Visuals owned by the control. */
       
   631     RPointerArray<CHuiVisual> iVisuals;
       
   632 
       
   633     /** Host control. The host provides a container visual for this control's
       
   634         visuals. */
       
   635     CHuiControl* iHost;
       
   636 
       
   637     /** Holds information about a client control. */
       
   638     struct SConnection
       
   639         {
       
   640         /** Connected control. */
       
   641         CHuiControl* iControl;
       
   642 
       
   643         /** Role of the client. */
       
   644         /** @todo The role here is redundant because each control knows
       
   645                   its role? */
       
   646         TInt iRole;
       
   647         };
       
   648 
       
   649     /** Connected controls and their roles. */
       
   650     RArray<SConnection> iConnections;
       
   651 
       
   652     /** ETrue, if the control wants to receive input focus. */
       
   653     TBool iFocusing;
       
   654 
       
   655     /** Control has input focus. */
       
   656     TBool iHasFocus;
       
   657 
       
   658     /** Session id */
       
   659     TInt iSessionId;
       
   660 
       
   661     TAny* iSpare;
       
   662 	};
       
   663 
       
   664 #endif  // __HUICONTROL_H__