profilesapplication/Profiles/ProfileApp/UIsrc/CProfileMainView.h
branchRCL_3
changeset 19 cd54903d48da
equal deleted inserted replaced
18:b7fa36b488f8 19:cd54903d48da
       
     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:  Main view class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CPROFILEMAINVIEW_H
       
    21 #define CPROFILEMAINVIEW_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <aknview.h>
       
    25 #include "MProfileChangeObserver.h"
       
    26 #include "MProfileViewHandler.h"
       
    27 
       
    28 // CONSTANTS
       
    29 const TUid KProfileAppMainViewId	= { 1 }; // UID of view
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CProfileEngineHandler;
       
    33 class CProfileIndexHandler;
       
    34 class CProfileMainContainer;
       
    35 class CProfileChangeNotifyHandler;
       
    36 class CProfileNaviPaneContainer;
       
    37 class MProfilesLocalFeatures;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 /**
       
    41 *  Main view class.
       
    42 *  Derived from MProfileChangeObserver to get an event when active profile is
       
    43 *  changed (needed for updating the navi pane).
       
    44 *
       
    45 *  @lib ProfileApp.app
       
    46 *  @since 1.2
       
    47 */
       
    48 NONSHARABLE_CLASS( CProfileMainView ) : public CAknView,
       
    49                          public MProfileChangeObserver,
       
    50                          public MProfileViewHandler
       
    51     {
       
    52     public:     // Constructors and destructor
       
    53 
       
    54         /**
       
    55         * Two-phased constructor.
       
    56         * @param aEngineHandler Engine Handler.
       
    57         * @param aIndexHandler Index Handler.
       
    58         * @return Returns an instance of CProfileMainView.
       
    59         */
       
    60         static CProfileMainView* NewLC(
       
    61             CProfileEngineHandler& aEngineHandler,
       
    62             CProfileIndexHandler& aIndexHandler );
       
    63 
       
    64         /**
       
    65         * Destructor.
       
    66         */
       
    67         ~CProfileMainView();
       
    68 
       
    69 	public:     // Functions from base classes
       
    70 
       
    71         /**
       
    72         * From CAknView
       
    73         */
       
    74         TUid Id() const;
       
    75 
       
    76         /**
       
    77         * From CAknView
       
    78         */
       
    79         void HandleCommandL( TInt aCommand );
       
    80         
       
    81         /**
       
    82         * From MProfileViewHandler
       
    83         */
       
    84         void UpdateClientRect();
       
    85 
       
    86         /**
       
    87         * From MProfileViewHandler
       
    88         */
       
    89 		CAknView& View();
       
    90 
       
    91     private:    // New functions
       
    92 
       
    93 		/**
       
    94 		* Launches a CAknQueryDialog.
       
    95 		* @param aResourceId Resource id to DIALOG resource.
       
    96 		* @return Returns ETrue if user accepted the query.
       
    97 		*/
       
    98 		TBool DisplayConfirmationQueryL( TInt aResourceId ) const;
       
    99 
       
   100 		/**
       
   101 		* HandleCommandL switch separated to own method.
       
   102 		*/
       
   103 		void DoCmdActivateL();
       
   104 
       
   105 		/**
       
   106 		* HandleCommandL switch separated to own method.
       
   107 		*/
       
   108 		void DoCmdCreateNewL();
       
   109 
       
   110 		/**
       
   111 		* HandleCommandL switch separated to own method.
       
   112 		*/
       
   113 		void DoCmdDeleteL();
       
   114 
       
   115 		/**
       
   116 		* HandleCommandL switch separated to own method.
       
   117 		*/
       
   118 		void DoCmdContextSpecificOptionsMenuL();
       
   119 		
       
   120 		/**
       
   121 		* HandleCommandL switch separated to own method.
       
   122 		*/
       
   123 		void DoCmdTimedL();
       
   124 		
       
   125 		/**
       
   126 		* Displays information note containing time left
       
   127 		* until the profile expires
       
   128 		*/
       
   129 		void DisplayTimedInfoNoteL( TInt aMinutes, TInt aHours ) const;
       
   130 		/**
       
   131 		* Displays confirmation note containing time left
       
   132 		* until the profile expires
       
   133 		*/
       
   134 		void DisplayTimedQueryNoteL( TInt aMinutes, TInt aHours ) const;
       
   135 		
       
   136 		/**
       
   137 		* Update cba.
       
   138 		*/
       
   139 		void UpdateCbaL(TInt aResourceId);
       
   140 
       
   141 
       
   142     private:    // Functions from base classes.
       
   143 
       
   144         /**
       
   145         * From CAknView
       
   146         */
       
   147         void DoActivateL(
       
   148             const TVwsViewId& aPrevViewId,
       
   149             TUid aCustomMessageId,
       
   150             const TDesC8& aCustomMessage );
       
   151 
       
   152 		/**
       
   153         * From CAknView
       
   154         */
       
   155         void DoDeactivate();
       
   156 
       
   157         /**
       
   158         * From CAknView
       
   159         */
       
   160 		void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   161 
       
   162         /**
       
   163         * From MProfileChangeObserver
       
   164         */
       
   165         void HandleActiveProfileEventL(
       
   166             TProfileEvent aProfileEvent, TInt aProfileId );
       
   167 
       
   168     private:
       
   169 
       
   170         /**
       
   171         * C++ constructor.
       
   172         * @param aEngineHandler Engine Handler.
       
   173         * @param aIndexHandler Index Handler.
       
   174         */
       
   175         CProfileMainView(
       
   176             CProfileEngineHandler& aEngineHandler,
       
   177             CProfileIndexHandler& aIndexHandler );
       
   178 
       
   179 	    /**
       
   180         * By default Symbian 2nd phase constructor is private.
       
   181         */
       
   182         void ConstructL();
       
   183 
       
   184     private:    // Data
       
   185 
       
   186         // Engine handler
       
   187         CProfileEngineHandler& iEngineHandler;
       
   188 
       
   189         // Index handler
       
   190         CProfileIndexHandler& iIndexHandler;
       
   191 
       
   192         // Top item index of the listbox.
       
   193 		TInt iTopItemIndex;
       
   194 
       
   195         // Own: Main Container.
       
   196         CProfileMainContainer* iContainer;
       
   197 
       
   198         // Own: Profile change notify handler.
       
   199         CProfileChangeNotifyHandler* iNotifier;
       
   200 
       
   201         // Own: Navi pane container.
       
   202         CProfileNaviPaneContainer* iNaviPaneContainer;
       
   203         
       
   204         // Not own: locally variated features of Profiles:
       
   205         MProfilesLocalFeatures* iLocalFeatures;
       
   206 
       
   207     };
       
   208 
       
   209 
       
   210 #endif // CPROFILEMAINVIEW_H
       
   211 
       
   212 
       
   213 // End of File