UIQ Technology
Symbian OS Library

UIQ 3.1 SDK        UIQ developer portal

[Index] [Spacer] [Previous] [Next]



Location: EIKCMBOX.H
Link against: eikctl.lib

Class CEikComboBox

class CEikComboBox : public CEikBorderedControl, public MCoeControlObserver, public MQikControlStreamInterface, public MQikTextRepresentationInterface;

Description

A combo-box allows an item from a list to be chosen, or a new item entered, by a user.

The available items can be viewed in a drop-down list.

Derivation

  • 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
  • Members

    Defined in CEikComboBox:
    Array(), Array(), CEikComboBox(), ComponentControl(), ConstructFromResourceL(), ConstructL(), CountComponentControls(), Draw(), EArrayExternalOwner, EArrayInternalOwner, EDisableAutoSelection, Edwin(), Edwin(), FocusChanged(), GetColorUseListL(), GetText(), HandleControlEventL(), HandleResourceChange(), InputCapabilities(), InsertTextIntoArrayL(), MaxArraySize(), MinimumSize(), MopSupplyObject(), OfferKeyEventL(), PrepareForFocusGainL(), PrepareForFocusLossL(), RestoreUserDataL(), SetArrayL(), SetArrayL(), SetControlValueObserver(), SetDimmed(), SetTextL(), SizeChanged(), StoreUserDataL(), TArrayOwnershipType, TFlags, TextRepresentationL(), ~CEikComboBox()

    Inherited from CBase:
    Delete(), Extension_(), operator new()

    Inherited from CCoeControl:
    AccumulatedZoom(), ActivateGc(), BackedUpWindow(), Background(), CapturesPointer(), ClaimPointerGrab(), CloseWindow(), ComponentArrayExists(), Components(), ControlContext(), ControlEnv(), CopyControlContextFrom(), CreateBackedUpWindowL(), CreateWindowL(), DeactivateGc(), DrawBackground(), DrawDeferred(), DrawForeground(), DrawNow(), DrawableWindow(), EAbsoluteZoom, ERelativeZoom, EnableDragEvents(), FindBackground(), FindFontProvider(), GetColor(), GetGc(), GetTextDrawer(), GrabbingComponent(), HandleComponentControlsResourceChange(), HandleRedrawEvent(), HitTest(), IgnoreEventsUntilNextPointerUp(), Index(), InitComponentArrayL(), IsActivated(), IsBackedUp(), IsBeingDestroyed(), IsBlank(), IsDimmed(), IsFocused(), IsNonFocusing(), IsReadyToDraw(), IsVisible(), LayoutManager(), MaximumWidth(), MopNext(), Observer(), OverrideColorL(), OwnsWindow(), Parent(), Position(), PositionRelativeToScreen(), Rect(), RecursivelyMergedInputCapabilities(), ReportEventL(), Reserved_2(), ResetGc(), ScreenFont(), SetAllowStrayPointers(), SetBackground(), SetBlank(), SetCanDrawOutsideRect(), SetComponentsToInheritVisibility(), SetControlContext(), SetCornerAndSize(), SetExtent(), SetExtentToWholeScreen(), SetFocus(), SetFocusing(), SetFontProviderL(), SetGc(), SetGloballyCapturing(), SetHitTest(), SetMaximumWidth(), SetMopParent(), SetNonFocusing(), SetObserver(), SetPointerCapture(), SetPosition(), SetRect(), SetSize(), SetSizeWithoutNotification(), SetUniqueHandle(), SetZoomFactorL(), Size(), SystemGc(), TZoomType, TextDrawer(), UniqueHandle(), Window(), ZoomWithType(), iCoeEnv, iContext, iPosition, iSize

    Inherited from CEikBorderedControl:
    ActivateL(), Border(), GetHelpContext(), HandleControlArrayEventL(), HandlePointerBufferReadyL(), HandlePointerEventL(), HasBorder(), MakeVisible(), PositionChanged(), RequestRelayout(), SetAdjacent(), SetBorder(), SetContainerWindowL(), SetLayoutManagerL(), SetNeighbor(), SetParent(), SetTextBaselineSpacing(), TextBaselineOffset(), WriteInternalStateL(), iBorder

    Inherited from MCoeControlObserver:
    EEventInteractionRefused, EEventPrepareFocusTransition, EEventRequestCancel, EEventRequestExit, EEventRequestFocus, EEventStateChanged, MCoeControlObserver_Reserved1(), MCoeControlObserver_Reserved2(), TCoeEvent

    Inherited from MEikBorderedControl:
    ETypeId, anonymous

    Inherited from MObjectProvider:
    MObjectProvider_Reserved1(), MObjectProvider_Reserved2(), MopGetObject(), MopGetObjectNoChaining()


    Construction and destruction


    CEikComboBox()

    IMPORT_C CEikComboBox();

    Description

    First phase of construction of a combo-box.

    Complete construction with ConstructFromResourceL() or ConstructL() .


    ~CEikComboBox()

    IMPORT_C ~CEikComboBox();

    Description

    Destructor.

    Deletes the array of combo box items if it is not set as externally owned.


    ConstructL()

    IMPORT_C void ConstructL(TInt aWidthInChars, TInt aTextLimit, TInt aMaxArraySize, TUint aFlags=0);

    Description

    Completes construction of a combo box.

    Parameters

    TInt aWidthInChars

    The width of the combo box, in characters.

    TInt aTextLimit

    Maximum length for the text to display.

    TInt aMaxArraySize

    The maximum size of the array used to hold combo box items.

    TUint aFlags

    Flags for the combo box. See CEikComboBox::TFlags enum.

    [Top]


    Member functions


    Array()

    IMPORT_C const MDesC16Array *Array() const;

    Description

    Gets a pointer to the array of combo box items.

    Return value

    const MDesC16Array *

    The array of combo box items.


    Array()

    IMPORT_C MDesC16Array *Array();

    Description

    Return value

    MDesC16Array *


    SetArrayL()

    IMPORT_C void SetArrayL(TInt aResourceId, TArrayOwnershipType aOwner=EArrayInternalOwner);

    Description

    Sets the array of combo box items from resource.

    Parameters

    TInt aResourceId

    The ID of the resource to use.

    TArrayOwnershipType aOwner

    The array's ownership type.


    SetArrayL()

    IMPORT_C void SetArrayL(MDesC16Array *aArray, TArrayOwnershipType aOwner=EArrayInternalOwner);

    Description

    Sets the combo-box item array.

    Parameters

    MDesC16Array *aArray

    The array.

    TArrayOwnershipType aOwner

    The array's ownership type.

    Panic codes

    EEikPanicInvalidLength

    DEBUG_BUILDS: The length of a string in the array is longer than the textlimit of the edwin. RELEASE_BUILDS: Does nothing.


    GetText()

    IMPORT_C void GetText(TDes &aDes) const;

    Description

    Gets the text currently held in the Edwin used to edit combo box items.

    Parameters

    TDes &aDes


    SetTextL()

    IMPORT_C void SetTextL(const TDesC *aDes);

    Description

    Sets the text to be edited with the Edwin.

    Parameters

    const TDesC *aDes

    The text to be edited with the Edwin.


    InsertTextIntoArrayL()

    IMPORT_C void InsertTextIntoArrayL();

    Description

    Inserts the text held in the Edwin into the combo-box item array.


    Edwin()

    IMPORT_C const CEikEdwin *Edwin() const;

    Description

    Gets a pointer to the Edwin used to edit the combo box items.

    Return value

    const CEikEdwin *

    The Edwin used to edit the combo box items.


    Edwin()

    IMPORT_C CEikEdwin *Edwin();

    Description

    Return value

    CEikEdwin *


    MaxArraySize()

    IMPORT_C TInt MaxArraySize() const;

    Description

    Gets the maximum size of the combo-box item array.

    Return value

    TInt

    The maximum size.


    OfferKeyEventL()

    virtual IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);

    Description

    Handles key events.

    Parameters

    const TKeyEvent &aKeyEvent

    The key event.

    TEventCode aType

    The type of key event.

    Return value

    TKeyResponse

    The combo box's response to the key event.

    See also:


    ConstructFromResourceL()

    virtual IMPORT_C void ConstructFromResourceL(TResourceReader &aReader);

    Description

    Completes construction of a combo-box from resource.

    Parameters

    TResourceReader &aReader

    The resource reader to use.

    See also:


    MinimumSize()

    virtual IMPORT_C TSize MinimumSize();

    Description

    Gets the minimum size of the combo-box including the space required for the Edwin.

    Return value

    TSize

    The minimum size of the combo-box.

    See also:


    FocusChanged()

    virtual IMPORT_C void FocusChanged(TDrawNow aDrawNow);

    Description

    Passes focus to the Edwin used to edit the combo box items.

    Parameters

    TDrawNow aDrawNow

    Indicates whether the Edwin is drawn immediately.


    GetColorUseListL()

    virtual IMPORT_C void GetColorUseListL(CArrayFix< TCoeColorUse > &aColorUseList) const;

    Description

    Gets the list of colours used to draw the combo box.

    Parameters

    CArrayFix< TCoeColorUse > &aColorUseList

    On return, the list of colours used to draw the combo box.

    See also:


    HandleResourceChange()

    virtual IMPORT_C void HandleResourceChange(TInt aType);

    Description

    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.

    Parameters

    TInt aType

    A message UID value.

    See also:


    SetDimmed()

    virtual IMPORT_C void SetDimmed(TBool aDimmed);

    Description

    Sets the combo box dim state.

    Parameters

    TBool aDimmed

    ETrue to set the combo box as dimmed, EFalse otherwise.

    See also:


    InputCapabilities()

    virtual IMPORT_C TCoeInputCapabilities InputCapabilities() const;

    Description

    Return value

    TCoeInputCapabilities

    See also:


    PrepareForFocusGainL()

    virtual IMPORT_C void PrepareForFocusGainL();

    Description

    See also:


    PrepareForFocusLossL()

    virtual IMPORT_C void PrepareForFocusLossL();

    Description

    See also:


    TextRepresentationL()

    virtual IMPORT_C HBufC *TextRepresentationL() const;

    Description

    This method shall return a textual representation of the controls current value

    Return value

    HBufC *


    SetControlValueObserver()

    virtual IMPORT_C void SetControlValueObserver(MQikControlValueObserver *aObserver);

    Description

    This method is used to set the control value observer that shall later be notified of control value changes.

    Parameters

    MQikControlValueObserver *aObserver


    StoreUserDataL()

    protected: virtual IMPORT_C void StoreUserDataL(RWriteStream &aWriteStream) const;

    Description

    Write the current value of the control to aWriteStream

    Parameters

    RWriteStream &aWriteStream

    The stream that the current control value should be written to


    RestoreUserDataL()

    protected: virtual IMPORT_C void RestoreUserDataL(RReadStream &aReadStream);

    Description

    Read the previously written value of the control from aReadStream

    Parameters

    RReadStream &aReadStream

    The stream that holds the previously stored control value


    HandleControlEventL()

    protected: virtual IMPORT_C void HandleControlEventL(CCoeControl *aControl, TCoeEvent aEvent);

    Description

    Handles control events.

    Parameters

    CCoeControl *aControl

    The control that sent the event.

    TCoeEvent aEvent

    The control event.

    See also:


    CountComponentControls()

    protected: virtual IMPORT_C TInt CountComponentControls() const;

    Description

    Gets the number of component controls.

    This will be two, as the component controls are the Edwin and the tab button.

    Return value

    TInt

    The number of component controls.


    ComponentControl()

    protected: virtual IMPORT_C CCoeControl *ComponentControl(TInt aIndex) const;

    Description

    Gets the specified component control.

    Parameters

    TInt aIndex

    The ID of the required component control.

    Return value

    CCoeControl *

    The component control with the specified index.

    See also:


    SizeChanged()

    protected: virtual IMPORT_C void SizeChanged();

    Description

    Responds to a change in the combo box size.

    Panics if there is insufficient width or height available to display the combo box.

    See also:


    Draw()

    protected: virtual IMPORT_C void Draw(const TRect &aRect) const;

    Description

    Draws the combo box in the specified rectangle.

    Parameters

    const TRect &aRect

    The rectangle in which to draw the combo box. aRect not used.

    See also:


    MopSupplyObject()

    protected: virtual IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);

    Description

    Gets an object whose type is encapsulated by the specified TTypeUid object.

    Parameters

    TTypeUid aId

    Encapsulates the Uid that identifies the type of object required.

    Return value

    TTypeUid::Ptr

    Encapsulates the pointer to the object provided. Note that the encapsulated pointer may be NULL.

    [Top]


    Member enumerations


    Enum TArrayOwnershipType

    TArrayOwnershipType

    Description

    EArrayInternalOwner

    EArrayExternalOwner


    Enum TFlags

    TFlags

    Description

    EDisableAutoSelection

    Disables automatic selection of the text when the Edwin gets focus.