CAknListBoxFilterItems Class Reference
class CAknListBoxFilterItems : public CBase
|
Listbox item filtering. This class is designed to be stored inside a listbox model and the model should call this in its
NumberOfItems()
and
ItemText()
implementation. The model must be given to this class and it must have
MatchableTextArray()
implemented correctly.
HandleOfferKeyEvent()
should be called from the same offer key event implementation which forwards the keys to listbox and search field
If you have both markable list and find at the same time, you should call
ResetFiltering()
before executing the command for marked items. This ensures that the ListBox's
SelectionIndexes()
returns all items instead of only those items that are visible. Selected *items can be found under
CAknListBoxFilterItems::SelectionIndexes()
.
Constructor & Destructor Documentation
CAknListBoxFilterItems(CEikListBox *, CAknSearchField *, MListBoxModel *, CListBoxView *)
Base class default constructor.
Parameters
CEikListBox
* aListBox
|
Listbox to be filtered,
|
CAknSearchField * aSearchField
|
Listbox search field.
|
MListBoxModel
* aModel
|
Listbox model,
|
CListBoxView
* aView
|
A list box view that displays the list items which are currently visible in a list box.
|
~CAknListBoxFilterItems()
IMPORT_C
|
~CAknListBoxFilterItems
|
(
|
)
|
|
Destructor. Frees all resources owned by the object prior to its destruction.
Member Functions Documentation
ClearNextChars()
void
|
ClearNextChars
|
(
|
)
|
[private]
|
ConstructL()
IMPORT_C void
|
ConstructL
|
(
|
)
|
|
This is for setting empty list text.
DefaultMatchableItemFromItem(TPtrC)
IMPORT_C
TPtrC
|
DefaultMatchableItemFromItem
|
(
|
TPtrC
|
aText
|
)
|
|
For building
MdcaPoint()
of the model's
MatchableTextArray
. This method builds the default value for
MatchableTextArray
.
Parameters
TPtrC
aText
|
Pointer descriptor.
|
DeferredSendFullKeyEventToFepL(const TKeyEvent &)
void
|
DeferredSendFullKeyEventToFepL
|
(
|
const
TKeyEvent
&
|
aEvent
|
)
|
|
An improved version of DeferredSendKeyEventToFepL. It sends a
TKeyEvent
rather than just key code. Thus the correct key event can be send to FEP on QWERTY keyboard.
-
Since
-
S60 5.0
DeferredSendKeyEventToFepL(TUint)
IMPORT_C void
|
DeferredSendKeyEventToFepL
|
(
|
TUint
|
aValue
|
)
|
|
Sends key events to FEP. This is used to resend key event to FEP if
AknFind's
HandleOfferKeyEventL()
gets the key while search field has no focus. If search field has a focus, the key events go directly to the editor and this is not called.
Parameters
TUint
aValue
|
The character code for an EEventKey.
|
FetchSelectionIndexesFromListBoxL()
void
|
FetchSelectionIndexesFromListBoxL
|
(
|
)
|
[private]
|
FilteredItemIndex(TInt)
IMPORT_C
TInt
|
FilteredItemIndex
|
(
|
TInt
|
aVisibleItemIndex
|
)
|
const
|
This is used to fetch the content of a list item after filter has been used.
Parameters
TInt
aVisibleItemIndex
|
The index of visible item.
|
FilteredNumberOfItems()
IMPORT_C
TInt
|
FilteredNumberOfItems
|
(
|
)
|
const
|
This is used to ask how many list items are available after filter has been used. Counts visible list items.
FindBox()
This function just returns pointer to the search field.
HandleControlEventL(CCoeControl *, TCoeEvent)
IMPORT_C void
|
HandleControlEventL
|
(
|
CCoeControl
*
|
aControl,
|
|
TCoeEvent
|
aEventType
|
|
)
|
|
Editor sends messages to this object as control events.
Parameters
CCoeControl
* aControl
|
The control that sent the event.
|
TCoeEvent aEventType
|
The event type.
|
HandleItemAdditionL()
void
|
HandleItemAdditionL
|
(
|
)
|
[private]
|
HandleItemArrayChangeL()
IMPORT_C void
|
HandleItemArrayChangeL
|
(
|
)
|
|
When you change the list item array you should call this method.
HandleItemRemovalL()
void
|
HandleItemRemovalL
|
(
|
)
|
[private]
|
HandleOfferkeyEventL()
IMPORT_C void
|
HandleOfferkeyEventL
|
(
|
)
|
|
Applications should call this in
OfferKeyEventL()
which gives keys to listbox and search field.
IdleCallBack(TAny *)
TInt
|
IdleCallBack
|
(
|
TAny
*
|
aFilterItems
|
)
|
[static]
|
This gets called from
DeferredSendKeyEventToFepL()
. This does the actual sending of a key event. Does not support more than one event at the time.
Parameters
TAny
* aFilterItems
|
Pointer to the CAknListBoxFilterItems object.
|
InstallEmptyTextL()
void
|
InstallEmptyTextL
|
(
|
)
|
[private]
|
IsAdaptiveSearch()
TBool
|
IsAdaptiveSearch
|
(
|
)
|
const [private]
|
IsItemSelected(TInt)
TBool
|
IsItemSelected
|
(
|
TInt
|
aRealIndex
|
)
|
const [private]
|
IsItemVisible(const TDesC &, const TDesC &)
TBool
|
IsItemVisible
|
(
|
const
TDesC
&
|
aMatchableItemString,
|
|
const
TDesC
&
|
aSearchText
|
|
)
|
[private]
|
Parameters
const
TDesC
& aMatchableItemString
|
|
const
TDesC
& aSearchText
|
|
IsSeparatorCharacter(TChar)
TBool
|
IsSeparatorCharacter
|
(
|
TChar
|
c
|
)
|
[private, static]
|
NoCriteriaL(TBool)
void
|
NoCriteriaL
|
(
|
TBool
|
aUpdateAS = ETrue
|
)
|
[private]
|
NonFilteredNumberOfItems()
IMPORT_C
TInt
|
NonFilteredNumberOfItems
|
(
|
)
|
const
|
Returns number of original list items.
PushSelectionIndexesToListBoxL()
void
|
PushSelectionIndexesToListBoxL
|
(
|
)
|
[private]
|
ReleaseCriteriaL(const TDesC &)
void
|
ReleaseCriteriaL
|
(
|
const
TDesC
&
|
aCriteria
|
)
|
[private]
|
ResetFilteringL()
IMPORT_C void
|
ResetFilteringL
|
(
|
)
|
|
This function is to be called when filter is cleared.
SelectionIndexes()
This one gives all indices, not just the ones that are visible.
SetListBox(CEikListBox *)
Attaches or detaches list used by the filtering.
-
Since
-
S60 2.0
SetModel(MListBoxModel *)
Attaches or detaches list model used by the filtering.
-
Since
-
S60 2.0
SetObserver(MCoeControlObserver *)
SetParentControl(CCoeControl *)
IMPORT_C void
|
SetParentControl
|
(
|
CCoeControl
*
|
aControl
|
)
|
|
AknFind
uses this to inform us who is the parent control owning the listbox and search field. This control should be window-owning control and it will be used to resize the listbox when changes to the filtering happens.
SetPopup()
IMPORT_C void
|
SetPopup
|
(
|
)
|
|
AknFind
uses this to inform us that we have popup find. Applications shouldn't call this.
SetSearchField(CAknSearchField *)
IMPORT_C void
|
SetSearchField
|
(
|
CAknSearchField *
|
aSearchField
|
)
|
|
Attaches or detaches find pane used by the filtering.
-
Since
-
S60 2.0
Parameters
CAknSearchField * aSearchField
|
Pointer to findbox or NULL.
|
SetView(CListBoxView *)
Attaches or detaches list view used by the filtering.
-
Since
-
S60 2.0
TightenCriteriaL(const TDesC &)
void
|
TightenCriteriaL
|
(
|
const
TDesC
&
|
aCriteria
|
)
|
[private]
|
UninstallEmptyTextL()
void
|
UninstallEmptyTextL
|
(
|
)
|
[private]
|
UpdateCachedDataL()
IMPORT_C void
|
UpdateCachedDataL
|
(
|
)
|
|
This function will update filter items state from the search field and listbox. Also updates selection indexes.
UpdateSelectionIndexL(TInt)
IMPORT_C void
|
UpdateSelectionIndexL
|
(
|
TInt
|
aVisibleIndex
|
)
|
|
This will synchronise the selected index from the listbox. If you use
SelectionIndexes()
, call this before it. This is heavy operation and goes through all list items.
Parameters
TInt
aVisibleIndex
|
Index to be updated.
|
UpdateSelectionIndexesL()
IMPORT_C void
|
UpdateSelectionIndexesL
|
(
|
)
|
|
This will synchronise the selection indices from the listbox. If you use
SelectionIndexes()
, call this before it. This is heavy operation and goes through all list items.
VisibleItemIndex(TInt)
IMPORT_C
TInt
|
VisibleItemIndex
|
(
|
TInt
|
aOriginalIndex
|
)
|
const
|
Finds the list item on the screen when the item array index is given.
Parameters
TInt
aOriginalIndex
|
Item index.
|
Member Data Documentation
TBool
iDisableChangesToShownIndexes
TBool
|
iDisableChangesToShownIndexes
|
[private]
|
HBufC * iEmptyListText
HBufC
*
|
iEmptyListText
|
[private]
|
CFindExtension * iExtension
CFindExtension *
|
iExtension
|
[private]
|
TUint
iKeyValue
TUint
|
iKeyValue
|
[private]
|
TBuf< 256 > iMatchableText
TBuf
< 256 >
|
iMatchableText
|
[private]
|
MCoeControlObserver * iObserver
TInt
iOldItemCount
TInt
|
iOldItemCount
|
[private]
|
HBufC * iOldSearchCriteria
HBufC
*
|
iOldSearchCriteria
|
[private]
|
CCoeControl * iParentControl
CAknSearchField * iSearchField
CAknSearchField *
|
iSearchField
|
[private]
|
CArrayFix< TInt > * iSelectionIndexes
CArrayFix< TInt > * iShownIndexes
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.