mapnavproviderrefapp/inc/mnrpappui.h
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:31:27 +0100
branchRCL_3
changeset 18 870918037e16
parent 0 522cd55cc3d7
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  CMnrpAppUi class definition
*
*/


#ifndef MNRP_APPUI_H
#define MNRP_APPUI_H

#include <aknViewAppUi.h>
#include <EPos_Landmarks.h>

class TCoordinate;
class CPosLandmark;

class CMnrpAppView;
class CMnrpNaviView;
class CMnrpMapView;

class CMnrpMapViewService;

class CAknNavigationDecorator;
class CAknNavigationControlContainer;

class CMnrpEngine;

/** Map selection callback class */
class MMapSelectionCallback
    {
    public:
        /** Called when user selects location from map */
        virtual void HandleSelectionL( const TCoordinate& aSelection ) = 0;

        /** Called when user selects landmark from dialog list */
        virtual void HandleSelectionL( TInt aLandmarkIndex ) = 0;
        virtual void HandleSelectionL( TPosLmItemId aLandmarkId, TInt aDbIndex ) = 0;
        
        /** Called when user refuses selection */
        virtual void HandleSelectionErrorL( TInt aError ) = 0;
    };

/** Simple App UI for MnRefProvider component.
 *	It manages application views.
 */
class CMnrpAppUi : public CAknViewAppUi
    {
    public:

        CMnrpAppUi( CMnrpEngine& aEngine );
        void ConstructL();
        ~CMnrpAppUi();

        void ShowMapL( CMnrpMapViewService& aService );

        void StartSelectionL( 
            CMnrpMapViewService& aService,  
            MMapSelectionCallback& aCallback );

        void StopSelection();

        void ShowNavigationL( const CPosLandmark& aDestination );

		/** Returns ETrue if Map or Navigaton view is still open */
        TBool IsAnyUserViewActive();
        
		/** Returns ETrue if application was started embedded */
        TBool IsChainedMode();

        void SetNaviPaneTitleL( const TDesC& aPaneTitle );
        void SetRightSoftkeyCommandL( TInt aCommand, const TDesC& aButtonTitle );
        
    protected: // from CAknAppUi
    
        void HandleCommandL(TInt aCommand);
        void HandleResourceChangeL( TInt aType );
        TBool ProcessCommandParametersL( CApaCommandLine &aCommandLine );

    private:

        void PostConstructL();

        void SelectFromDialogL(
            CMnrpMapViewService& aService,
            MMapSelectionCallback& aCallback );

    private:
    	/** Empty view */
        CMnrpAppView* iAppView;

		/** Navigation view */
        CMnrpNaviView* iNaviView;
		/** Map view */
        CMnrpMapView* iMapView;

        //Own:
        CAknNavigationDecorator* iNaviPaneLabel;

        //Ref:
        CAknNavigationControlContainer* iNaviPane;
        
        TInt iParentWg;

        /** Reference to engine */
        CMnrpEngine& iEngine;
    };

#endif // MNRP_APPUI_H