calendarui/controller/inc/calensettingsui.h
changeset 89 b57382753122
parent 0 f979ecb2b13e
equal deleted inserted replaced
83:5aadd1120515 89:b57382753122
       
     1 /*
       
     2 * Copyright (c) 2007 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:   Role of this class is to show setting view and to set data.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CALENSETTINGSUI_H
       
    21 #define CALENSETTINGSUI_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <AknDialog.h>
       
    25 #include <eiklbo.h>
       
    26 
       
    27 //  FORWARD DECLARATIONS
       
    28 class CAknNavigationControlContainer;
       
    29 class CAknSettingStyleListBox;
       
    30 class CCalenSettingsUiContainer;
       
    31 class CAknsBasicBackgroundControlContext;
       
    32 class CCalenGlobalData;
       
    33 class CCalenCustomisationManager;
       
    34 
       
    35 //  CLASS DEFINITIONS
       
    36 
       
    37 /**
       
    38  * This dialog-derived class contains some functionality required to draw
       
    39  * the settings list. Many functions are passthroughs to CCalenSettingsUiContainer.
       
    40  */
       
    41 NONSHARABLE_CLASS( CCalenSettingsUi ) : public CAknDialog,
       
    42                                         public MEikListBoxObserver
       
    43     {
       
    44 public:  // Construction and destruction
       
    45     /**
       
    46      * Two phased constructor.
       
    47      */
       
    48     static CCalenSettingsUi* NewL( CCalenCustomisationManager& aCustomisationManager );
       
    49 
       
    50     /**
       
    51      * Destructor.
       
    52      */
       
    53     virtual ~CCalenSettingsUi();
       
    54 public: //from MEikListBoxObserver
       
    55     
       
    56     /**
       
    57      * Handles list box events.
       
    58      * @param aListBox   The originating list box.
       
    59      * @param aEventType A code for the event.
       
    60      */
       
    61     void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
    62 
       
    63 public:  // From CAknDialog
       
    64     /**
       
    65      * Processes menu choices.
       
    66      * @param aCommandId command id.
       
    67      */
       
    68     void ProcessCommandL( TInt aCommandId );
       
    69 
       
    70     /**
       
    71      * Handles key presses.
       
    72      * @param aKeyEvent the key event
       
    73      * @param aType the type of key press
       
    74      */
       
    75     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    76 
       
    77 protected:  // New functions
       
    78     /**
       
    79      * Handles "Help" command.
       
    80      */
       
    81     void OnCmdHelpL();
       
    82 
       
    83 protected:  // From CAknDialog
       
    84     /**
       
    85      * Called before layout operations performed.
       
    86      * @see CAknDialog.
       
    87      */
       
    88     void PreLayoutDynInitL();
       
    89 
       
    90     /**
       
    91      * Checks to see if exiting is a vaild action from the given command.
       
    92      * @param aButtonId command to check.
       
    93      * @return ETrue if the command is a valid command to exit on, EFalse otherwise.
       
    94      * @see CAknDialog.
       
    95      */
       
    96     TBool OkToExitL( TInt aButtonId );
       
    97 
       
    98 protected:  // From CCoeControl
       
    99     /**
       
   100      * Handles resource changes (i.e. screen resolution changes).
       
   101      * @param aType bitmask of resources changed.
       
   102      * @see CCoeControl.
       
   103      */
       
   104     void HandleResourceChange( TInt aType );
       
   105 
       
   106     /**
       
   107      * Called by the framework after SetRect gets called.
       
   108      * @see CCoeControl.
       
   109      */
       
   110     void SizeChanged();
       
   111 
       
   112     /**
       
   113      * Draws the control. We override to add skin support.
       
   114      * @see CCoeControl.
       
   115      */
       
   116     void Draw(const TRect& aRect) const;
       
   117 
       
   118     /**
       
   119      * Returns how many controls are contained in this control.
       
   120      * @return the number of component controls contained within.
       
   121      * @see CCoeControl.
       
   122      */
       
   123     TInt CountComponentControls() const;
       
   124 
       
   125     /**
       
   126      * Returns the component control at the given index.
       
   127      * @param aIndex index of the control to return.
       
   128      * @return component control at the given index.
       
   129      * @see CCoeControl.
       
   130      */
       
   131     CCoeControl* ComponentControl( TInt aIndex ) const;
       
   132 
       
   133     /**
       
   134      * Gets the help context.
       
   135      * @param aContext Help context.
       
   136      * @see CCoeControl.
       
   137      */
       
   138     void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   139 
       
   140 protected:  // From MObjectProvider
       
   141     /**
       
   142      * Provides the required object = in this case the background skin context.
       
   143      * @aId id of required object
       
   144      * @return supplied object.
       
   145      * @see MObjectProvider.
       
   146      */
       
   147     TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
       
   148 
       
   149 private:  // Construction and destruction
       
   150     /**
       
   151      * First phase of construction.
       
   152      * @param aPluginHandler the plugin handler which supplies settings extensions.
       
   153      */
       
   154     CCalenSettingsUi( CCalenCustomisationManager& aCustomisationManager );
       
   155 
       
   156     /**
       
   157      * Second phase of construction.
       
   158      */
       
   159     void ConstructL();
       
   160     
       
   161     /**
       
   162      * From CCoeControl Handle pointer event
       
   163      */
       
   164     void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   165     
       
   166 protected: //Data
       
   167         
       
   168     
       
   169     // flag for touch ui long tap functionality
       
   170     TBool    iFirstTap;     
       
   171 	
       
   172 
       
   173 private:  // Data
       
   174     // Handle to navi container. This is not owned.
       
   175     CAknNavigationControlContainer* iNaviContainer;
       
   176 
       
   177     // The settings object which does most of the work.
       
   178     CCalenSettingsUiContainer* iContainer;
       
   179 
       
   180     // The listbox containing the settings items.
       
   181     CAknSettingStyleListBox* iListBox;
       
   182 
       
   183     // The background control context, used to draw the background skin.
       
   184     CAknsBasicBackgroundControlContext* iBgContext;
       
   185 
       
   186     // Global data.
       
   187     CCalenGlobalData* iGlobalData;
       
   188 
       
   189     // Customisation manager.
       
   190     CCalenCustomisationManager& iCustomisationManager;
       
   191     TBool iPageStatus;
       
   192     };
       
   193 
       
   194 #endif // CALENSETTINGSUI_H
       
   195 
       
   196 // End of File
       
   197