iaupdate/IAD/ui/inc/iaupdatesettingdialog.h
changeset 0 ba25891c3a9e
child 9 51c0f5edf5ef
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:   Header file of CIAUpdateSettingDialog class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef IAUPDATESETTINGDIALOG_H
       
    22 #define IAUPDATESETTINGDIALOG_H
       
    23 
       
    24 
       
    25 //  INCLUDES
       
    26 #include "iaupdatedialogutil.h"
       
    27 
       
    28 #include <e32base.h>
       
    29 #include <AknDialog.h>
       
    30 #include <aknsettingitemlist.h>
       
    31 
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CAknSettingItemList;
       
    35 class CIAUpdateSettingItemList;
       
    36 class CIAUpdateAccessPointHandler;
       
    37 class CIAUpdateStatusPaneHandler;
       
    38 
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 /**
       
    43 * CIAUpdateSettingDialog
       
    44 *
       
    45 * CIAUpdateSettingDialog is used for editing IA Update settings.
       
    46 */
       
    47 class CIAUpdateSettingDialog : public CAknDialog, public MEikListBoxObserver
       
    48     {
       
    49     public:
       
    50     enum TAttributeKeys
       
    51         {
       
    52         EAccessPoint = 0,
       
    53         EAutoUpdateCheck,
       
    54         ERoamingWarning
       
    55         };
       
    56     
       
    57 	public:
       
    58 	
       
    59 	    /**
       
    60         * Launches dialog.
       
    61         * @param aParam Class that contains dialog parameters.
       
    62         * @return Completion code.
       
    63         */
       
    64 		static TBool ShowDialogL();
       
    65 		
       
    66 		
       
    67 	public:// Constructors and destructor
       
    68 
       
    69         /**
       
    70         * Two-phased constructor.
       
    71         */
       
    72 		static CIAUpdateSettingDialog* NewL();
       
    73         
       
    74         /**
       
    75         * Destructor.
       
    76         */
       
    77         virtual ~CIAUpdateSettingDialog();
       
    78     
       
    79     private:
       
    80 
       
    81         /**
       
    82         * C++ default constructor.
       
    83         */
       
    84         CIAUpdateSettingDialog();
       
    85 	
       
    86         /**
       
    87         * By default Symbian OS constructor is private.
       
    88         */
       
    89         void ConstructL();
       
    90 
       
    91 	private:
       
    92 	    SEikControlInfo CreateCustomControlL( TInt aControlType );
       
    93 	    
       
    94         /**
       
    95         * From MEikListBoxObserver, called by framework.
       
    96         * @param aListBox.
       
    97         * @param aEventType.
       
    98 		* @return None
       
    99         */
       
   100 		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   101 
       
   102         /**
       
   103         * From the base class.
       
   104 		* Called by framework before the dialog is shown.
       
   105         * @param None
       
   106 		* @return None
       
   107         */
       
   108         void PreLayoutDynInitL();
       
   109 
       
   110         /**
       
   111         * From the base class.
       
   112 		* Called by framework before exiting the dialog.
       
   113         * @param aButtonId Button id.
       
   114 		* @return ETrue to exit\ EFalse to not to exit.
       
   115         */
       
   116         TBool OkToExitL(TInt aButtonId);
       
   117 
       
   118         /**
       
   119         * From the base class.
       
   120 		* Called by framework for key event handling.
       
   121         * @param aKeyEvent.
       
   122 		* @param aType.
       
   123 		* @return Return code.
       
   124         */
       
   125 		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   126 
       
   127         /**
       
   128         * From the base class.
       
   129 		* Called by framework when dialog is activated.
       
   130         * @param None.
       
   131 		* @return None.
       
   132         */
       
   133 		void ActivateL();
       
   134 		
       
   135 		/**
       
   136 		* Method to get context sensitive help topic.
       
   137         * @param aContext Help topic to open.
       
   138 		* @return None.
       
   139         */
       
   140 		void GetHelpContext(TCoeHelpContext& aContext) const;
       
   141 
       
   142 		/**
       
   143         * From the base class.
       
   144 		* Called by framework before menu is shown.
       
   145         * @param aResourceId Menu resource id.
       
   146 		* @param aMenuPane Pointer to the menu.
       
   147         * @return None.
       
   148         */
       
   149 		void DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane);
       
   150 
       
   151 		/**
       
   152 		* From the base class.
       
   153 		* Handles menu events.
       
   154 		* @param  aCommandId Command id.
       
   155 		* @return None.
       
   156 		*/
       
   157 		void ProcessCommandL(TInt aCommandId);
       
   158 		
       
   159 		/**
       
   160 		* From base class.
       
   161 		* Called when UI layout changes. 
       
   162 		* @param aType.
       
   163     	* @return None.
       
   164 		*/
       
   165         void HandleResourceChange(TInt aType);
       
   166 
       
   167 
       
   168     private:
       
   169 		/**
       
   170 		* Save settings to CR.
       
   171 		*/
       
   172 		void SaveSettingsL();
       
   173 
       
   174 		/**
       
   175 		* Read settings from CR.
       
   176 		*/
       
   177         void ReadSettingsL();
       
   178      
       
   179 	private:
       
   180 		/**
       
   181         * Opens setting editor.
       
   182         */
       
   183 		void EditItemL();
       
   184 
       
   185 		/**
       
   186         * Set setting item visibility (normal/readonly/hidden).
       
   187         * @param None.
       
   188 		* @return None.
       
   189         */
       
   190 		void SetVisibility();
       
   191 		
       
   192         /**
       
   193         * Set all settings to read-only state.
       
   194         * @param None.
       
   195 		* @return None.
       
   196         */
       
   197 		void SetAllReadOnly();
       
   198 		
       
   199 
       
   200 	private:
       
   201 		CIAUpdateSettingItemList* iList;
       
   202 
       
   203 		// for title and icon handling
       
   204 		CIAUpdateStatusPaneHandler* iStatusPaneHandler;
       
   205 
       
   206 		// dialog edit mode
       
   207 		TInt iEditMode;
       
   208 
       
   209     };
       
   210 
       
   211 
       
   212 /**
       
   213 * CIAUpdateSettingItemList
       
   214 *
       
   215 * Customized setting item list.
       
   216 */
       
   217 class CIAUpdateSettingItemList : public CAknSettingItemList
       
   218     {
       
   219     public:
       
   220         TInt Attribute( TInt aKey );
       
   221         void CheckSettings();
       
   222         
       
   223         
       
   224     public:  // from CAknSettingItemList
       
   225         /**
       
   226         * Load settings.
       
   227         */
       
   228         void LoadSettingsL();
       
   229         
       
   230     	/**
       
   231     	* Launches the setting page for the current item by calling EditItemL on it
       
   232     	* @param aIndex	- current item's (Visible) index in the list
       
   233     	* @param aCalledFromMenu- ignored in most classes; may alter the behaviour
       
   234     	* of the setting page
       
   235     	*/
       
   236     	void EditItemL( TInt aIndex, TBool aCalledFromMenu );
       
   237 
       
   238         /**
       
   239         * Create setting item.
       
   240         * @param aSettingId Setting id.
       
   241         * @return Setting item.
       
   242         */
       
   243         CAknSettingItem* CreateSettingItemL( TInt aSettingId );
       
   244 
       
   245 	private:
       
   246 	    TInt iAccessPoint;
       
   247         TInt iAutoUpdateCheck;
       
   248         TInt iRoamingWarning;
       
   249         };
       
   250 
       
   251 
       
   252 class CIAUpdateAccessPointSettingItem : public CAknSettingItem
       
   253 	{
       
   254 	public:
       
   255         static CIAUpdateAccessPointSettingItem* 
       
   256         CIAUpdateAccessPointSettingItem::NewL( TInt aSettingId, TInt& aAccessPointId );
       
   257 	    ~CIAUpdateAccessPointSettingItem();
       
   258 	private:
       
   259 	    CIAUpdateAccessPointSettingItem ( TInt aSettingId, TInt& aAccessPointId );
       
   260 	    void ConstructL();
       
   261 	    
       
   262 
       
   263 	public:	// from CAknSettingItem
       
   264 		void EditItemL( TBool aCalledFromMenu );
       
   265 		const TDesC& SettingTextL();
       
   266 	
       
   267 	private:
       
   268 	    TBool EditAccessPointItemL();
       
   269 
       
   270     private:
       
   271         HBufC* iSettingText;
       
   272         
       
   273         TInt& iAccessPointId;
       
   274         
       
   275    		// for access point selection
       
   276 		CIAUpdateAccessPointHandler* iApHandler;
       
   277 	};
       
   278 
       
   279 
       
   280 
       
   281 #endif      // IAUPDATESETTINGDIALOG_H
       
   282             
       
   283 // End of File