Setting the title pane touch observer

To set the title pane touch observer:

  1. Provide an observer class that implements the MaknTitlePaneObserver interface.

    class MyTitlePaneObserver : public MAknTitlePaneObserver
        {
    public:
        void HandleTitlePaneEventL( TInt aEventID );
        };
    
    {
        switch( TAknTitlePaneEvents )
            {
             case EAknTitlePaneTapped:
                  ...
                  break;
    
             default
                  break;
    }
  2. Get a pointer to the title pane via the status pane pointer.

    iStatusPane = static_cast<CAknAppUi*>( CEikonEnv::Static()-> EikAppUi() )->StatusPane();
    if( !iStatusPane )
        {
        User::Leave( KErrNotFound );
        }
     
    iTitlePane = ( CAknTitlePane* )iStatusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) );
    if( !iTitlePane )
        {
        User::Leave( KErrNotFound );
        }
    
  3. Set the observer using the SetTitlePaneObserver method.

    iTitlePane->SetTitlePaneObserver( this );