»
UIQ 3 SDK »
UIQ Developer Library »
UIQ API Reference »
UIQ C++ Component reference »
Qikon »
CQikListBoxViewBase
Location:
QikListBoxViewBase.h
Link against: qiklbx.lib
Class CQikListBoxViewBase
class CQikListBoxViewBase : public CCoeControl, public MQikListBoxModelObserver;
Description
This is the base class for CQikListBoxRowView and CQikListBoxGridView . It handles generic view functionality common for both views. Custom views must inherit from this class.
Derivation
MQikListBoxModelObserver - The MQikListBoxModelObserver class is used by MQikListBoxModel for notifying about changes in the data in order to update the selection array
MObjectProvider - An interface that allows an object to be part of a network of object providersCBase - Base class for all classes to be instantiated on the heapCCoeControl - Control base class from which all other controls are derivedCQikListBoxViewBase - This is the base class for CQikListBoxRowView and CQikListBoxGridView
Members
Defined in CQikListBoxViewBase:
ActivateL(), AddedItemsArray(), BaseConstructFromResourceL(), CQikListBoxViewBase(), CellSize(), ClearMatchBufferL(), ComponentControl(), ConstructFromResourceL(), ConstructL(), ConsumeMatchCharacterL(), CountComponentControls(), CurrentItem(), CurrentItemIndex(), CurrentSlotId(), DoHandleContentSwappingL(), DoReverseSelectionL(), EGridView, ENoRepeatEvent, ERepeatContentSwapping, ERepeatMovingDown, ERepeatMovingUp, ERowView, FocusChanged(), GetColorUseListL(), GetHelpContext(), HScrollBarModel(), HandleContentSwappingL(), HandleControlArrayEventL(), HandleDragOutside(), HandleListBoxScrollEventL(), HandleModelChangeL(), HandlePointerBufferReadyL(), HandlePointerEventL(), HandleResourceChange(), HasBorder(), HasHighlightEnabled(), HasMultipleSelect(), HeightInRows(), Highlight(), HighlightStyle(), IncomingItemsArray(), InputCapabilities(), IsHighlightInView(), IsItemInView(), ItemArray(), ItemArray(), LastPopulationDirection(), ListBoxOrNull(), ListBoxOrNull(), Looping(), LoopingEnabled(), MakeVisible(), MinimumSize(), Mirroring(), Model(), MopSupplyObject(), MoveToCurrentItemL(), NewOrCachedItemL(), NextFocusableIndexL(), OfferKeyEventL(), PopulateViewL(), PositionChanged(), PrepareForFocusGainL(), PrepareForFocusLossL(), PreviousFocusableIndexL(), PreviousTransitionTopIndex(), RepeatEvent(), RepeatRect(), ReportEventToListBoxL(), RequestRelayout(), ResetIncomingItemsArray(), ScrollRepeatInterval(), SetAdjacent(), SetContainerWindowL(), SetCurrentItemIndexL(), SetDemarcationFromItemToView(), SetDimmed(), SetHeightInRows(), SetHighlightEnabled(), SetHighlightStyle(), SetLastPopulationDirection(), SetLayoutManagerL(), SetLooping(), SetMatchBufferL(), SetMultipleSelect(), SetNeighbor(), SetParent(), SetPreviousTransitionTopIndex(), SetRepeatEvent(), SetTextBaselineSpacing(), SetTransitionViewType(), SizeChanged(), SwappedItemsArray(), TViewRepeatEvents, TViewType, TappedItem(), TextBaselineOffset(), TransitionViewType(), TrimCache(), UpdateHighlight(), UpdateScrollBarModels(), VScrollBarModel(), ViewMargins(), iStates, ~CQikListBoxViewBase()
Inherited from CBase:
Delete(),
Extension_(),
operator new()
Inherited from CCoeControl:
AccumulatedZoom(),
ActivateGc(),
BackedUpWindow(),
Background(),
CapturesPointer(),
ClaimPointerGrab(),
CloseWindow(),
Components(),
ControlContext(),
ControlEnv(),
CopyControlContextFrom(),
CreateBackedUpWindowL(),
CreateWindowL(),
DeactivateGc(),
DrawBackground(),
DrawDeferred(),
DrawForeground(),
DrawNow(),
DrawableWindow(),
EAbsoluteZoom,
ERelativeZoom,
EnableDragEvents(),
FindBackground(),
FindFontProvider(),
GetColor(),
GetGc(),
GrabbingComponent(),
HandleComponentControlsResourceChange(),
HandleRedrawEvent(),
HitTest(),
IgnoreEventsUntilNextPointerUp(),
Index(),
InitComponentArrayL(),
IsActivated(),
IsBackedUp(),
IsBeingDestroyed(),
IsBlank(),
IsDimmed(),
IsFocused(),
IsNonFocusing(),
IsReadyToDraw(),
IsVisible(),
LayoutManager(),
MaximumWidth(),
Observer(),
OverrideColorL(),
OwnsWindow(),
Parent(),
Position(),
PositionRelativeToScreen(),
Rect(),
RecursivelyMergedInputCapabilities(),
ReportEventL(),
Reserved_CCoeControl_10(),
Reserved_CCoeControl_11(),
Reserved_CCoeControl_12(),
Reserved_CCoeControl_13(),
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(),
WriteInternalStateL(),
ZoomWithType(),
iCoeEnv,
iContext,
iPosition,
iSize
Inherited from MObjectProvider:
MopGetObject(),
MopGetObjectNoChaining()
Inherited from MQikListBoxModelObserver:
EQikListBoxAllDataRemoved,
EQikListBoxDataInserted,
EQikListBoxDataRemoved,
EQikListBoxDataSwapped,
EQikListBoxDataUpdated,
EQikListBoxModelBeginUpdate,
EQikListBoxModelEndUpdate,
TModelEvent
See also:
CQikListBoxViewDecoratorBase
Construction and destruction
virtual IMPORT_C ~CQikListBoxViewBase();
Description
Destructor
protected: IMPORT_C CQikListBoxViewBase();
Description
Constructor.
protected: IMPORT_C void ConstructL(TQikListBoxHighlightStyle aStyle);
Description
Constructs the listbox view with default values for all settings except the flags.
Parameters
See also:
HandleListBoxScrollEventL()
virtual IMPORT_C void HandleListBoxScrollEventL(CEikScrollBar *aScrollBar, TEikScrollEvent aEventType)=0;
Description
If the derived view supports scrollbars it needs to implement this method so that the scrollbar behavior wanted is gotten.
Parameters
See also:
MEikScrollBarObserver::HandleScrollEventL
virtual TSize CellSize() const=0;
Description
Calculate and return the size of a cell. A typical row view has a cell the size of the whole listbox. A grid view has a cell size the size of each cell.
Return value
TSize
|
The size of a cell. |
|
virtual const TEikScrollBarModel *VScrollBarModel() const=0;
Description
Returns a pointer to the model the ListBox will use for the vertical scrollbar, or NULL if the view does not support a vertical scrollbar.
Return value
const TEikScrollBarModel * |
A pointer to the model to be use for the vertical scrollbar or NULL if a vertical scrollbar is not supproted by the view. |
|
virtual const TEikScrollBarModel *HScrollBarModel() const=0;
Description
Returns a pointer to the model the ListBox will use for the horizontal scrollbar, or NULL if the view does not support a horizontal scrollbar.
Return value
const TEikScrollBarModel * |
A pointer to the model to be use for the horizontal scrollbar or NULL if a horizontal scrollbar is not supproted by the view. |
|
virtual IMPORT_C void ConstructFromResourceL(TResourceReader &aReader);
Description
Completes the construction of a new CQikListBoxViewBase . This method reads its data from a view struct. This function must be overriden in a derived view and a call to BaseConstructFromResourceL must be made to read the common view base properties from resource.
Parameters
virtual IMPORT_C void SetDimmed(TBool aDimmed);
Description
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.
SetDimmed() does not initiate a redraw of the control. The application should call DrawNow() or DrawDeferred() if a redraw is required after calling SetDimmed(). The control's Draw() function should draw the control appropriately according to whether it is dimmed or not. (This can be enquired using IsDimmed().)
Parameters
TBool aDimmed |
ETrue to dim the control, EFalse to set the control as not dimmed. |
|
See also:
SetDemarcationFromItemToView()
virtual IMPORT_C void SetDemarcationFromItemToView(TInt aItemIndex, const TVwsViewId &aViewUid);
Description
When doing a transition effect from a listbox item to a view this demarcation method should be called.
Parameters
TInt aItemIndex |
The index in the listbox that is the source of the demarcation. |
const TVwsViewId &aViewUid |
The view that is the destination of the transition. |
|
IMPORT_C void SetHeightInRows(TInt aHeightInRows);
Description
Set the height in rows that Minimumsize() will use to calculate the minimum size.
Parameters
TInt aHeightInRows |
The number of rows that will be multiplied with the system row height when calculating minimum size. |
|
IMPORT_C TInt HeightInRows() const;
Description
Gets the height in rows that is used to calculate minimumsize.
Return value
TInt
|
Number of rows set to be used when calculating minimum size. |
|
IMPORT_C void SetHighlightStyle(TQikListBoxHighlightStyle aStyle);
Description
Sets which type of highlight that is to be used in the view.
Parameters
See also:
IMPORT_C TQikListBoxHighlightStyle HighlightStyle() const;
Description
Checks which type of highlight that is currently used in the view.
Return value
See also:
IMPORT_C void SetHighlightEnabled(TBool aHighlight);
Description
Enables/disables highlightning in the view. Can be overriden by derived views. To enable/disable highlight in ListBox usage, use CQikListBox::SetHighlightEnabledL .
Parameters
See also:
CQikListBox::SetHighlightEnabledL
IMPORT_C TBool HasHighlightEnabled() const;
Description
Return value
TBool
|
ETrue if highlightning is enabled in view. |
|
See also:
CQikListBox::HasHighlightEnabled
IMPORT_C void SetMultipleSelect(TBool aMultiple);
Description
Do not use, instead see CQikListBox::SetMultipleSelect
Parameters
IMPORT_C TBool HasMultipleSelect() const;
Description
Return value
TBool
|
ETrue if multiple select is enabled in view. |
|
See also:
CQikListBox::HasMultipleSelect
IMPORT_C void SetMatchBufferL(const TDesC &aNewMatchBuffer);
Description
Sets a text that will be used for incremental matching. To find a match see MQikListBoxModel::FindMatchIndexL . A MQikListBoxObserver::EEventMatchBufferChanged will be reported when calling this function.
Parameters
const TDesC &aNewMatchBuffer |
A new text that will be used for subsequent matching. Max 255 characters will be used to do matching. The 255 left-most characters will be copied to the listbox's internal representation. |
|
IMPORT_C CQikListBox *ListBoxOrNull();
Description
Return value
IMPORT_C const CQikListBox *ListBoxOrNull() const;
Description
Return value
IMPORT_C const TMargins8 &ViewMargins() const;
Description
Return value
IMPORT_C void SetLooping(TQikListBoxProperty aLooping);
Description
Sets view looping behavior. The looping behavior decides whether the highlight should wrap or loop to the top item if currently on the bottom item and the user moves it further down, and vice versa if currently on the top item.
When the highlight reaches top/bottom it continues to the bottom/top.
Parameters
TQikListBoxProperty aLooping |
System, on or off. If System the view will use the system wide setting for looping. |
|
IMPORT_C TQikListBoxProperty Looping() const;
Description
Returns the current setting of the looping property.
Return value
See also:
CQikListBoxViewBase::SetLooping
IMPORT_C TBool LoopingEnabled() const;
Description
Returns the current highlight looping behavior. Returns ETrue if the looping property is set to On or System, and the system behavior is set to On. Returns EFalse if the looping property is set to Off or System, and the system behavior is set to off.
Return value
IMPORT_C TBool Mirroring() const;
Description
Return value
IMPORT_C TInt CurrentSlotId() const;
Description
Return value
protected: virtual void PopulateViewL(TQikListBoxPopulationDirection aDirection)=0;
Description
Shall fill the view with as many CQikListBoxItems as fits according to the view and give those items a in-view on screen position.
The items visible shall be set by setting a top data index and a bottom data index on the CQikListBoxItemArray, as well as constructing the items between those indexes by calling CQikListBoxViewBase::NewOrCachedItemL .
Parameters
TQikListBoxPopulationDirection aDirection |
Indicates which data index has been manipulated prior to calling this function. See TQikListBoxPopulationDirection for additional information. |
|
See also:
protected: virtual TBool UpdateScrollBarModels()=0;
Description
This method gets called when the view recieves an event signaling that the ListBox model has been updated. This is the only time when a calculation of the srollbar´s scrollspan is needed. The thumb span and thumb position must be updated as well. The method should return ETrue if there has been a change in the model that needs to be reflected on screen (will result in a call to CQikListBox::UpdateScrollBarsL). Return EFalse if the scrollbar was not changed.
Continuous updates of the thumb position and thumb span should be performed by the derived view where necessary, and CQikListBox::UpdateScrollBarsL called when a change in the model occurs. This behavior should be implemented apart from UpdateScrollBarModels, since otherwise the result will be unnecessary updates of the scrollspan.
Return value
TBool
|
ETrue the model has been changed, EFalse the model was not changed. |
|
protected: virtual IMPORT_C TBool MoveToCurrentItemL();
Description
Default implementation simply sets TopDataIndex to CurrentItemIndex.
Return value
TBool
|
ETrue If the TopDataIndex was changed and the view needs to be re-populated. |
|
See also:
BaseConstructFromResourceL()
protected: IMPORT_C void BaseConstructFromResourceL(TResourceReader &aReader);
Description
Reads the mandatory properties needed to initialize the base class. It will leave if any of the pointer members being constructed leave.
Parameters
protected: virtual IMPORT_C CCoeControl *ComponentControl(TInt aIndex) const;
Description
Returns the control with a specific index.
Parameters
TInt aIndex |
Index of the control to return. |
|
Return value
Panic codes
EQikListBoxPanicModelUpdatedNotCalledAfterChangingData |
Not possible to call ComponentControl during an update. |
|
protected: virtual IMPORT_C TInt CountComponentControls() const;
Description
Returns the current count of view items.
Return value
TInt
|
The view item count. |
|
protected: virtual IMPORT_C void SetContainerWindowL(const CCoeControl &aContainer);
Description
In addition to general CCoeControl behavior it sets the container window of the internal highlight object.
Parameters
See also:
CCoeControl::SetContainerWindowL
protected: virtual IMPORT_C void SizeChanged();
Description
Handles size changed events.
protected: virtual IMPORT_C TSize MinimumSize();
Description
Returns minimum size of the listbox.
Rules: The highlight layout and normal layout must be equal in height. There must be only one layout pair added to the listbox.
Return value
TSize
|
The minimum size of the listbox. |
|
Panic codes
EQikListBoxPanicListBoxIsNull |
Contruction have failed and iListBox is NULL (debug build only). |
|
protected: IMPORT_C void HandleContentSwappingL();
Description
Handle content swapping.
DoHandleContentSwappingL()
protected: IMPORT_C TKeyResponse DoHandleContentSwappingL(CQikListBoxItem *aItem, TBool aLeftDirection, const RArray< TInt > *aSlotsToSwap);
Description
Swap content in all or selected slots for an item.
Parameters
CQikListBoxItem *aItem |
The item to do content swapping on |
TBool aLeftDirection |
ETrue for swapping left, EFalse for right direction |
const RArray< TInt > *aSlotsToSwap |
Slots to swap, NULL for swapping all slots |
|
Return value
protected: IMPORT_C void SetCurrentItemIndexL(TInt aItemIndex, TBool aMoveToCurrent, TDrawNow aDrawNow);
Description
Set highlighted item and optionally moves the view to display that item and/or redraws the listbox.
Parameters
TInt aItemIndex |
The item to highlight |
TBool aMoveToCurrent |
ETrue makes selected item visible in view |
TDrawNow aDrawNow |
ENoDrawNow can be used to delay drawing if additonal tasks should be performed before draw is necessary. |
|
Panic codes
EQikListBoxPanicInvalidItemIndex |
If parameter aItemIndex is out of bounds (debug build only). |
|
protected: IMPORT_C TInt CurrentItemIndex() const;
Description
Get the index of the current item.
Return value
protected: IMPORT_C void UpdateHighlight();
Description
Sets the visibility of the internal highlight control to be that of the highlight enabled setting of the ListBox. Also the internal rect for the highlight to be the rect of the current item, if highlight is enabled.
protected: IMPORT_C TBool IsHighlightInView() const;
Description
Find out if highlighted item is in view
Return value
TBool
|
ETrue if highlighted item is in view |
|
protected: IMPORT_C TKeyResponse ConsumeMatchCharacterL(const TKeyEvent &aKeyEvent, TEventCode aType);
Description
Called by the listbox views to handle incremental matching. The method determines if the matching is enabled and consumes the character if possible. Special case when only one character is matched, is that the character history will be reset for each new character.
Parameters
const TKeyEvent &aKeyEvent |
The key event. |
TEventCode aType |
The type of key event: EEventKey, EEventKeyUp or EEventKeyDown. |
|
Return value
TKeyResponse
|
Indicates whether or not the key event was used incremental matching. |
|
Panic codes
EQikListBoxPanicListBoxIsNull |
Contruction have failed and iListBox is NULL (debug build only). |
|
protected: IMPORT_C void ClearMatchBufferL();
Description
Reset the incremental match buffer to its initial state. This will also notify the listbox observer with EEventMatchBufferChanged
protected: IMPORT_C CQikListBoxItem *NewOrCachedItemL(const TInt aIndex);
Description
Creates and insert a new item. Used internally by derived views.
Parameters
const TInt aIndex |
The index for the item |
|
Return value
protected: IMPORT_C void TrimCache();
Description
Trims the cache.
See also:
PreviousFocusableIndexL()
protected: IMPORT_C TInt PreviousFocusableIndexL(TInt aCurrentIndex, TBool aTryLooping) const;
Description
Returns the index of the previous focusable item as compared to aCurrentIndex.
Parameters
TInt aCurrentIndex |
The start index for the search for previous focusable index. |
TBool aTryLooping |
ETrue will wrap the search to start looking from the bottom index when top index is reach. |
|
Return value
TInt
|
Previous focusable index or KErrNotFound |
|
protected: IMPORT_C TInt NextFocusableIndexL(TInt aCurrentIndex, TBool aTryLooping) const;
Description
Returns the index of the next focusable item as compared to aCurrentIndex.
Parameters
TInt aCurrentIndex |
The start index for the search for next focusable index. |
TBool aTryLooping |
ETrue will wrap the search to start looking from the top index when bottom index is reach. |
|
Return value
TInt
|
Next focusable index or KErrNotFound |
|
protected: IMPORT_C TBool IsItemInView(TInt aIndex) const;
Description
Check if item is in view
Parameters
TInt aIndex |
The item to check |
|
Return value
TBool
|
Etrue if item is in view |
|
protected: IMPORT_C CQikListBoxItem *CurrentItem();
Description
Returns the current item.
Return value
protected: IMPORT_C void ReportEventToListBoxL(MQikListBoxObserver::TQikListBoxEvent aEvent, TInt aItemIndex, TInt aSlotId);
Description
Help function for reporting a listbox event. Verifies that the internal pointer to the owning ListBox is not NULL before calling ReportListBoxEventL.
Parameters
protected: IMPORT_C CQikListBoxItemArray &ItemArray();
Description
Accessor method to get a reference to the CQikListBoxItemArray used by the view base and derived views to manipulate and keep track of the items in the view.
Return value
protected: IMPORT_C const CQikListBoxItemArray &ItemArray() const;
Description
Accessor method to get a const reference to the CQikListBoxItemArray used by the view base and derived views to manipulate and keep track of the items in the view.
Return value
protected: IMPORT_C const CCoeControl *Highlight() const;
Description
Return value
const CCoeControl * |
A const pointer to the CCoeControl used as highlight in the view if used and created, or NULL. |
|
protected: IMPORT_C TRect RepeatRect() const;
Description
Return value
protected: IMPORT_C void SetRepeatEvent(const TViewRepeatEvents &aRepeatEvent);
Description
Parameters
protected: IMPORT_C TViewRepeatEvents RepeatEvent() const;
Description
Return value
LastPopulationDirection()
protected: IMPORT_C TQikListBoxPopulationDirection LastPopulationDirection() const;
Description
Return value
SetLastPopulationDirection()
protected: IMPORT_C void SetLastPopulationDirection(TQikListBoxPopulationDirection aDirection);
Description
Parameters
protected: virtual IMPORT_C TInt ScrollRepeatInterval() const;
Description
Get the scroll repeat interval for a specific view.
Return value
protected: IMPORT_C MQikListBoxModel &Model() const;
Description
Get a reference to the model.
Return value
Panic codes
EQikListBoxPanicListBoxIsNull |
Contruction have failed and iListBox is NULL (debug build only). |
|
protected: virtual IMPORT_C void HandleModelChangeL(TModelEvent aEvent, TInt aItemIndex, TInt aItemSecond);
Description
Update view depending on what changed in the model
Parameters
TModelEvent aEvent |
The event type |
TInt aItemIndex |
Item index for event |
TInt aItemSecond |
Second item index for event |
|
protected: IMPORT_C void HandleDragOutside(TPointerEvent aPointerEvent);
Description
Handle dragging outside the listbox.
Parameters
protected: IMPORT_C void DoReverseSelectionL(TInt aDataItemIndex);
Description
Inverts the selection of an item. A selected/marked item will be unmarked, an unmarked item will be marked. If aDataItemIndex is an "unselectable" item nothing will be done. In case of a successfull inversion of the selection state, MQikListBoxObserver::EEventSelectionChanged will be reported to the List Box Observer.
If the selections tate is changed and the item is currently in view, it will be redrawn.
Parameters
TInt aDataItemIndex |
The data index of the item to invert selection of. |
|
protected: IMPORT_C TBool TappedItem(TPointerEvent aPointerEvent, TInt &aTappedItem, TBool &aItemIsSelected, TBool &aSelectionChanged);
Description
Find out which item was tapped. Separators are not valid as tapped items.
Parameters
TPointerEvent aPointerEvent |
The current pointer event |
TInt &aTappedItem |
The index of the tapped item |
TBool &aItemIsSelected |
ETrue if the item was selected (multiple select), EFalse if the item was clicked |
TBool &aSelectionChanged |
|
|
Return value
TBool
|
ETrue if an iteam was tapped. |
|
ResetIncomingItemsArray()
protected: IMPORT_C void ResetIncomingItemsArray();
Description
PreviousTransitionTopIndex()
protected: IMPORT_C TInt PreviousTransitionTopIndex() const;
Description
Return value
SetPreviousTransitionTopIndex()
protected: IMPORT_C void SetPreviousTransitionTopIndex(TInt aPrevTopIndex);
Description
Parameters
protected: IMPORT_C TViewType TransitionViewType() const;
Description
Return value
protected: IMPORT_C void SetTransitionViewType(TViewType aViewType);
Description
Parameters
protected: IMPORT_C TArray< TInt > IncomingItemsArray(