Title Pane Touch Observer API
Article Metadata
Compatibility
Platform(s): S60 5th Edition
Article
Keywords: CAknTitlePane, MAknTitlePaneObserver, HandleTitlePaneEventL(), TAknTitlePaneEvents, EAknTitlePaneTapped
Created: Damavik
(25 Oct 2008)
Last edited: hamishwillee
(13 Sep 2012)
Contents |
Overview
Title Pane Touch Observer API allows an application to observe the user tapping on the title pane. An example use for this API would be to restore a default application view when the user taps on the title pane. The key interface is MAknTitlePaneObserver with only one method HandleTitlePaneEventL(), which should be implemented in order to handle application title pane tapping.
MMP file
CAPABILITY none
LIBRARY avkon.lib
Header file
#include <akntitlepaneobserver.h>
class CSampleAppUi : public CAknAppUi, public MAknTitlePaneObserver
{
...
private:
/**
* From MAknTitlePaneObserver
*/
void HandleTitlePaneEventL(TInt aEventID);
...
};
Source file
#include <eikspane.h>
#include <akntitle.h>
// AppUi second-phase constructor
void CSampleAppUi::ConstructL()
{
...
// Call CAknAppUi::StatusPane() which returns CEikStatusPane*
CEikStatusPane* statusPane = StatusPane();
if (statusPane)
{
// Title pane UID
TUid titlePaneUid;
titlePaneUid.iUid = EEikStatusPaneUidTitle;
// Get pointer to CAknTitlePane object
CAknTitlePane* titlePane = (CAknTitlePane*) statusPane->ControlL(titlePaneUid);
// Set this AppUi object as the observer of the title pane
titlePane->SetTitlePaneObserver(this);
}
...
}
// Implementation of the observer interface
void CSampleAppUi::HandleTitlePaneEventL(TInt aEventID)
{
// Although at the moment EAknTitlePaneTapped
// is the only one value in the TAknTitlePaneEvents enumeration,
// we should consider that later that enumeration could be extended
if (aEventID == EAknTitlePaneTapped)
{
// Custom action on title pane tapping event
}
else
{
// No implementation's required at the moment
}
}
Postconditions
Actions on title pane are observed.


30 Sep
2009
S60 5th Edition devices supports full touch UI. This article demostrates an example which uses the Title Pane Touch Observer API for S60 5th Edition and which can be useful to detect the tapping on the title pane. The main API used to achieve this task is MAknTitlePaneObserver.
The code snippests presented generates an event when the tapping occurs on title pane and also provides a function to handle it. This article can be useful to beginners to understand this soul concept.