profilesapplication/Profiles/ProfileApp/UIsrc/CProfileSettingsView.h
branchRCL_3
changeset 18 b7fa36b488f8
parent 17 861562a14a53
child 19 cd54903d48da
equal deleted inserted replaced
17:861562a14a53 18:b7fa36b488f8
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Settings view class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CPROFILESETTINGSVIEW_H
       
    21 #define CPROFILESETTINGSVIEW_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <aknview.h>
       
    25 #include "MProfileViewHandler.h"
       
    26 
       
    27 #include "MProfileExternalSettingsHandler.h"
       
    28 
       
    29 
       
    30 
       
    31 // CONSTANTS
       
    32 const TUid KProfileAppSettingViewId	= { 2 }; // UID of view
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CProfileEngineHandler;
       
    36 class CProfileIndexHandler;
       
    37 class CProfileSettingsContainer;
       
    38 class CProfileTabHandler;
       
    39 class CProfileTopControl;
       
    40 class CProfileDummyHandler;
       
    41 
       
    42 
       
    43 // CLASS DECLARATION
       
    44 
       
    45 
       
    46 /**
       
    47 * This interceptor control sits on top of the component stack. Its only purpose
       
    48 * is to route focus events to CProfileSettingsContaier. Key events are not
       
    49 * handled at all, they just fall through this component.
       
    50 */
       
    51 NONSHARABLE_CLASS( CProfileTopControl ) : public CCoeControl
       
    52 	{
       
    53 	public:
       
    54 		static CProfileTopControl* NewL( CCoeControl* aFocusControl );
       
    55 		void FocusChanged( TDrawNow aDrawNow ); // Overrides CCoeControl::FocusChanged
       
    56 
       
    57 	private:
       
    58         CCoeControl* iFocusControl;
       
    59 	};
       
    60 
       
    61 
       
    62 // This class is a dummy implementation for external settings interface needed
       
    63 // by CProfileSettingsContainer.
       
    64 NONSHARABLE_CLASS( CProfileDummyHandler ) : public CBase,
       
    65                                             public MProfileExternalSettingsHandler
       
    66 	{
       
    67 	public:
       
    68         CProfileDummyHandler();
       
    69         virtual ~CProfileDummyHandler();
       
    70         
       
    71     public:
       
    72         // This should never be called in Profiles App
       
    73 		CAknSettingItem* CreateSettingItemL( TInt aIdentifier );
       
    74 		void SetObserver(MProfileExternalSettingsObserver& aObserver );
       
    75         TBool AllowedToChange( TInt aSettingItemId ) const;
       
    76 	};
       
    77 
       
    78 
       
    79 /**
       
    80 *  Settings view class.
       
    81 *  @lib ProfileApp.app
       
    82 *  @since 1.2
       
    83 */
       
    84 NONSHARABLE_CLASS( CProfileSettingsView ) : public CAknView,
       
    85 							 public MProfileViewHandler
       
    86     {
       
    87     public:		// Constructors and destructor
       
    88 
       
    89         /**
       
    90         * Two-phased constructor.
       
    91         * @param aEngineHandler Engine Handler.
       
    92         * @param aIndexHandler Index Handler.
       
    93         * @return Returns an instance of CProfileSettingsView.
       
    94         */
       
    95 		static CProfileSettingsView* NewLC(
       
    96             CProfileEngineHandler& aEngineHandler,
       
    97             CProfileIndexHandler& aIndexHandler);
       
    98 
       
    99 		/**
       
   100 		* Destructor.
       
   101 		*/
       
   102 		~CProfileSettingsView();
       
   103 
       
   104 	public:		// Functions from base classes
       
   105 
       
   106         /**
       
   107         * From CAknView
       
   108         */
       
   109 	    TUid Id() const;
       
   110 
       
   111         /**
       
   112         * From CAknView
       
   113         */
       
   114 		void HandleCommandL( TInt aCommand );
       
   115 
       
   116         /**
       
   117         * From CAknView
       
   118         */
       
   119         void DoActivateL(
       
   120 			const TVwsViewId& aPrevViewId,
       
   121 			TUid aCustomMessageId,
       
   122 			const TDesC8& aCustomMessage );
       
   123 
       
   124         /**
       
   125         * From CAknView
       
   126         */
       
   127         void DoDeactivate();
       
   128 
       
   129         /**
       
   130         * From CAknView
       
   131         */
       
   132 		void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   133 
       
   134 		/**
       
   135         * From MProfileViewHandler
       
   136         */
       
   137         void UpdateClientRect();
       
   138 
       
   139 		/**
       
   140         * From MProfileViewHandler
       
   141         */
       
   142         CAknView& View();
       
   143 
       
   144 	private:	// Constructors and destructors
       
   145 
       
   146 		/**
       
   147 		* C++ constructor.
       
   148         * @param aEngineHandler Engine Handler.
       
   149         * @param aIndexHandler Index Handler.
       
   150 		*/
       
   151 		CProfileSettingsView(
       
   152             CProfileEngineHandler& aEngineHandler,
       
   153             CProfileIndexHandler& aIndexHandler);
       
   154 
       
   155         /**
       
   156         * By default Symbian 2nd phase constructor is private.
       
   157         */
       
   158 		void ConstructL();
       
   159 
       
   160 	private:	// Data
       
   161 
       
   162         // Engine handler
       
   163         CProfileEngineHandler& iEngineHandler;
       
   164 
       
   165         // Index handler
       
   166         CProfileIndexHandler& iIndexHandler;
       
   167 
       
   168 		// Own: Settings container.
       
   169         CProfileSettingsContainer* iContainer;
       
   170 
       
   171         // Own: Tab handler.
       
   172         CProfileTabHandler* iTabHandler;
       
   173 
       
   174         // Own: Control to route focus event to settings container
       
   175         CProfileTopControl* iTopControl;
       
   176 
       
   177         // Own: Dummy external settings handler for settings container
       
   178         CProfileDummyHandler* iDummyHandler;
       
   179     };
       
   180 
       
   181 #endif // CPROFILESETTINGSVIEW_H
       
   182 
       
   183 // End of File