TokenEntryEvent

#include <bb/extensions/cascades/tokenentry/TokenEntryEvent>

Facilitates communication between Token handler and TokenEntry control.

TokenEntryEvent is passed by TokenEntry control to the token handler. The user is expected to override the AbstractTokenHandler, where TokenEntryEvent is provided as the parameter to AbstractTokenHandler methods. The user reads the query from the TokenEntryEvent, and then generates and sets a collection of TokenData objects on the TokenEntryEvent. If these TokenData objects have no parent, the TokenEntry takes ownership of them and sets itself as their parent, which means that TokenEntry deletes such TokenData when it does not need it for UI interactions. Note: always set a parent on TokenData if you plan to cache it outside of TokenEntry.


Overview

Public Functions Index

const QStringquery ()
const QList< TokenData * >replyTokens ()
voidsetReplyTokens (QList< TokenData * > const &tokenCollection, bool final=true)

Public Functions

const QString query ()

Retrieves query from the TokenEntryEvent.

When AbstractTokenHandler methods are overridden, the user reads the query from the TokenEntryEvent. Based in the query the reply tokens are generated.

const QList< TokenData * > replyTokens ()

Retrieve the set of reply tokens.

This provides access to all of the TokenData that has been added to this event,

void setReplyTokens (

Add a set of reply tokens to this event.

If TokenData items have no parent, the TokenEntry that generated this TokenEntryEvent takes ownership of them. In that case the TokenEntry deletes such TokenData when it does not need them for UI interactions. Note: always set a parent on TokenData if you plan to cache it outside of TokenEntry.

Optional boolean parameter "final" indicated if the provided set of tokens is final or may be updated on the same event. This parameter is always true except for the case of lookup request. The lookup request (see AbstractTokenHandler::provideLookup(TokenEntryEvent *lookupEvent) ) may provide intermediate lookup results. Therefore, setting this flag to false results in activity indicator being displayed on the lookup token. It should be set to true on the last update to hide the activity indicator.

Warning: This function is not thread-safe; the current thread must be same as the current thread affinity. In other words, the TokenData must have affinity to the same thread that calls this function.

Parameters
tokenCollection

the set of reply tokens

final

optional boolean indicator for intermediate lookup results

Last modified: 2015-07-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus