×
Namespaces

Variants
Actions
Revision as of 05:25, 30 September 2009 by deepikagohil (Talk | contribs)

Title Pane Touch Observer API

From Nokia Developer Wiki
Jump to: navigation, search
{{{width}}}


ID   Creation date  October 25, 2008
Platform  S60 5th Edition Tested on devices  
Category  Symbian C++ Subcategory  


Keywords (APIs, classes, methods, functions): CAknTitlePane, MAknTitlePaneObserver, HandleTitlePaneEventL(), TAknTitlePaneEvents, EAknTitlePaneTapped


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.

51 page views in the last 30 days.
×