×
Namespaces

Variants
Actions

Title Pane Touch Observer API

From Nokia Developer Wiki
Jump to: navigation, search
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.

This page was last modified on 13 September 2012, at 06:50.
38 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×