CAknPreviewPopUpController Class Reference

API published in: S60 3rd Ed FP 2

Link against: avkon.lib

Capability Information

Required Capabilities

None


#include <
aknpreviewpopupcontroller.h>

Detailed Description

Class for controlling the preview popup component.

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 CAknPreviewPopUpControllerNewL (CCoeControl &aContent, MAknPreviewPopUpContentProvider &aContentProvider)
 Two-phased constructor.
static IMPORT_C CAknPreviewPopUpControllerNewL (CCoeControl &aContent)
 Two-phased constructor.
static IMPORT_C CAknPreviewPopUpControllerNewL (CCoeControl &aContent, MAknPreviewPopUpContentProvider &aContentProvider, const TInt aStyle)
 Two-phased constructor.
static IMPORT_C CAknPreviewPopUpControllerNewL (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.

Member Enumeration Documentation

enum CAknPreviewPopUpController::TAknPreviewPopUpContentSize
 
Enumerator:
ESmall 
ELarge 
enum CAknPreviewPopUpController::TAknPreviewStyle
 
Enumerator:
ELayoutDefault 
ELayoutSubMenu 
EPermanentMode 
EFixedMode 
EExcludeFrames 

Constructor & Destructor Documentation

CAknPreviewPopUpController::~CAknPreviewPopUpController  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CAknPreviewPopUpController::AddObserverL const MAknPreviewPopUpObserver aObserver  ) 
 

Adds the observer to the list of observers.

Observers in the list are notified of events in preview popup.

Parameters:
aObserver Observer.
IMPORT_C void CAknPreviewPopUpController::ContentReady  ) 
 

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.

static IMPORT_C TAknPreviewPopUpContentSize CAknPreviewPopUpController::ContentSizeInLayout  )  [static]
 

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.

Returns:
Logical size of the screen.
void CAknPreviewPopUpController::DoCancel  )  [protected]
 

From CTimer.

Cancels an outstanding asynchronous request.

IMPORT_C void CAknPreviewPopUpController::HidePopUp  ) 
 

Hides the popup immediately.

static IMPORT_C CAknPreviewPopUpController* CAknPreviewPopUpController::NewL CCoeControl &  aContent,
const TInt  aStyle
[static]
 

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.

Parameters:
aContent Reference to the content of the preview popup.
aStyle Defines the used layout and behavior flags.
static IMPORT_C CAknPreviewPopUpController* CAknPreviewPopUpController::NewL CCoeControl &  aContent,
MAknPreviewPopUpContentProvider aContentProvider,
const TInt  aStyle
[static]
 

Two-phased constructor.

This version should be used if the content is created asynchronously.

Parameters:
aContent Reference to the content of the preview popup.
aContentProvider Reference to the content provider of the popup.
aStyle Defines the used layout and behavior flags.
static IMPORT_C CAknPreviewPopUpController* CAknPreviewPopUpController::NewL CCoeControl &  aContent  )  [static]
 

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.

Parameters:
aContent Reference to the content of the preview popup.
static IMPORT_C CAknPreviewPopUpController* CAknPreviewPopUpController::NewL CCoeControl &  aContent,
MAknPreviewPopUpContentProvider aContentProvider
[static]
 

Two-phased constructor.

This version should be used if the content is created asynchronously.

Parameters:
aContent Reference to the content of the preview popup.
aContentProvider Reference to the content provider of the popup.
void CAknPreviewPopUpController::NotifyObservers MAknPreviewPopUpObserver::TPreviewPopUpEvent  aEvent  ) 
 

Notifies observers about the specified preview popup event.

Parameters:
aEvent Preview popup event.
IMPORT_C void CAknPreviewPopUpController::RemoveObserver const MAknPreviewPopUpObserver aObserver  ) 
 

Removes the given observer from the observer list.

Parameters:
aObserver Observer.
TInt CAknPreviewPopUpController::RunError TInt  aError  )  [protected]
 

From CActive.

Handles leaves that occur while RunL is executed.

Parameters:
aError Leave code.
Returns:
Always KErrNone.
void CAknPreviewPopUpController::RunL  )  [protected]
 

From CActive.

Handles active object's request completion event.

IMPORT_C void CAknPreviewPopUpController::SetHeadingTextL const TDesC &  aText  ) 
 

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.

Parameters:
aText Heading text.
IMPORT_C void CAknPreviewPopUpController::SetPopUpHideDelay const TTimeIntervalMicroSeconds32 &  aDelay  ) 
 

Sets the delay used before hiding the preview popup.

The default delay is three seconds.

Parameters:
aDelay Delay in microseconds.
IMPORT_C void CAknPreviewPopUpController::SetPopUpShowDelay const TTimeIntervalMicroSeconds32 &  aDelay  ) 
 

Sets the delay used before showing the preview popup.

The default delay is one second.

Parameters:
aDelay Delay in microseconds.
IMPORT_C void CAknPreviewPopUpController::SetPosition const TPoint &  aPoint  ) 
 

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.

Parameters:
aPoint Popup's position.
IMPORT_C void CAknPreviewPopUpController::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.

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.

Parameters:
aHighlightRect Screen-relative rectangle used to calculate popup's position.
IMPORT_C void CAknPreviewPopUpController::ShowPopUp  ) 
 

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.

IMPORT_C TSize CAknPreviewPopUpController::Size  )  const
 

Returns the popup's size.

IMPORT_C void CAknPreviewPopUpController::UpdateContentSize  ) 
 

Updates popup's size to reflect a change in content's size.

Should be called if the size of the content is changed dynamically.


The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top