|
||
class CCoeControl : public CBase, public MObjectProvider;
Control base class from which all other controls are derived.
MObjectProvider
- An interface that allows an object to be part of a network of object providers.
CBase
-
Base class for all classes to be instantiated on the heap.
CCoeControl
- Control base class from which all other controls are derived.
Defined in CCoeControl
:
AccumulatedZoom()const
Return the zoom factor for this control. Takes account of zoom factors in parent...ActivateGc()const
Activates the standard graphics context.ActivateL()
Sets the control as ready to be drawn.BackedUpWindow()const
Gets the backed-up window owned by the control.Background()const
Returns the background drawer object associated with this object, if any. Null i...CCoeControl()
Default C++ constructor.CCoeControl(CCoeEnv *)
C++ constructor.CCoeControl(const CCoeControl &)
CapturesPointer()const
Tests whether pointer capture is set for the control.ClaimPointerGrab(TBool)
Claims pointer grab from another control.CloseWindow()
Closes the window owned by this control.ComponentArrayExists()const
ComponentControl(TInt)const
Gets an indexed component of a compound control.Components()
Returns a component array to store child controls.Components()const
Returns a component array to store child controls.ConstructFromResourceL(TResourceReader &)
Constructs the control from a resource file.ControlContext()const
Gets the control context being used by this control.ControlEnv()const
Gets the control environment object for this control.CopyControlContextFrom(const CCoeControl *)
Sets the control's context from another control.CountComponentControls()const
Gets the number of controls contained in a compound control.CreateBackedUpWindowL(RWindowTreeNode &)
Creates a control's window as a backed-up window.CreateBackedUpWindowL(RWindowTreeNode &,TDisplayMode)
Creates a control's window as a backed-up window, specifying the display mode.CreateWindowL()
Creates a control's window.CreateWindowL(RWindowGroup *)
Creates a control's window, specifying its parent window group.CreateWindowL(RWindowTreeNode &)
Creates a control's window, specifying its parent window and its extent.CreateWindowL(const CCoeControl *)
Creates a control's window, specifying the parent control.CustomGc()const
Returns the custom graphics context set for this control (if any). Note that unl...DeactivateGc()const
Deactivates the standard graphics context owned by the UI control framework.Draw(const TRect &)const
Draws the control.DrawBackground(const TRect &)const
Draws the control's background using its graphics context. Unlike CCoeControl::D...DrawDeferred()const
Draws the control, with low priority.DrawForeground(const TRect &)const
Draws the control's foreground using the control's graphics context. Unlike CCoe...DrawNow()const
Draws the entire controlDrawNow(const TRect &)const
Draws the control, its components and child windows, within the bounds defined b...DrawableWindow()const
Gets the control's associated drawable window.EAbsoluteZoom
ERelativeZoom
EnableDragEvents()
Requests pointer drag events.EnableReportControlStateChange(TBool)
Set the status of the report control state change. FindBackground()const
Return an MCoeControlBackground object, if there is one - looking up the parent ...FindFontProvider()const
Return the font provider used by this controlFocusChanged(TDrawNow)
Responds to a change in focus.GetColor(TInt,TRgb &)const
Gets the overridden physical colour.GetColorUseListL(CArrayFix< TCoeColorUse > &)const
Gets the list of logical colours used to draw the control.GetGc()const
Deprecated. See CCoeControl::CustomGc()const. GetHelpContext(TCoeHelpContext &)const
Gets the control's help context.GetTextDrawer(CCoeTextDrawerBase *&,const CCoeControl *,TInt)const
Controls that want to change or replace the text drawer that it or its children ...GrabbingComponent()const
Gets the component of this control which is grabbing the pointer.HandleComponentControlsResourceChange(TInt)
Handles a change to the resources in the components of a compound control.HandlePointerBufferReadyL()
Handles pointer buffer ready events.HandlePointerEventL(const TPointerEvent &)
Handles pointer events.HandleRedrawEvent(const TRect &)const
Handles redraw events.HandleResourceChange(TInt)
Handles a change to the control's resources.HasBorder()const
Tests if the control has a border.HitTest()const
Gets the object that defines the hit region inside the control's rectangle. The ...IgnoreEventsUntilNextPointerUp()
Sets the control to ignore pointer events until the next pointer up.Index(const CCoeControl *)const
Gets the index of a control that is a component of this control.InitComponentArrayL()
Creates a component array to store child controls.InputCapabilities()const
Gets the control's input capabilities.IsActivated()const
Tests if the control has been activated.IsBackedUp()const
Tests if the window owned by the control is a backed-up window.IsBeingDestroyed()const
Tests if the control is being destroyed.IsBlank()const
Tests if the control is blank.IsDimmed()const
Tests if the control is dimmed.IsFocused()const
Tests if the control has focus.IsNonFocusing()const
Tests if the control can receive focus.IsReadyToDraw()const
Tests if the control is ready for drawing.IsVisible()const
Tests if the control is visible.LayoutManager()const
Gets the layout manager MakeVisible(TBool)
Sets this control as visible or invisible.MaximumWidth()const
Gets the control's maximum widthMinimumSize()
Sets the control's minimum required size.MopNext()
Retrieves the control's parent.MopSupplyObject(TTypeUid)
Retrieves an object of the same type as that encapsulated in aId.Observer()const
Gets the control's observer.OfferKeyEventL(const TKeyEvent &,TEventCode)
Handles key events.OverrideColorL(TInt,TRgb)
Overrides the control's colour setting, as specified in the application's colour...OwnsWindow()const
Tests if the control is window-owning.Parent()
Parent()const
Position()const
Gets the control's position.PositionChanged()
Responds to changes in the position of a control.PositionRelativeToScreen()const
Gets the control's position relative to screen origin.PrepareForFocusGainL()
Prepares the control for gaining focus.PrepareForFocusLossL()
Prepares the control for loss of focus.Rect()const
Gets the control's extent.RecursivelyMergedInputCapabilities()const
Gets the input capabilities of the control and all its components.RequestRelayout(const CCoeControl *)
Requests a relayoutReserved_2()
ResetGc()const
Resets the standard graphics context.ScreenFont(const TCoeFont &)const
Return the correct font given the supplied font and taking into account the curr...SetAdjacent(TInt)
Sets the control's appearance when it is next to other controls.SetAllowStrayPointers()
Sets whether or not to allow stray pointer events.SetBackground(const MCoeControlBackground *)
Sets a pointer to a MCoeControlBackground object that is responsible for drawing...SetBlank()
Sets a flag to indicate that the control is blank.SetCanDrawOutsideRect()
Allows the control to draw outside its own extent.SetComponentsToInheritVisibility(TBool)
Sets the control's components to inherit the visibility setting of their contain...SetContainerWindowL(RBackedUpWindow &)
Sets the control's containing window without transferring ownership of the windo...SetContainerWindowL(RWindow &)
Sets the control's containing window, without transferring ownership of the wind...SetContainerWindowL(const CCoeControl &)
Sets the control's containing window by copying it from aContainer.SetControlContext(MCoeControlContext *)
Set the control context for this control.SetCornerAndSize(TGulAlignment,const TSize &)
Sets the control's alignment and size.SetCustomGc(CWindowGc *)
Sets the control's custom graphics context. This value overrides the system cont...SetDimmed(TBool)
Sets the control to be dimmed.SetExtent(const TPoint &,const TSize &)
Sets the control's extent, specifying a size and a position.SetExtentToWholeScreen()
Sets the control's extent to the whole screen.SetFocus(TBool,TDrawNow)
Sets this control to have the keyboard focus.SetFocusing(TBool)
Sets the control as able to receive keyboard focus.SetFontProviderL(const CCoeFontProvider &)
Set the font provider. This is an external object that takes the responsibililty...SetGc(CWindowGc *)const
Deprecated. See CCoeControl::SetCustomGc(CWindowGc *). SetGloballyCapturing(TBool)
Sets the global pointer capture flag.SetHitTest(const MCoeControlHitTest *)
Installs a hit tester for this control. The tester defines the hit region, which...SetLayoutManagerL(MCoeLayoutManager *)
Sets the layout managerSetMaximumWidth(TInt)
Sets the controls maximum width.SetMopParent(MObjectProvider *)
Sets the context - that is, the enclosing parent control - for this control. If ...SetNeighbor(CCoeControl *)
Sets an associated control.SetNonFocusing()
Deprecated. Use CCoeControl::SetFocusing(TBool).SetObserver(MCoeControlObserver *)
Sets the control's observer.SetParent(CCoeControl *)
Sets aParent as the parent of this control. If setting aParent as parent of this...SetPointerCapture(TBool)
Sets pointer capture.SetPosition(const TPoint &)
Sets the control's position.SetRect(const TRect &)
Sets the control's extent, specifying a rectangle.SetSize(const TSize &)
Sets the control's size.SetSizeWithoutNotification(const TSize &)
Sets a control's size without calling CCoeControl::SizeChanged().SetTextBaselineSpacing(TInt)
Sets the spacing between text baselines.SetUniqueHandle(TInt)
Sets a Unique Handle (identifier). That the number is unique is the perogative o...SetZoomFactorL(TInt,TZoomType)
Set the zoom factor for this control.Size()const
Gets the control's size.SizeChanged()
Responds to changes to the size and position of the contents of this control.SystemGc()const
Gets the graphics context that is used when drawing the control.TZoomType
TextBaselineOffset(const TSize &)const
Gets the offset to the first text baseline relative to the top of the control.TextDrawer(TInt)const
Gets the text drawer to be used for the control. This method returns a reference...UniqueHandle()const
Returns a Unique Handle (identifier) previously allocated to the control.Window()const
Gets the control's associated window.WriteInternalStateL(RWriteStream &)const
ZoomWithType()const
Return the zoom factor but without taking into account the zoom factor of the pa...iCoeEnv
iContext
iPosition
iSize
operator=(const CCoeControl &)
~CCoeControl()
Destructor.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...Inherited from MObjectProvider
:
MopGetObject(T *&)
Gets an object of the type defined by the template parameter.MopGetObjectNoChaining(T *&)
Gets an object of the type defined by the template parameter.IMPORT_C CCoeControl();
Default C++ constructor.
Initialises the CCoeControl base class.
Note: CCoeControl is normally used as a base class from which concrete control classes are derived. However, it can also be instantiated as a concrete class.
IMPORT_C CCoeControl(CCoeEnv *aCoeEnv);
C++ constructor.
Initialises the CCoeControl base class.
Note: CCoeControl is normally used as a base class from which concrete control classes are derived. However, it can also be instantiated as a concrete class.
|
IMPORT_C ~CCoeControl();
Destructor.
It destroys the window owned by the control, if it is a window-owning control.
In debug builds, this checks if the control still exists on the control stack and raises a CONE 44 panic if it is. An application must remove every control that it has added to the stack.
protected: inline CCoeControl(const CCoeControl &aControl);
|
IMPORT_C TBool ComponentArrayExists() const;
|
IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
Handles key events.
If a control wishes to process key events, it should implement this function. The implementation must ensure that the function returns EKeyWasNotConsumed if it does not do anything in response to a key event, otherwise, other controls or dialogs may be prevented from receiving the key event. If it is able to process the event it should return EKeyWasConsumed.
When a key event occurs, the control framework calls this function for each control on the control stack, until one of them can process the key event (and returns EKeyWasConsumed).
Each keyboard key press results in three separate events: EEventKeyDown, EEventKey, and EEventKeyUp, in that order.
To receive key events, which can be processed by this function, the application should call CCoeAppUi::AddToStackL(const MCoeView &,CCoeControl *,TInt,TInt)
to add the control to the stack. This only applies, however, to controls which are not components of a compound control.
Compound controls should pass key events to their components as necessary: the components themselves do not go on the stack.
Classes that override CCoeControl::OfferKeyEventL(const TKeyEvent &,TEventCode)
should also override the CCoeControl::InputCapabilities()const
virtual function, returning a TCoeInputCapabilities
object whose attributes correspond to the behaviour of the CCoeControl::OfferKeyEventL(const TKeyEvent &,TEventCode)
function. Note that it is not necessary to call CCoeControl::InputCapabilities()const
on any component controls from inside a class' CCoeControl::InputCapabilities()const
function. This is done automatically by the UI Control Framework.
If overriding CCoeControl::OfferKeyEventL(const TKeyEvent &,TEventCode)
, the implementation must include a base call to CCoeControl's CCoeControl::OfferKeyEventL(const TKeyEvent &,TEventCode)
.
|
|
IMPORT_C virtual void MakeVisible(TBool aVisible);
Sets this control as visible or invisible.
This causes the control to disappear or reappear. When a control is created, it is made visible by default.
CCoeControl::MakeVisible(TBool)
can be called before or after the control is activated.
Notes:
This function may be overridden.
The visibility of the control can be queried using CCoeControl::IsVisible()const
.
If CCoeControl::MakeVisible(TBool)
is used to make a component visible, and the control captures the pointer (see CCoeControl::CapturesPointer()const
), CCoeControl::MakeVisible(TBool)
throws away any pending pointer events for that control.
Typical uses are for scrollbars, or for dialogs where some user responses are not required in certain circumstances.
|
IMPORT_C virtual void SetDimmed(TBool aDimmed);
Sets the control to be dimmed.
This function sets a flag within the control which indicates whether or not the control is dimmed (greyed out). This is typically used to show that the control is temporarily unavailable.
CCoeControl::SetDimmed(TBool)
does not initiate a redraw of the control. The application should call CCoeControl::DrawNow()const
or CCoeControl::DrawDeferred()const
if a redraw is required after calling CCoeControl::SetDimmed(TBool)
. The control's CCoeControl::Draw(const TRect &)const
function should draw the control appropriately according to whether it is dimmed or not. (This can be enquired using CCoeControl::IsDimmed()const
.)
If overriding CCoeControl::SetDimmed(TBool)
, the implementation must include a base call to CCoeControl's CCoeControl::SetDimmed(TBool)
.
|
IMPORT_C virtual void SetContainerWindowL(const CCoeControl &aContainer);
Sets the control's containing window by copying it from aContainer.
It also copies the control context from aContainer if one has not previously been set.
This function can only be called on non-window-owning (or 'lodger') controls.
If overriding CCoeControl::SetContainerWindowL(const CCoeControl &)
, the implementation must include a base call to CCoeControl's CCoeControl::SetContainerWindowL(const CCoeControl &)
.
|
IMPORT_C virtual void ConstructFromResourceL(TResourceReader &aReader);
Constructs the control from a resource file.
This function has an empty default implementation. It should be implemented if the control is to be displayed within a dialog. It should initialise the control, reading in resource values from the resource file.
Note: if a control is not displayed in a dialog, it is necessary to set the control's associated window using CCoeControl::SetContainerWindowL(const CCoeControl &)
. Since this may leave, the control should be constructed using ConstructL().
|
IMPORT_C virtual void ActivateL();
Sets the control as ready to be drawn.
The application should call this function on all controls that are not components in a compound control.
The purpose of this function is that controls are not always ready to be drawn as soon as they have been constructed. For example, it may not be possible to set the control's extent during construction, but its extent should always be set before it is drawn. Similarly, if a control is to be made invisible, this should be done before it is activated.
The default implementation sets a flag in the control to indicate it is ready to be drawn. If the control is a compound control,
the default implementation also calls CCoeControl::ActivateL()
for all the control's components. To get the control's components it uses CCoeControl::CountComponentControls()const
and CCoeControl::ComponentControl(TInt)const
, which should be implemented by the compound control.
CCoeControl::ActivateL()
is typically called from the control's ConstructL() function .
Notes:
This function can be overridden. This is useful for doing late initialisation of the control, using information that was not
available at the time the control was created. For example, a text editor might override CCoeControl::ActivateL()
and use it to enquire whether it is focused: if it is, it makes the cursor and any highlighting visible. At the time when
the editor is created, it doesn't know whether or not it has keyboard focus.
If overriding CCoeControl::ActivateL()
, the implementation must include a base call to CCoeControl's CCoeControl::ActivateL()
.
IMPORT_C virtual void PrepareForFocusLossL();
Prepares the control for loss of focus.
A control which is displayed within a dialog should implement this function if it wishes to validate data entered into the control.
This function is called by the dialog framework immediately before it removes keyboard focus from a control within a dialog.
It is intended to be used for validating the state of the control: for example, if the control allows the user to enter a
date, CCoeControl::PrepareForFocusLossL()
would normally check to make sure the user did not enter an invalid date such as February 31st. If an invalid state is detected,
CCoeControl::PrepareForFocusLossL()
should leave and issue a message to the user if appropriate. If it does leave, the framework does not perform the action
that would have resulted in the control losing focus, and focus remains with the control to allow valid data to be entered.
In standard GUI dialogs, various actions can result in a control losing focus, for instance if the user presses the OK button
or the Enter key to close the dialog and enter the information, or if the user navigates away from the focussed control. These
actions result in CCoeControl::PrepareForFocusLossL()
being called on the control that currently has keyboard focus.
The default implementation of this function is empty, and it is not called from within the UI control framework. The function exists only to provide an interface to the control, for the GUI and any other UI library.
IMPORT_C virtual void PrepareForFocusGainL();
Prepares the control for gaining focus.
Implementations may by taking any action required, such as updating control information. The default implementation is empty.
IMPORT_C virtual void SetAdjacent(TInt aAdjacent);
Sets the control's appearance when it is next to other controls.
Its intended use is to remove the double border that may occur if two controls, both with borders, are adjacent within a container control.
This function has an empty default implementation, and is not used within the UI control framework. However, it may be implemented and used by derived control classes.
|
IMPORT_C virtual void SetNeighbor(CCoeControl *aNeighbor);
Sets an associated control.
This can be used to establish co-ordinated groups of controls for instance in dialogs without specific application co-operation.
This function has an empty default implementation, and is not used within the UI control framework. However, it may be implemented and used by derived control classes.
|
IMPORT_C virtual TBool HasBorder() const;
Tests if the control has a border.
When component controls are arranged in a container, the container control may need to know whether or not the components have borders, as this may affect the way the components are laid out within the container.
The default implementation of this function returns EFalse, but can be overridden to provide the required functionality.
|
IMPORT_C virtual TSize MinimumSize();
Sets the control's minimum required size.
This function should be overridden by the concrete control class if the control is to be displayed inside a dialog. Standard GUI dialogs set the size and position of their components automatically, and use this function to enquire the minimum size that a control requires.
Other container controls that automatically calculate the layout of their components may also use this function.
|
IMPORT_C virtual void HandleResourceChange(TInt aType);
Handles a change to the control's resources.
The types of resources handled are those which are shared across the environment, e.g. colours or fonts. For colour scheme
changes, CCoeControl::DrawDeferred()const
is called in order to redraw the control.
If overriding CCoeControl::HandleResourceChange(TInt)
, the implementation must include a base call to CCoeControl's CCoeControl::HandleResourceChange(TInt)
.
|
CCoeControl::HandleComponentControlsResourceChange(TInt)
Handles a change to the resources in the components of a compound control.IMPORT_C virtual void GetColorUseListL(CArrayFix< TCoeColorUse > &aColorUseList) const;
Gets the list of logical colours used to draw the control.
The list includes an explanation of how each colour is used. The default implementation is empty.
If overriding CCoeControl::GetColorUseListL(CArrayFix< TCoeColorUse > &)const
, the implementation must include a base call to CCoeControl's CCoeControl::GetColorUseListL(CArrayFix< TCoeColorUse > &)const
.
|
IMPORT_C virtual void GetHelpContext(TCoeHelpContext &aContext) const;
Gets the control's help context.
The default implementation is empty. The function must be implemented in derived classes to associate the control with a particular
Help file and topic in a context sensitive application. The implementation should set the public data members of TCoeHelpContext
to the required Help file UID and context descriptor, as created using the Context-Sensitive Help Compiler.
|
IMPORT_C virtual TCoeInputCapabilities InputCapabilities() const;
Gets the control's input capabilities.
Classes that override CCoeControl::OfferKeyEventL(const TKeyEvent &,TEventCode)
should also override this function, returning a TCoeInputCapabilities
object whose attributes correspond to the behaviour of the CCoeControl::OfferKeyEventL(const TKeyEvent &,TEventCode)
function. The default implementation returns TCoeInputCapabilities::ENone
.
It is not necessary to call CCoeControl::InputCapabilities()const
on any component controls from inside a class's CCoeControl::InputCapabilities()const
function. This is done automatically by the UI Control Framework.
|
inline CCoeEnv* ControlEnv() const;
Gets the control environment object for this control.
|
IMPORT_C RDrawableWindow* DrawableWindow() const;
Gets the control's associated drawable window.
The control must be a window-owning control.
This function should be called if it is not known whether the window is of type RWindow
or RBackedUpWindow
. RDrawableWindow
is an abstract base class from which RWindow
and RBackedUpWindow
are derived.
|
CCoeControl::Window()const
Gets the control's associated window.IMPORT_C TBool OwnsWindow() const;
Tests if the control is window-owning.
|
IMPORT_C TBool IsBackedUp() const;
Tests if the window owned by the control is a backed-up window.
|
IMPORT_C void SetContainerWindowL(RWindow &aWindow);
Sets the control's containing window, without transferring ownership of the window to this control. The function also sets the window's extent to that of the control.
This function can only be called on non-window-owning ('lodger') controls.
Note: the container's window can be accessed using CCoeControl::Window()const
, CCoeControl::DrawableWindow()const
, or CCoeControl::BackedUpWindow()const
.
|
IMPORT_C void SetContainerWindowL(RBackedUpWindow &aWindow);
Sets the control's containing window without transferring ownership of the window to this control. The function also sets the window's extent to that of the control.
The function can only be called on non-window-owning ('lodger') controls.
Note: the container's window can be accessed using CCoeControl::Window()const
, CCoeControl::DrawableWindow()const
, or CCoeControl::BackedUpWindow()const
.
|
IMPORT_C virtual TInt SetParent(CCoeControl *aParent);
Sets aParent as the parent of this control. If setting aParent as parent of this control will create a cyclic relationship, this method does nothing.
|
|
IMPORT_C TRect Rect() const;
Gets the control's extent.
The position of the top-left of the rectangle is (0,0) if the control owns its window. Otherwise, its position is relative to its window.
|
IMPORT_C void SetRect(const TRect &aRect);
Sets the control's extent, specifying a rectangle.
Note: calling this function results in a call to CCoeControl::SizeChanged()
.
|
IMPORT_C void SetExtent(const TPoint &aPosition, const TSize &aSize);
Sets the control's extent, specifying a size and a position.
Note: calling this function results in a call to CCoeControl::SizeChanged()
.
|
IMPORT_C void SetExtentToWholeScreen();
Sets the control's extent to the whole screen.
Note: calling this function results in a call to CCoeControl::SizeChanged()
.
IMPORT_C TSize Size() const;
Gets the control's size.
|
IMPORT_C void SetSize(const TSize &aSize);
Sets the control's size.
If the size, but not the position, of a control is set, then its position will default to TPoint(0,0).
Note: calling this function results in a call to CCoeControl::SizeChanged()
.
|
IMPORT_C TPoint Position() const;
Gets the control's position.
|
IMPORT_C TPoint PositionRelativeToScreen() const;
Gets the control's position relative to screen origin.
The screen origin is its top-left corner.
|
IMPORT_C void SetPosition(const TPoint &aPosition);
Sets the control's position.
If the control owns its containing window, it achieves this by setting the position of the window. Otherwise, the position
of the control is set relative to its containing window. The positions of the control's components are adjusted accordingly
and CCoeControl::PositionChanged()
is called.
|
IMPORT_C TInt MaximumWidth() const;
Gets the control's maximum width
|
IMPORT_C TInt SetMaximumWidth(TInt aMaxWidth);
Sets the controls maximum width.
|
|
IMPORT_C MCoeLayoutManager* LayoutManager() const;
Gets the layout manager
|
IMPORT_C virtual void SetLayoutManagerL(MCoeLayoutManager *aLayout);
Sets the layout manager
If the control already has a layout manager, its MCoeLayoutManager::Detatch()
is called. MCoeLayoutManager::Attach()
is called on aLayout
The control doesn't take ownership of the Layout manager.
|
IMPORT_C virtual TBool RequestRelayout(const CCoeControl *aChildControl);
Requests a relayout
The default implementation is to call the parents RequestRelayout()
.
Should normally be overridden by top-level controls, such as scrollable containers. Classes that override this function must
ensure that they don't cause infinite loops, since a relayout might cause calls to RequestRelayout()
itself, This might be solved like this:
TBool CAnyControl::RequestRelayout(const CCoeControl* aChildControl)
{
if(iRelayoutInProgress) return EFalse;
iRelayoutInProgress = ETrue;
//perform the relayout
iRelayoutInProgress = EFalse;
return ETrue;
}
When the request is addressed the requesting control knows that its SizeChanged()
will be called.
|
|
IMPORT_C TBool IsVisible() const;
Tests if the control is visible.
Unless CCoeControl::MakeVisible(TBool)
has been called with argument EFalse, the control is visible.
|
IMPORT_C void SetComponentsToInheritVisibility(TBool aInherit=ETrue);
Sets the control's components to inherit the visibility setting of their container control.
If set, when CCoeControl::MakeVisible(TBool)
is called on the compound control, the visibility setting is propagated to all its components.
|
IMPORT_C TBool IsDimmed() const;
Tests if the control is dimmed.
This function returns the value of a flag within the control which is set and unset using CCoeControl::SetDimmed(TBool)
.
|
IMPORT_C void SetObserver(MCoeControlObserver *aObserver);
Sets the control's observer.
|
IMPORT_C MCoeControlObserver* Observer() const;
Gets the control's observer.
|
IMPORT_C TBool IsFocused() const;
Tests if the control has focus.
Focus is set and unset using CCoeControl::SetFocus(TBool,TDrawNow)
.
|
IMPORT_C void SetFocus(TBool aFocus, TDrawNow aDrawNow=ENoDrawNow);
Sets this control to have the keyboard focus.
It sets the value of a focus flag within the control to the value given by aFocus. This flag indicates whether or not the
control has keyboard focus, and its value can be enquired using CCoeControl::IsFocused()const
. It then calls CCoeControl::FocusChanged(TDrawNow)
, passing it the value given by aDrawNow, unless the control is invisible or not activated, in which case it passes ENoDrawNow.
Note that setting focus does not initiate a redraw. The control's implementation of CCoeControl::FocusChanged(TDrawNow)
should do this if required. The control's CCoeControl::Draw(const TRect &)const
function, or that of its container, should normally change the appearance of the control to indicate whether or not it currently
has focus.
|
IMPORT_C void SetNonFocusing();
Deprecated. Use CCoeControl::SetFocusing(TBool)
.
Sets the control as unable to receive keyboard focus. The function would typically be called during construction of the control.
IMPORT_C void SetFocusing(TBool aFocusing);
Sets the control as able to receive keyboard focus.
|
IMPORT_C TBool IsNonFocusing() const;
Tests if the control can receive focus.
|
CCoeControl::SetNonFocusing()
Deprecated. Use CCoeControl::SetFocusing(TBool).IMPORT_C void DrawNow() const;
Draws the entire control
This function is called by an application or other code. The application should call this function when the control is first created and is ready for drawing, or if a change in application data or the control's internal state means that entire control's appearance is no longer up-to-date.
Partial redrawing of a control is sometimes more appropriate than drawing the entire control, and in this case, use DrawNow(const TRect &aRect) instead.
CCoeControl::DrawNow()const
is implemented by CCoeControl and MAY NOT be overridden. It calls CCoeControl::Draw(const TRect &)const
on the control itself, and also on all its component controls, if it is a compound control. (To do this it uses CCoeControl::CountComponentControls()const
and CCoeControl::ComponentControl(TInt)const
, which should be implemented by the derived control class.) If the control is a window-owning control, it also calls CCoeControl::Draw(const TRect &)const
for its child windows (if any).
IMPORT_C void DrawNow(const TRect &aRect) const;
Draws the control, its components and child windows, within the bounds defined by the given rectangle.
|
IMPORT_C void DrawDeferred() const;
Draws the control, with low priority.
This function is called by an application or other code.
It causes the control area to be marked as invalid, which will eventually cause a redraw initiated by the window server. The
control framework handles redraw events at a lower priority than user input events, which means that any pending user input
events will be processed before the redraw event. CCoeControl::DrawDeferred()const
therefore allows a control to do drawing at a lower priority than drawing performed by CCoeControl::DrawNow()const
.
An advantage of using CCoeControl::DrawDeferred()const
is that if you make multiple calls to CCoeControl::DrawDeferred()const
on the same area of a control, the window server will not generate a redraw event to do drawing that has already been superceded.
If you make multiple calls to CCoeControl::DrawNow()const
, however, all of them get processed, even if they have already been superceded by the time they are processed.
IMPORT_C CWindowGc& SystemGc() const;
Gets the graphics context that is used when drawing the control.
This function walks the CCoeControl hierarchy upwards from child to parent until a context is found. If no control in the
hierarchy has defined its own graphics context, the default system graphics context (iCoeEnv->CCoeControl::SystemGc()const
) is returned.
All drawing is carried out through a graphics context. A graphics context must be activated before it can be drawn to, and
deactivated when it is no longer needed. When drawing is done using CCoeControl::Draw(const TRect &)const
, CCoeControl::DrawNow()const
or CCoeControl::DrawDeferred()const
, the application does not have to do this, as it is done within the control framework. However, for application-initiated
drawing which is not done using CCoeControl::DrawNow()const
or CCoeControl::DrawDeferred()const
, the application should activate and deactivate the graphics context using CCoeControl::ActivateGc()const
and CCoeControl::DeactivateGc()const
(or CWindowGc::Activate(RDrawableWindow &)
and CWindowGc::Deactivate()
).
|
IMPORT_C TInt SetCustomGc(CWindowGc *aGraphicsContext);
Sets the control's custom graphics context. This value overrides the system context for this control and any children.
If aGraphicsContext is null, the control's graphics context is reset to the one it inherited from its parent, or to the default
system graphics context (iCoeEnv->CCoeControl::SystemGc()const
) if none of its parents have set their own graphics context.
This value is retrieved by CCoeControl::SystemGc()const
.
|
|
IMPORT_C CWindowGc* CustomGc() const;
Returns the custom graphics context set for this control (if any). Note that unlike CCoeControl::SystemGc()const
, this function ignores the parent window's state and returns the context set explicitly for this control instance, or NULL
if none has been set.
|
IMPORT_C void SetControlContext(MCoeControlContext *aContext);
Set the control context for this control.
|
IMPORT_C void CopyControlContextFrom(const CCoeControl *aControl);
Sets the control's context from another control.
|
IMPORT_C MCoeControlContext* ControlContext() const;
Gets the control context being used by this control.
The function does not transfer ownership to the caller.
|
IMPORT_C void SetPointerCapture(TBool aCapture=ETrue);
Sets pointer capture.
Once set, pointer capture lasts until CCoeControl::SetPointerCapture(TBool)
is called on the control with aCapture=EFalse.
This function is typically used by dialogs, to discard any pointer events that occur outside of the dialog.
|
RWindowBase::SetPointerCapture(TInt)
Sets the pointer capture state.IMPORT_C void ClaimPointerGrab(TBool aSendUpEvent=ETrue);
Claims pointer grab from another control.
This ensures that all subsequent pointer events are delivered to it and not to the control that originally owned the grab.
The function allows a control to claim the pointer grab only if the pointer is already grabbed by another control.
|
RWindowBase::ClaimPointerGrab(TBool)
Claims the pointer grab from another window.IMPORT_C void IgnoreEventsUntilNextPointerUp();
Sets the control to ignore pointer events until the next pointer up.
This means that all events until and including the next pointer up event are discarded and are not processed.
This can be used for example if the user presses the Esc key while selecting text by dragging the pointer device to endure that further dragging does not result in continued selection.
IMPORT_C void SetGloballyCapturing(TBool aGlobal);
Sets the global pointer capture flag.
This flag indicates whether or not pointer capture should be global.
The flag is used by CCoeControl::SetPointerCapture(TBool)
to determine what value to pass to RWindowBase::SetPointerCapture(TInt)
. The default for the global capture flag, when a control is created, is EFalse.
|
IMPORT_C TInt SetHitTest(const MCoeControlHitTest *aHitTestControl);
Installs a hit tester for this control. The tester defines the hit region, which is the area within the control that accepts pointer events. If no hit region is set, pointer events are accepted in the control's entire rectangle.
|
|
IMPORT_C const MCoeControlHitTest* HitTest() const;
Gets the object that defines the hit region inside the control's rectangle. The object is set by calling CCoeControl::SetHitTest(const MCoeControlHitTest *)
.
|
IMPORT_C void OverrideColorL(TInt aLogicalColor, TRgb aColor);
Overrides the control's colour setting, as specified in the application's colour scheme.
This function does not change the application's colour scheme. It changes the colour mapping used in this control only.
|
CCoeControl::GetColor(TInt,TRgb &)const
Gets the overridden physical colour.IMPORT_C TBool GetColor(TInt aLogicalColor, TRgb &aColor) const;
Gets the overridden physical colour.
This is the colour which has been mapped to the logical colour specified by a call to CCoeControl::OverrideColorL(TInt,TRgb)
. If the logical colour specified has not been overridden, the aColor value is not changed.
|
|
IMPORT_C void DrawBackground(const TRect &aRect) const;
Draws the control's background using its graphics context. Unlike CCoeControl::DrawNow()const
and CCoeControl::DrawDeferred()const
, this function does not propagate the draw to component controls.
|
IMPORT_C void DrawForeground(const TRect &aRect) const;
Draws the control's foreground using the control's graphics context. Unlike CCoeControl::DrawNow()const
and CCoeControl::DrawDeferred()const
, this function does not propagate the draw to component controls.
|
IMPORT_C const MCoeControlBackground* Background() const;
Returns the background drawer object associated with this object, if any. Null is returned if there is no such object. Compare
with CCoeControl::FindBackground()const
, which looks up the parent chain to find a background drawer.
|
IMPORT_C const MCoeControlBackground* FindBackground() const;
Return an MCoeControlBackground
object, if there is one - looking up the parent chain as necessary. Compare to CCoeControl::Background()const
, which does not go up the parent chain.
|
IMPORT_C void SetBackground(const MCoeControlBackground *aBackground);
Sets a pointer to a MCoeControlBackground
object that is responsible for drawing the control's background
|
IMPORT_C void SetZoomFactorL(TInt aZoomFactor, TZoomType aZoomType=ERelativeZoom);
Set the zoom factor for this control.
|
IMPORT_C TZoomFactor AccumulatedZoom() const;
Return the zoom factor for this control. Takes account of zoom factors in parent controls to calculate accumulated zoom factor.
|
IMPORT_C const TCoeZoomWithType* ZoomWithType() const;
Return the zoom factor but without taking into account the zoom factor of the parent. Use of CCoeControl::AccumulatedZoom()const
is recommended as it takes into account the zoom factor of the parent.
|
IMPORT_C const CCoeFontProvider& FindFontProvider() const;
Return the font provider used by this control
|
IMPORT_C void SetFontProviderL(const CCoeFontProvider &aFontProvider);
Set the font provider. This is an external object that takes the responsibililty for finding an appropriate font away from the control.
|
IMPORT_C virtual TInt TextBaselineOffset(const TSize &aSize) const;
Gets the offset to the first text baseline relative to the top of the control.
The default implementation calls CalcTextBaselineOffset of the layout manager if one is installed. It returns 0 if no layout manager is installed.
Derived classes that don't want to use the layout manager and still want to return a baseline offset should re-implement this function.
|
|
IMPORT_C virtual void SetTextBaselineSpacing(TInt aSpacing);
Sets the spacing between text baselines.
The default implementation calls SetTextBaselineSpacing of the layout manager if one is installed. It does nothing if there is no layout manager.
Derived classes that don't want to use the layout manager and still want to do something when the this function is called should re-implement it.
|
IMPORT_C TCoeInputCapabilities RecursivelyMergedInputCapabilities() const;
Gets the input capabilities of the control and all its components.
|
IMPORT_C void SetMopParent(MObjectProvider *aParent);
Sets the context - that is, the enclosing parent control - for this control. If setting aParent as MopParent of this control creates a cyclic relationship, this method will do nothing.
|
IMPORT_C TInt UniqueHandle() const;
Returns a Unique Handle (identifier) previously allocated to the control.
|
CCoeControl::SetUniqueHandle(TInt)
Sets a Unique Handle (identifier). That the number is unique is the perogative o...IMPORT_C TInt SetUniqueHandle(TInt aUniqueHandle);
Sets a Unique Handle (identifier). That the number is unique is the perogative of the caller!
|
|
CCoeControl::UniqueHandle()const
Returns a Unique Handle (identifier) previously allocated to the control.IMPORT_C virtual void HandlePointerEventL(const TPointerEvent &aPointerEvent);
Handles pointer events.
This function gets called whenever a pointer event occurs in the control, i.e. when the pointer is within the control's extent, or when the control has grabbed the pointer. The control should implement this function to handle pointer events.
Note: events of type EButton1Down are processed before CCoeControl::HandlePointerEventL(const TPointerEvent &)
is called, in order to transfer keyboard focus to the control in which the EButton1Down event occurred.
If overriding CCoeControl::HandlePointerEventL(const TPointerEvent &)
, the implementation must include a base call to CCoeControl's CCoeControl::HandlePointerEventL(const TPointerEvent &)
.
|
protected: IMPORT_C virtual void HandlePointerBufferReadyL();
Handles pointer buffer ready events.
This function is called whenever the control receives an event of type EEventPointerBufferReady, unless one of its component controls has grabbed the pointer, in which case the function is called on that control. An event of type EEventPointerBufferReady will only be received if the pointer move buffer has been set up using window server functions.
The pointer move buffer is typically used when the application requires a continuous stream of pointer drag events, such as in a drawing application.
RWindowBase::AllocPointerMoveBuffer(TInt,TUint)
Allocates a buffer for storing pointer movements.protected: IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow);
Responds to a change in focus.
This is called whenever the control gains or loses focus, as a result of a call to CCoeControl::SetFocus(TBool,TDrawNow)
. A typical use of CCoeControl::FocusChanged(TDrawNow)
is to change the appearance of the control, for example by drawing a focus rectangle around it.
The default implementation is empty, and should be overridden by the CCoeControl-derived class.
|
protected: IMPORT_C virtual void SizeChanged();
Responds to changes to the size and position of the contents of this control.
For a simple control this might include text or graphics. For a compound control it sets the size and position of the components.
The function is called whenever CCoeControl::SetExtent(const TPoint &,const TSize &)
, CCoeControl::SetSize(const TSize &)
, CCoeControl::SetRect(const TRect &)
, CCoeControl::SetCornerAndSize(TGulAlignment,const TSize &)
, or CCoeControl::SetExtentToWholeScreen()
are called on the control. Note that the window server does not generate size-changed events: CCoeControl::SizeChanged()
gets called only as a result of calling the functions listed above. Therefore, if a resize of one control affects the size
of other controls, it is up to the application to ensure that it handles the re-sizing of all affected controls.
protected: IMPORT_C virtual void PositionChanged();
Responds to changes in the position of a control.
It has an empty default implementation which may be overridden by the CCoeControl-derived class.
This function is called whenever the application calls CCoeControl::SetPosition(const TPoint &)
on the control.
IMPORT_C virtual TInt CountComponentControls() const;
Gets the number of controls contained in a compound control.
There are 2 ways to implement a compound control. One way is to override this function. The other way is to use the CCoeControlArray
functionality (see the InitComponentArrayL method).
|
IMPORT_C virtual CCoeControl* ComponentControl(TInt aIndex) const;
Gets an indexed component of a compound control.
There are 2 ways to implement a compound control. One way is to override this function. The other way is to use the CCoeControlArray
functionality (see the InitComponentArrayL method).
Note: within a compound control, each component control is identified by an index, where the index depends on the order the controls were added: the first is given an index of 0, the next an index of 1, and so on.
|
|
IMPORT_C TInt Index(const CCoeControl *aControl) const;
Gets the index of a control that is a component of this control.
|
|
protected: IMPORT_C TBool IsActivated() const;
Tests if the control has been activated.
A control is not ready to draw until it is activated.
|
protected: IMPORT_C TBool IsBeingDestroyed() const;
Tests if the control is being destroyed.
|
protected: IMPORT_C void InitComponentArrayL();
Creates a component array to store child controls.
This function is useful when the control is a compound control. It creates an array where the child controls can be stored.
The CCoeControl::Components()
return the created array. The CCoeControlArray
class provides functions to easily add and remove controls.
protected: IMPORT_C CCoeControlArray& Components();
Returns a component array to store child controls.
This function is useful when the control is a compound control. The CCoeControlArray
class provides functions to easily add and remove controls. The array must have been created before this function can be
called. The InitComponentArrayL does this.
|
CCoeControl::InitComponentArrayL()
Creates a component array to store child controls.protected: IMPORT_C const CCoeControlArray& Components() const;
Returns a component array to store child controls.
This function is useful when the control is a compound control. The CCoeControlArray
class provides functions to easily add and remove controls. The array must have been created before this function can be
called. The InitComponentArrayL does this.
|
CCoeControl::InitComponentArrayL()
Creates a component array to store child controls.protected: IMPORT_C RWindow& Window() const;
Gets the control's associated window.
The control must be window owning, and the window must be of type RWindow
. If you don't know whether the window is of type RWindow
or RBackedUpWindow
, you should use CCoeControl::DrawableWindow()const
.
|
protected: IMPORT_C RBackedUpWindow& BackedUpWindow() const;
Gets the backed-up window owned by the control.
The window must be of type RBackedUpWindow
. If you don't know whether the window is of type RWindow
or RBackedUpWindow
, you should use CCoeControl::DrawableWindow()const
.
|
protected: IMPORT_C void CloseWindow();
Closes the window owned by this control.
It is called from CCoeControl's destructor for window-owning controls.
protected: IMPORT_C void CreateWindowL();
Creates a control's window.
The created window is the child of the application's window group.
This function makes the specified control a window-owning control, and would typically be called in the control's ConstructL() function.
Note:
The use of window owning controls is discouraged, as these tax run-time resources. Ideally only the top level control in an appUi would be window owning. There are some exceptions to this rule, e.g. floating controls like menus, dialogs and scroll bars.
protected: IMPORT_C void CreateWindowL(const CCoeControl *aParent);
Creates a control's window, specifying the parent control.
The control's window is created as a child of the parent control's window.
This function makes the specified control a window-owning control, and would typically be called in the control's ConstructL() function.
Note:
The use of window owning controls is discouraged, as these tax run-time resources. Ideally only the top level control in an appUi would be window owning. There are some exceptions to this rule, e.g. floating controls like menus, dialogs and scroll bars.
In general, the overload with no parameters should be used.
|
protected: IMPORT_C void CreateWindowL(RWindowTreeNode &aParent);
Creates a control's window, specifying its parent window and its extent.
This function makes the specified control a window-owning control, and would typically be called in the control's ConstructL() function. It also sets the window's extent to that of the control.
Note:
The use of window owning controls is discouraged, as these tax run-time resources. Ideally only the top level control in an appUi would be window owning. There are some exceptions to this rule, e.g. floating controls like menus, dialogs and scroll bars.
In general, the overload with no parameters should be used.
|
protected: IMPORT_C void CreateWindowL(RWindowGroup *aParent);
Creates a control's window, specifying its parent window group.
This function makes the specified control a window-owning control, and would typically be called in the control's ConstructL() function.
Note:
The use of window owning controls is discouraged, as these tax run-time resources. Ideally only the top level control in an appUi would be window owning. There are some exceptions to this rule, e.g. floating controls like menus, dialogs and scroll bars.
In general, the overload with no parameters should be used.
|
protected: IMPORT_C void CreateBackedUpWindowL(RWindowTreeNode &aParent);
Creates a control's window as a backed-up window.
The new window is the child of aParent and the display mode of the control becomes the same as that of aParent.
|
protected: IMPORT_C void CreateBackedUpWindowL(RWindowTreeNode &aParent, TDisplayMode aDisplayMode);
Creates a control's window as a backed-up window, specifying the display mode.
The new window is the child of aParent and the display mode of the control is set to aDisplayMode. Furthermore, the window's extent is set to that of the control.
|
protected: IMPORT_C void SetCornerAndSize(TGulAlignment aCorner, const TSize &aSize);
Sets the control's alignment and size.
The control's position is calculated, relative to the screen, according to the requested alignment.
Note: calling this function results in a call to CCoeControl::SizeChanged()
.
|
protected: IMPORT_C void SetSizeWithoutNotification(const TSize &aSize);
Sets a control's size without calling CCoeControl::SizeChanged()
.
If the size, but not the position, of a control is set, then its position will default to TPoint(0,0).
|
CCoeControl::SetSize(const TSize &)
Sets the control's size.protected: IMPORT_C const CFont& ScreenFont(const TCoeFont &aFont) const;
Return the correct font given the supplied font and taking into account the current zoom factor.
|
|
protected: IMPORT_C CCoeTextDrawerBase& TextDrawer(TInt aKey=KErrNotFound) const;
Gets the text drawer to be used for the control. This method returns a reference simply because the return value must never
be NULL. The ownership transfer rules of the returned CCoeTextDrawerBase
object obey specific rules. If the CCoeTextDrawerBase::IsReusable()const
flag is set then the caller must call Reset when the object is not needed anymore else it should simply delete the object.
The XCoeTextDrawer
class is a wrapper around the CCoeTextDrawerBase
that will implement this logic automatically. The method will start with the default text drawer. It then allows the childs
background control to change the text drawer if the child itself is window owning. Otherwise only the parent control can change
the text drawer.
|
|
protected: IMPORT_C void EnableDragEvents();
Requests pointer drag events.
This function should be called if a control is required to receive pointer drag and move events. The default behaviour for all controls is that pointer drag and move events are not delivered.
The control framework does not provide a function to disable drag events at a later time, but this can be done via the Window
Server API, by calling CCoeControl::Window()const
->PointerFilter().
Note:
By default, pointer move events are not delivered, even after calling CCoeControl::EnableDragEvents()
, because they are not normally required in a pen-based system. The window server can be configured to deliver pointer move
events if required, e.g. for a mouse-based system.
RWindowBase::PointerFilter(TUint32,TUint32)
Sets the filter which controls which pointer events are sent to the client sessi...protected: IMPORT_C void HandleRedrawEvent(const TRect &aRect) const;
Handles redraw events.
In normal circumstances this function should not be used or overridden by the derived control class.
|
protected: IMPORT_C void SetAllowStrayPointers();
Sets whether or not to allow stray pointer events.
This function sets a flag that affects the way the control framework handles pointer events. By default, the flag is not set, and the control will ignore any pointer drag events and up events where the matching pointer down event occurred in a different control. This would happen if a user pressed the pointer down in a control, but then dragged the pointer into a different control before releasing it.
CCoeControl::SetAllowStrayPointers()
is typically used for menus, where stray pointer events are required because it is the pointer up event that is used to activate
a menu option even when the pointer down event occured in a different menu pane. This is not the case in some other components
such as command buttons, where a pointer down event and up event in succession are required to activate the button.
protected: IMPORT_C CCoeControl* GrabbingComponent() const;
Gets the component of this control which is grabbing the pointer.
|
protected: IMPORT_C TBool CapturesPointer() const;
Tests whether pointer capture is set for the control.
This returns true if CCoeControl::SetPointerCapture(TBool)
has been called with aCapture=ETrue.
|
protected: IMPORT_C TBool IsReadyToDraw() const;
Tests if the control is ready for drawing.
This returns true if the control has been activated and is visible.
|
protected: IMPORT_C TBool IsBlank() const;
Tests if the control is blank.
This simply gets the value of the flag set by CCoeControl::SetBlank()
.
|
protected: IMPORT_C void SetBlank();
Sets a flag to indicate that the control is blank.
Once set, this flag cannot be unset for the lifetime of the control.
CCoeControl::IsBlank()const
Tests if the control is blank.protected: IMPORT_C void SetCanDrawOutsideRect();
Allows the control to draw outside its own extent.
When a compound control is drawn, all its component controls are also drawn. However, unless this flag is set, they are not drawn if the rectangle they inhabit on the screen doesn't intersect with the rectangle to be drawn.
Setting this flag has the effect of allowing a component control to draw outside its own extent. It should be used with caution! By default, this flag is not set.
protected: IMPORT_C void ActivateGc() const;
Activates the standard graphics context.
This is the graphics context owned by the control environment (CCoeEnv
).
Applications do not normally need to call this function, as it is called by the control framework whenever it is about to
call CCoeControl::Draw(const TRect &)const
.
protected: IMPORT_C void DeactivateGc() const;
Deactivates the standard graphics context owned by the UI control framework.
Applications do not normally need to call this function, as it is called by the control framework whenever it has called CCoeControl::Draw(const TRect &)const
and drawing is completed.
protected: IMPORT_C void ResetGc() const;
Resets the standard graphics context.
The function resets the graphics context owned by the control environment to its default settings.
protected: IMPORT_C void ReportEventL(MCoeControlObserver::TCoeEvent aEvent);
Sends an event to the control's observer (if the control has one).
|
protected: IMPORT_C void HandleComponentControlsResourceChange(TInt aType);
Handles a change to the resources in the components of a compound control.
|
CCoeControl::HandleResourceChange(TInt)
Handles a change to the control's resources.protected: inline CCoeControl& operator=(const CCoeControl &aControl);
|
|
protected: IMPORT_C virtual void HandleControlArrayEventL(CCoeControlArray::TEvent aEvent, const CCoeControlArray *aArray,
CCoeControl *aControl, TInt aControlId);
Handles events generated by the CCoeControlArray
.
This function is useful when the control is a compound control and the CCoeControlArray
functionality is used. The CCoeControlArray
functions that add and remove controls will use this event handler to notify the control that child controls have been added
or removed.
The default implementation of this function forwards the events to the layout manager (if there is one). If the event is EControlAdded it also sets the container window of the new child control unless the child control is a window owning control. If the event is EControlRemoved it also sets the parent of the removed child control to null.
|
private: IMPORT_C virtual void GetTextDrawer(CCoeTextDrawerBase *&aTextDrawer, const CCoeControl *aDrawingControl, TInt aKey)
const;
Controls that want to change or replace the text drawer that it or its children controls use shall override this method. The aTextDrawer argument is guaranteed never to be NULL, and the control can choose to modify it or create a new text drawer in its place.
|
protected: IMPORT_C virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
Retrieves an object of the same type as that encapsulated in aId.
This function is used to allow controls to ask their owners for access to other objects that they own.
Other than in the case where NULL is returned, the object returned must be of the same object type - that is, the ETypeId member of the object pointed to by the pointer returned by this function must be equal to the iUid member of aId.
|
|
private: IMPORT_C virtual MObjectProvider* MopNext();
Retrieves the control's parent.
This function may be overridden to continue the chain of object providers which are to be asked to supply an object.
When overriding this function for any given class of control, it is important to ensure that the function does not return, either directly or indirectly, a pointer to the instance of that class on which the function was called. For example, suppose that bar is an object of class foo. The override for the class foo could legitimately return a pointer to the object provider in which bar is contained, but must never return a pointer either to bar or to an object provider which may return bar. Failure to observe this restriction may result in an infinite loop.
|
private: IMPORT_C virtual void Draw(const TRect &aRect) const;
Draws the control.
All controls, except blank controls, should implement this function. The default implementation draws a blank control.
This function is called by window server. It is used for window server-initiated redrawing of controls, and for some application-initiated drawing. It should be implemented by each control, but is only called from within CCoeControl's member functions, and not from the derived class. For this reason it is a private member function of CCoeControl.
The rectangle aRect indicates the region of the control that needs to be redrawn. The implementation of CCoeControl::Draw(const TRect &)const
must always draw to every pixel within this rectangle.
Notes:
For non-window-owning controls, care must be taken not to draw outside the control, as drawing will not be clipped to the control. Drawing is clipped to window-owning-controls, but not to non-window-owning controls.
Drawing outside aRect may cause flicker.
Drawing should be done using a graphics context (CWindowGc
), which can be obtained using CCoeControl::SystemGc()const
.
|
protected: IMPORT_C virtual void WriteInternalStateL(RWriteStream &aWriteStream) const;
|
Interface status: | deprecated |
inline TInt SetGc(CWindowGc *aGraphicsContext) const;
Deprecated. See CCoeControl::SetCustomGc(CWindowGc *)
.
|
|
Interface status: | deprecated |
inline CWindowGc* GetGc() const;
Deprecated. See CCoeControl::CustomGc()const
.
|
IMPORT_C void EnableReportControlStateChange(TBool aState);
Set the status of the report control state change.
|
CCoeControl::SetDimmed(TBool)
Sets the control to be dimmed.CCoeControl::MakeVisible(TBool)
Sets this control as visible or invisible.protected: TSize iSize;