API published in: S60 3rd Ed FP 2
Link against: avkon.lib
Required Capabilities
None
#include <aknpreviewpopupcontroller.h>
Preview popup is a popup that can be used to show some extra information about e.g. a highlighted list item. It cannot get keyboard focus. Popup is shown after a default timeout of one second and hidden on key press or when it has been visible for ten seconds. These timeouts can be changed via this API.
Preview popup itself provides only timing services and an empty popup window whose frames and background are drawn with the current skin. It is client application's responsibility to provide the actual content. This can be any object derived from CCoeControl. When the popup is shown it asks content's size using CCoeControl::MinimumSize and sizes itself so that the whole content fits into the popup. Content can also be created asynchronously if it takes considerable amount of time.
Public Types |
|
enum | TAknPreviewStyle { ELayoutDefault = 0x0001, ELayoutSubMenu = 0x0002, EPermanentMode = 0x0004, EFixedMode = 0x0008, EExcludeFrames = 0x0010 } |
enum | TAknPreviewPopUpContentSize { ESmall, ELarge } |
Public Member Functions |
|
~CAknPreviewPopUpController () | |
Destructor. |
|
IMPORT_C void | SetPopUpShowDelay (const TTimeIntervalMicroSeconds32 &aDelay) |
Sets the delay used before showing the preview popup. |
|
IMPORT_C void | SetPopUpHideDelay (const TTimeIntervalMicroSeconds32 &aDelay) |
Sets the delay used before hiding the preview popup. |
|
IMPORT_C void | ShowPopUp () |
Sets the preview popup visible after specified delay. |
|
IMPORT_C void | HidePopUp () |
Hides the popup immediately. |
|
IMPORT_C void | ContentReady () |
If application wishes to build preview popup's content asynchronously the content class should be derived from MAknPreviewPopUpContentProvider in addition to CCoeControl. |
|
IMPORT_C void | SetPosition (const TPoint &aPoint) |
Sets the position of preview popup. |
|
IMPORT_C void | SetPositionByHighlight (const TRect &aHighlightRect) |
Sets the position of the preview popup so that it is aligned with the given rectangle as specified in the LAF data. |
|
IMPORT_C void | AddObserverL (const MAknPreviewPopUpObserver &aObserver) |
Adds the observer to the list of observers. |
|
IMPORT_C void | RemoveObserver (const MAknPreviewPopUpObserver &aObserver) |
Removes the given observer from the observer list. |
|
IMPORT_C void | UpdateContentSize () |
Updates popup's size to reflect a change in content's size. |
|
IMPORT_C TSize | Size () const |
Returns the popup's size. |
|
IMPORT_C void | SetHeadingTextL (const TDesC &aText) |
Sets optional heading text. |
|
void | NotifyObservers (MAknPreviewPopUpObserver::TPreviewPopUpEvent aEvent) |
Notifies observers about the specified preview popup event. |
|
Static Public Member Functions |
|
static IMPORT_C CAknPreviewPopUpController * | NewL (CCoeControl &aContent, MAknPreviewPopUpContentProvider &aContentProvider) |
Two-phased constructor. |
|
static IMPORT_C CAknPreviewPopUpController * | NewL (CCoeControl &aContent) |
Two-phased constructor. |
|
static IMPORT_C CAknPreviewPopUpController * | NewL (CCoeControl &aContent, MAknPreviewPopUpContentProvider &aContentProvider, const TInt aStyle) |
Two-phased constructor. |
|
static IMPORT_C CAknPreviewPopUpController * | NewL (CCoeControl &aContent, const TInt aStyle) |
Two-phased constructor. |
|
static IMPORT_C TAknPreviewPopUpContentSize | ContentSizeInLayout () |
This static function can be used to query the logical size of the screen when drawing the content of the popup. |
|
Protected Member Functions |
|
void | DoCancel () |
From CTimer. |
|
void | RunL () |
From CActive. |
|
TInt | RunError (TInt aError) |
From CActive. |
|
|
|
Destructor. |
|
Adds the observer to the list of observers. Observers in the list are notified of events in preview popup.
|
|
If application wishes to build preview popup's content asynchronously the content class should be derived from MAknPreviewPopUpContentProvider in addition to CCoeControl. This function must be called by the content object when it has finished its asynchronous building operation. |
|
This static function can be used to query the logical size of the screen when drawing the content of the popup. When ELarge is returned more detailed information (e.g. a picture) can be shown whereas ESmall suggests that the available screen area is more limited and simpler content should be used.
|
|
From CTimer. Cancels an outstanding asynchronous request. |
|
Hides the popup immediately. |
|
Two-phased constructor. This version should be used if the content is created synchronously i.e. it's ready when the popup is about to be shown. This is also the normal use case.
|
|
Two-phased constructor. This version should be used if the content is created asynchronously.
|
|
Two-phased constructor. This version should be used if the content is created synchronously i.e. it's ready when the popup is about to be shown. This is also the normal use case.
|
|
Two-phased constructor. This version should be used if the content is created asynchronously.
|
|
Notifies observers about the specified preview popup event.
|
|
Removes the given observer from the observer list.
|
|
From CActive. Handles leaves that occur while RunL is executed.
|
|
From CActive. Handles active object's request completion event. |
|
Sets optional heading text. If heading text is already set the current text is replaced. When set also a closing icon is shown if the currently active layout supports stylus.
|
|
Sets the delay used before hiding the preview popup. The default delay is three seconds.
|
|
Sets the delay used before showing the preview popup. The default delay is one second.
|
|
Sets the position of preview popup. Popup's size is determined by the size of its content. The popup is placed left and down from the given point. If fixed mode is used then this function has no effect.
|
|
Sets the position of the preview popup so that it is aligned with the given rectangle as specified in the LAF data. This is intented to be used in conjunction with lists and grids if the application wishes to implement a popup that follows lists/grids item highlight.
|
|
Sets the preview popup visible after specified delay. If the popup is already visible it is hidden immediately and shown again after the showing delay. Popup is automatically hidden after its hiding delay unless the delay is zero in which case the popup is shown infinitely. |
|
Returns the popup's size. |
|
Updates popup's size to reflect a change in content's size. Should be called if the size of the content is changed dynamically. |