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().
S60 0.9
Private Member Functions | |
---|---|
void | ClearNextChars() |
void | FetchSelectionIndexesFromListBoxL() |
void | HandleItemAdditionL() |
void | HandleItemRemovalL() |
void | InstallEmptyTextL() |
TBool | IsAdaptiveSearch() |
TBool | IsItemSelected(TInt) |
TBool | IsItemVisible(const TDesC &, const TDesC &) |
TBool | IsSeparatorCharacter(TChar) |
void | NoCriteriaL(TBool) |
void | PushSelectionIndexesToListBoxL() |
void | ReleaseCriteriaL(const TDesC &) |
void | TightenCriteriaL(const TDesC &) |
void | UninstallEmptyTextL() |
Private Attributes | |
---|---|
TBool | iDisableChangesToShownIndexes |
HBufC * | iEmptyListText |
CFindExtension * | iExtension |
TBool | iIsPopup |
TUint | iKeyValue |
CEikListBox * | iListBox |
TBuf< 256 > | iMatchableText |
MListBoxModel * | iModel |
MCoeControlObserver * | iObserver |
TInt | iOldItemCount |
HBufC * | iOldSearchCriteria |
CCoeControl * | iParentControl |
CAknSearchField * | iSearchField |
CArrayFix< TInt > * | iSelectionIndexes |
CArrayFix< TInt > * | iShownIndexes |
CListBoxView * | iView |
IMPORT_C | CAknListBoxFilterItems | ( | CEikListBox * | aListBox, |
CAknSearchField * | aSearchField, | |||
MListBoxModel * | aModel, | |||
CListBoxView * | aView | |||
) |
Base class default constructor.
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. |
IMPORT_C | ~CAknListBoxFilterItems | ( | ) |
Destructor. Frees all resources owned by the object prior to its destruction.
IMPORT_C TPtrC | DefaultMatchableItemFromItem | ( | TPtrC | aText | ) |
For building MdcaPoint() of the model's MatchableTextArray. This method builds the default value for MatchableTextArray. Modified text.
TPtrC aText | Pointer descriptor. |
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. S60 5.0
const TKeyEvent & aEvent | Event send to FEP. |
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.
TUint aValue | The character code for an EEventKey. |
IMPORT_C TInt | FilteredItemIndex | ( | TInt | aVisibleItemIndex | ) | const |
This is used to fetch the content of a list item after filter has been used. Index to the original item array.
TInt aVisibleItemIndex | The index of visible item. |
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. Number of items visible.
IMPORT_C CCoeControl * | FindBox | ( | ) | const |
This function just returns pointer to the search field. Pointer to the search field.
IMPORT_C void | HandleControlEventL | ( | CCoeControl * | aControl, |
TCoeEvent | aEventType | |||
) |
Editor sends messages to this object as control events.
CCoeControl * aControl | The control that sent the event. |
TCoeEvent aEventType | The event type. |
IMPORT_C void | HandleItemArrayChangeL | ( | ) |
When you change the list item array you should call this method.
IMPORT_C void | HandleOfferkeyEventL | ( | ) |
Applications should call this in OfferKeyEventL() which gives keys to listbox and search field.
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. Always returns 0.
TAny * aFilterItems | Pointer to the CAknListBoxFilterItems object. |
TBool | IsItemVisible | ( | const TDesC & | aMatchableItemString, |
const TDesC & | aSearchText | |||
) | [private] |
void | NoCriteriaL | ( | TBool | aUpdateAS = ETrue | ) | [private] |
TBool aUpdateAS = ETrue |
IMPORT_C TInt | NonFilteredNumberOfItems | ( | ) | const |
Returns number of original list items. Number of all items.
void | ReleaseCriteriaL | ( | const TDesC & | aCriteria | ) | [private] |
const TDesC & aCriteria |
IMPORT_C void | ResetFilteringL | ( | ) |
This function is to be called when filter is cleared.
IMPORT_C CArrayFix< TInt > * | SelectionIndexes | ( | ) |
This one gives all indices, not just the ones that are visible. Pointer to the array that has all indices.
IMPORT_C void | SetListBox | ( | CEikListBox * | aListBox | ) |
Attaches or detaches list used by the filtering. S60 2.0
CEikListBox * aListBox | Pointer to listbox or NULL. |
IMPORT_C void | SetModel | ( | MListBoxModel * | aModel | ) |
Attaches or detaches list model used by the filtering. S60 2.0
MListBoxModel * aModel | a pointer to list model or NULL. |
IMPORT_C void | SetObserver | ( | MCoeControlObserver * | aObserver | ) |
Sets the observer.
MCoeControlObserver * aObserver | Pointer to the observer. |
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.
CCoeControl * aControl | Pointer to the control. |
IMPORT_C void | SetPopup | ( | ) |
AknFind uses this to inform us that we have popup find. Applications shouldn't call this.
IMPORT_C void | SetSearchField | ( | CAknSearchField * | aSearchField | ) |
Attaches or detaches find pane used by the filtering. S60 2.0
CAknSearchField * aSearchField | Pointer to findbox or NULL. |
IMPORT_C void | SetView | ( | CListBoxView * | aView | ) |
Attaches or detaches list view used by the filtering. S60 2.0
CListBoxView * aView | a pointer to list view or NULL. |
void | TightenCriteriaL | ( | const TDesC & | aCriteria | ) | [private] |
const TDesC & aCriteria |
IMPORT_C void | UpdateCachedDataL | ( | ) |
This function will update filter items state from the search field and listbox. Also updates selection indexes.
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.
TInt aVisibleIndex | Index to be updated. |
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.
IMPORT_C TInt | VisibleItemIndex | ( | TInt | aOriginalIndex | ) | const |
Finds the list item on the screen when the item array index is given. Matching index from original array. Returns -1 if the Index is not visible.
TInt aOriginalIndex | Item index. |