UIQ Technology
Symbian OS Library

UIQ 3.1 SDK        UIQ developer portal

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



Location: EIKCHLST.H
Link against: eikctl.lib

Class CEikChoiceListBase

class CEikChoiceListBase : public CEikBorderedControl, public MCoeControlObserver;

Description

Base class for a choice list control.

A choice list is a CEikBorderedControl that enables users to select one or more items.

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 CEikChoiceListBase:
    ActivateL(), AllowPopout(), Array(), Array(), CEikChoiceListBase(), CEikChoiceListBase_Reserved_1(), CalculateTextWidth(), ContentHasChangedL(), CreatePopoutL(), CurrentItem(), CurrentItemChangedL(), CursorPos(), DesCArray(), DesCArray(), DestroyArray(), DestroyPopout(), DisplayCursor(), Draw(), DrawContent(), DrawContentNow(), EArrayOwnedExternally, EIncrementalMatching, EMirrorOutput, ENoPopout, FocusChanged(), Font(), HandleControlEventL(), HandleInteractionConfirmedL(), HandlePointerEventL(), InputCapabilities(), KEikMaxMatchingBufLength, MatchTypedChar(), OfferKeyEventL(), PopoutCurrentItem(), ResetMatchBuf(), SetAdjacent(), SetArrayExternalOwnership(), SetArrayL(), SetArrayL(), SetCurrentItem(), SetIncrementalMatching(), SizeChanged(), TFlags, TextEdgeMargin(), TextRect(), UndoLastChar(), anonymous, iArray, iChoiceListFlags, iCurrentItem, iMatchBuf, iMaxDisplayChar, ~CEikChoiceListBase()

    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:
    Border(), ComponentControl(), ConstructFromResourceL(), CountComponentControls(), GetColorUseListL(), GetHelpContext(), HandleControlArrayEventL(), HandlePointerBufferReadyL(), HandleResourceChange(), HasBorder(), MakeVisible(), MinimumSize(), MopSupplyObject(), PositionChanged(), PrepareForFocusGainL(), PrepareForFocusLossL(), RequestRelayout(), SetBorder(), SetContainerWindowL(), SetDimmed(), 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

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


    Construction and destruction


    ~CEikChoiceListBase()

    IMPORT_C ~CEikChoiceListBase();

    Description

    Destructor.

    Deletes the match buffer and array of choice list options.


    CEikChoiceListBase()

    protected: IMPORT_C CEikChoiceListBase();

    Description

    Protected constructor.

    Constructs a CEikBordered control with a rectangular border.

    [Top]


    Member functions


    CurrentItem()

    IMPORT_C TInt CurrentItem() const;

    Description

    Gets the current item.

    Return value

    TInt

    The current item.


    SetCurrentItem()

    IMPORT_C void SetCurrentItem(TInt aItem);

    Description

    Sets the specified item as the current item.

    Parameters

    TInt aItem

    The item to set as the current item.


    SetIncrementalMatching()

    IMPORT_C void SetIncrementalMatching(TBool aAllowIncrementalMatching);

    Description

    Set whether incremental matching is allowed.

    Parameters

    TBool aAllowIncrementalMatching

    ETrue to allow incremental matching. EFalse otherwise.


    SetArrayExternalOwnership()

    IMPORT_C void SetArrayExternalOwnership(TBool aArrayOwnedExternally);

    Description

    Sets whether the array is externally owned. This does impact both on the iArray and iIconArray.

    Parameters

    TBool aArrayOwnedExternally

    ETrue to set the array as externally owned. EFalse to set the array as not externally owned.


    Array()

    IMPORT_C const MDesC16Array *Array() const;

    Description

    Gets the array of choice list options.

    Return value

    const MDesC16Array *

    The array of choice list options.


    Array()

    IMPORT_C MDesC16Array *Array();

    Description

    Gets the array of choice list options.

    Return value

    MDesC16Array *

    The array of choice list options.


    SetArrayL()

    IMPORT_C void SetArrayL(TInt aResourceId);

    Description

    Sets the array of choice list options. It can only contain texts, or if icons should be used each item (text) should start with a index. This index maps the text with the icon. Icon index -1 is used to specify that a item dont have a icon.

    Parameters

    TInt aResourceId

    The ID of the resource to use.


    SetArrayL()

    IMPORT_C void SetArrayL(MDesC16Array *aArray);

    Description

    Sets the array of choice list options. It can only contain texts, or if icons should be used each item (text) should start with a index. This index maps the text with the icon. Icon index -1 is used to specify that a item dont have a icon.

    Parameters

    MDesC16Array *aArray

    The array to set.


    DesCArray()

    IMPORT_C const CDesCArray *DesCArray() const;

    Description

    Gets the array of choice list options.

    Return value

    const CDesCArray *

    The array of choice list options.


    DesCArray()

    IMPORT_C CDesCArray *DesCArray();

    Description

    Gets the array of choice list options.

    The returned array should never be altered externally. If the data is altered, it is up to the caller to make sure that the index is correctly updated by calling CEikChoiceListBase::SetCurrentItem(TInt aItem)

    Return value

    CDesCArray *

    The array of choice list options.

    See also:


    AllowPopout()

    IMPORT_C void AllowPopout(TBool aAllow);

    Description

    Sets whether a popout from the choice list is permitted.

    Parameters

    TBool aAllow

    EFalse to allow popouts. ETrue to disallow popouts.


    TextEdgeMargin()

    static IMPORT_C TInt TextEdgeMargin();

    Description

    Gets the text's left margin.

    This function returns the value of the KEikChoiceListTextEdge constant.

    Return value

    TInt

    The text's left margin.


    HandleControlEventL()

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

    Description

    Handles control events.

    Parameters

    CCoeControl *aControl

    Not used.

    TCoeEvent aEventType

    The type of event to handle. This may be either EEventRequestExit or EEventRequestCancel .


    HandlePointerEventL()

    protected: virtual IMPORT_C void HandlePointerEventL(const TPointerEvent &aPointerEvent);

    Description

    Handles pointer events.

    Parameters

    const TPointerEvent &aPointerEvent

    The pointer event to handle.


    OfferKeyEventL()

    protected: virtual IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aEventCode);

    Description

    Passes the specified key event to the control.

    Used to navigate the choice list. Neither EKeyDownArrow events nor EKeyUpArrow events are consumed.

    Parameters

    const TKeyEvent &aKeyEvent

    The key event.

    TEventCode aEventCode

    Not used.

    Return value

    TKeyResponse

    EKeyWasConsumed if the control consumed the key event. EKeyWasNotConsumed otherwise.

    See also:


    SizeChanged()

    protected: virtual IMPORT_C void SizeChanged();

    Description

    Responds to a change in the control's viewing rectangle.

    Changes the size of the control's font if necessary.

    See also:


    ActivateL()

    protected: virtual IMPORT_C void ActivateL();

    Description

    Sets the choice list control as ready to be drawn.

    Calls CCoeControl::ActivateL() .

    See also:


    FocusChanged()

    protected: virtual IMPORT_C void FocusChanged(TDrawNow aDrawNow);

    Description

    Handles focus changes.

    The function emphasizes or de-emphasizes the view as needed, and shows or hides the matcher cursor.

    Parameters

    TDrawNow aDrawNow

    If EDrawNow , a redraw is performed immediately.


    SetAdjacent()

    protected: virtual IMPORT_C void SetAdjacent(TInt aAdjacent);

    Description

    Sets the control's adjacency.

    This function should be called, before drawing, whenever the choice list is adjacent another control as this affects both control's borders.

    Parameters

    TInt aAdjacent

    The control's border parameter.

    See also:


    Draw()

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

    Description

    Prepares the control's borders for drawing then draws the control.

    Parameters

    const TRect &aRect

    The rectangle in which to draw the control. aRect not used.

    See also:


    InputCapabilities()

    protected: virtual IMPORT_C TCoeInputCapabilities InputCapabilities() const;

    Description

    Gets the control's input capabilities.

    Return value

    TCoeInputCapabilities

    The control's input capabilities.


    CursorPos()

    protected: IMPORT_C TInt CursorPos() const;

    Description

    Gets the cursor's position.

    Return value

    TInt

    The cursor's position.


    ResetMatchBuf()

    protected: IMPORT_C void ResetMatchBuf();

    Description

    Resets the match buffer.


    CalculateTextWidth()

    protected: IMPORT_C TInt CalculateTextWidth() const;

    Description

    Gets the maximum width of a single character in pixels.

    Return value

    TInt

    The maximum width of a single character in pixels.


    CreatePopoutL()

    protected: virtual void CreatePopoutL()=0;

    Description


    DestroyPopout()

    protected: virtual void DestroyPopout()=0;

    Description


    PopoutCurrentItem()

    protected: virtual IMPORT_C TInt PopoutCurrentItem() const;

    Description

    Gets the index of the current item.

    Return value

    TInt

    The index of the current item.


    DrawContent()

    protected: virtual void DrawContent() const=0;

    Description


    DrawContentNow()

    protected: IMPORT_C void DrawContentNow() const;

    Description

    Draws the choice list's content.

    Activates the graphics context, calls CEikChoiceList::DrawContent() and deactivates the graphics context.


    HandleInteractionConfirmedL()

    protected: virtual IMPORT_C void HandleInteractionConfirmedL();

    Description

    Sets a user's selection from a popout as the current item, or resets the old item as the current item if no selection was made.

    Calls ContentHasChangedL() to update the display if a user has made a selection.

    Called by HandleControlEventL() on a user's request to exit a popout.


    CurrentItemChangedL()

    protected: virtual IMPORT_C void CurrentItemChangedL();

    Description

    For subclasses: called upon when the current choice list item has been altered.


    DestroyArray()

    protected: IMPORT_C void DestroyArray();

    Description

    Deletes the array if it is not set as externally owned.


    MatchTypedChar()

    protected: virtual IMPORT_C void MatchTypedChar(TUint aCode);

    Description

    Matches a character typed by a user to a choice list item and sets the item as current.

    If there is no match between the typed character and a choice list item the typed character is discarded.

    Parameters

    TUint aCode

    The character typed by a user.


    UndoLastChar()

    protected: IMPORT_C void UndoLastChar();

    Description

    Removes one character from the matcher buffer, then finds the first item that matches the new buffer, if any. Redraws the list box to reflect the change.


    DisplayCursor()

    protected: IMPORT_C void DisplayCursor();

    Description

    Draws the text cursor into the choice list control at the current item.

    Has no effect if the control does not have focus.


    ContentHasChangedL()

    protected: IMPORT_C void ContentHasChangedL();

    Description

    Redraws the choice list content and reports the event.

    Calls CEikChoiceListBase::DrawContentNow() .

    Reports the event by calling ReportEventL(MCoeControlObserver::EEventStateChanged) .

    If a match buffer exists it is deleted and the cursor is displayed.


    Font()

    protected: virtual IMPORT_C const CFont *Font() const;

    Description

    Gets the choice list's font.

    Return value

    const CFont *

    The choice list's font.


    TextRect()

    protected: virtual IMPORT_C TRect TextRect() const;

    Description

    Retrieves a TRect describing the rect inside the control available for e.g. text drawing.

    Return value

    TRect

    A TRect describing the rect inside the control available for e.g. text drawing.


    CEikChoiceListBase_Reserved_1()

    private: virtual IMPORT_C void CEikChoiceListBase_Reserved_1();

    Description

    Reserved for future use.

    [Top]


    Member enumerations


    Enum anonymous

    n/a

    Description

    KEikMaxMatchingBufLength


    Enum TFlags

    TFlags

    Description

    Specifies array ownership, incremental matching and whether popouts are permitted from the choice list.

    EArrayOwnedExternally

    Indicates that the choice list text array is externally owned.

    EIncrementalMatching

    Indicates that user’s keystrokes are matched incrementally.

    Set this using the SetIncrementalMatching() function.

    ENoPopout

    Indicates that no popout is permitted from the choice list.

    EMirrorOutput

    Indicates if the output shall be mirrored

    [Top]


    Member data


    iArray

    protected: MDesC16Array * iArray;

    Description

    Array of text items that comprise the choice list.


    iMatchBuf

    protected: RIncrMatcherBase * iMatchBuf;

    Description

    Pointer to the match buffer.


    iChoiceListFlags

    protected: TInt iChoiceListFlags;

    Description

    The choice list's flags. See TFlags .


    iCurrentItem

    protected: TInt iCurrentItem;

    Description

    The choice list item that is set as being current.


    iMaxDisplayChar

    protected: TInt iMaxDisplayChar;

    Description

    The maximum number of characters to be displayed in a single line.