iaupdate/IAD/ui/inc/iaupdatesettingdialog.h
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
     1 /*
     2 * Copyright (c) 2010-2011 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:   CIAUpdateSettingDialog
    14 * Description:   Header file of CIAUpdateSettingDialog class
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #ifndef ACTION_H_
    18 
    19 #define ACTION_H_
    19 
    20 
    20 
    21 #include <hbview.h>
    21 #ifndef IAUPDATESETTINGDIALOG_H
    22 #include <hblineedit.h>
    22 #define IAUPDATESETTINGDIALOG_H
    23 #include <hblistwidget.h>
    23 
    24 #include <hblabel.h>
    24 
    25 #include <hbdataform.h>
    25 //  INCLUDES
    26 #include <hbdataformmodel.h>
    26 #include "iaupdatedialogutil.h"
    27 
    27 
    28 // Access point selection
    28 #include <e32base.h>
    29 #include <cmmanager.h>
    29 #include <AknDialog.h>
    30 
    30 #include <aknsettingitemlist.h>
    31 // Destination query dialog
    31 
    32 #include "cmapplsettingsui.h"
    32 
    33 
    33 // FORWARD DECLARATIONS
    34 class CIAUpdateSettingDialog : public HbView
    34 class CAknSettingItemList;
    35 {
    35 class CIAUpdateSettingItemList;
    36     Q_OBJECT
    36 class CIAUpdateAccessPointHandler;
    37 
    37 class CIAUpdateStatusPaneHandler;
    38 public:
    38 
    39     explicit CIAUpdateSettingDialog(QGraphicsItem *parent=0);
    39 
    40     virtual ~CIAUpdateSettingDialog();
    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         };
    41     
    55     
    42 public slots:
    56 	public:
       
    57 	
       
    58 	    /**
       
    59         * Launches dialog.
       
    60         * @param aParam Class that contains dialog parameters.
       
    61         * @return Completion code.
       
    62         */
       
    63 		static TBool ShowDialogL();
       
    64 		
       
    65 		
       
    66 	public:// Constructors and destructor
       
    67 
       
    68         /**
       
    69         * Two-phased constructor.
       
    70         */
       
    71 		static CIAUpdateSettingDialog* NewL();
       
    72         
       
    73         /**
       
    74         * Destructor.
       
    75         */
       
    76         virtual ~CIAUpdateSettingDialog();
    43     
    77     
    44 private slots:
    78     private:
    45      void toggleChange(QModelIndex startIn, QModelIndex endIn);
    79 
    46      void showResults(uint retval);
    80         /**
    47      void showPreviousView(); 
    81         * C++ default constructor.
    48      void activated(const QModelIndex& index);
    82         */
       
    83         CIAUpdateSettingDialog();
       
    84 	
       
    85         /**
       
    86         * By default Symbian OS constructor is private.
       
    87         */
       
    88         void ConstructL();
       
    89 
       
    90 	private:
       
    91 	    SEikControlInfo CreateCustomControlL( TInt aControlType );
       
    92 	    
       
    93         /**
       
    94         * From MEikListBoxObserver, called by framework.
       
    95         * @param aListBox.
       
    96         * @param aEventType.
       
    97 		* @return None
       
    98         */
       
    99 		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   100 
       
   101         /**
       
   102         * From the base class.
       
   103 		* Called by framework before the dialog is shown.
       
   104         * @param None
       
   105 		* @return None
       
   106         */
       
   107         void PreLayoutDynInitL();
       
   108 
       
   109         /**
       
   110         * From the base class.
       
   111 		* Called by framework before exiting the dialog.
       
   112         * @param aButtonId Button id.
       
   113 		* @return ETrue to exit\ EFalse to not to exit.
       
   114         */
       
   115         TBool OkToExitL(TInt aButtonId);
       
   116 
       
   117         /**
       
   118         * From the base class.
       
   119 		* Called by framework for key event handling.
       
   120         * @param aKeyEvent.
       
   121 		* @param aType.
       
   122 		* @return Return code.
       
   123         */
       
   124 		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   125 
       
   126         /**
       
   127         * From the base class.
       
   128 		* Called by framework when dialog is activated.
       
   129         * @param None.
       
   130 		* @return None.
       
   131         */
       
   132 		void ActivateL();
       
   133 		
       
   134 		/**
       
   135 		* Method to get context sensitive help topic.
       
   136         * @param aContext Help topic to open.
       
   137 		* @return None.
       
   138         */
       
   139 		void GetHelpContext(TCoeHelpContext& aContext) const;
       
   140 
       
   141 		/**
       
   142         * From the base class.
       
   143 		* Called by framework before menu is shown.
       
   144         * @param aResourceId Menu resource id.
       
   145 		* @param aMenuPane Pointer to the menu.
       
   146         * @return None.
       
   147         */
       
   148 		void DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane);
       
   149 
       
   150 		/**
       
   151 		* From the base class.
       
   152 		* Handles menu events.
       
   153 		* @param  aCommandId Command id.
       
   154 		* @return None.
       
   155 		*/
       
   156 		void ProcessCommandL(TInt aCommandId);
       
   157 		
       
   158 		/**
       
   159 		* From base class.
       
   160 		* Called when UI layout changes. 
       
   161 		* @param aType.
       
   162     	* @return None.
       
   163 		*/
       
   164         void HandleResourceChange(TInt aType);
       
   165 
       
   166 
       
   167     private:
       
   168 		/**
       
   169 		* Save settings to CR.
       
   170 		*/
       
   171 		void SaveSettingsL();
       
   172 
       
   173 		/**
       
   174 		* Read settings from CR.
       
   175 		*/
       
   176         void ReadSettingsL();
    49      
   177      
    50 signals:
   178 	private:
    51          void toMainView();
   179 		/**
    52     
   180         * Opens setting editor.
    53 private:
   181         */
    54      
   182 		void EditItemL();
    55      void queryDestination();
   183 
    56      
   184 		/**
    57      void saveSettingsL();
   185         * Set setting item visibility (normal/readonly/hidden).
    58      
   186         * @param None.
    59      void initializeView();
   187 		* @return None.
    60      
   188         */
    61      uint getInternetSnapIdL();
   189 		void SetVisibility();
    62      
   190 		
    63      void getDestinationNameL( uint aItemUid, QString& aItemName );
   191         /**
    64      
   192         * Set all settings to read-only state.
    65      void initializeFieldsL();
   193         * @param None.
    66      
   194 		* @return None.
    67     // Form & model    
   195         */
    68     HbDataForm* mSettingsForm;
   196 		void SetAllReadOnly();
    69     HbDataFormModel *mModel;
   197 		
    70     
   198 
    71     
   199 	private:
    72     // settings ui
   200 		CIAUpdateSettingItemList* iList;
    73     CmApplSettingsUi* mApplSett;
   201 
    74     CmApplSettingsUi::SettingSelection mSelection;
   202 		// for title and icon handling
    75 
   203 		CIAUpdateStatusPaneHandler* iStatusPaneHandler;
    76     // Form items
   204 
    77     HbDataFormModelItem *mAutoUpdateItem;
   205 		// dialog edit mode
    78     HbDataFormModelItem *mDestinationItem;
   206 		TInt iEditMode;
    79     
   207 
    80     // currently selected destination
   208     };
    81     QString mCurrentDest;
   209 
    82     
   210 
    83     // NW connection flags
   211 /**
    84     bool mSetByNwQuery; // destination set by query / user
   212 * CIAUpdateSettingItemList
    85     bool mConnected;    // already connected to query ?
   213 *
    86     bool mInitialized;  // connection initialized ?
   214 * Customized setting item list.
    87     
   215 */
    88     //TInt mAccessPointId;
   216 class CIAUpdateSettingItemList : public CAknSettingItemList
    89     
   217     {
    90     // Connection manager
   218     public:
    91     RCmManager mCmManager;
   219         TInt Attribute( TInt aKey );
    92     
   220         void CheckSettings();
    93     // for back key catching
   221         
    94     HbAction*                   mBackKey;
   222         
    95     
   223     public:  // from CAknSettingItemList
    96     
   224         /**
    97 
   225         * Load settings.
    98 };
   226         */
    99 
   227         void LoadSettingsL();
   100 #endif /* ACTION_H_ */
   228         
       
   229     	/**
       
   230     	* Launches the setting page for the current item by calling EditItemL on it
       
   231     	* @param aIndex	- current item's (Visible) index in the list
       
   232     	* @param aCalledFromMenu- ignored in most classes; may alter the behaviour
       
   233     	* of the setting page
       
   234     	*/
       
   235     	void EditItemL( TInt aIndex, TBool aCalledFromMenu );
       
   236 
       
   237         /**
       
   238         * Create setting item.
       
   239         * @param aSettingId Setting id.
       
   240         * @return Setting item.
       
   241         */
       
   242         CAknSettingItem* CreateSettingItemL( TInt aSettingId );
       
   243 
       
   244 	private:
       
   245 	    TInt iAccessPoint;
       
   246         TInt iAutoUpdateCheck;
       
   247         };
       
   248 
       
   249 
       
   250 class CIAUpdateAccessPointSettingItem : public CAknSettingItem
       
   251 	{
       
   252 	public:
       
   253         static CIAUpdateAccessPointSettingItem* 
       
   254         CIAUpdateAccessPointSettingItem::NewL( TInt aSettingId, TInt& aAccessPointId );
       
   255 	    ~CIAUpdateAccessPointSettingItem();
       
   256 	private:
       
   257 	    CIAUpdateAccessPointSettingItem ( TInt aSettingId, TInt& aAccessPointId );
       
   258 	    void ConstructL();
       
   259 	    
       
   260 
       
   261 	public:	// from CAknSettingItem
       
   262 		void EditItemL( TBool aCalledFromMenu );
       
   263 		const TDesC& SettingTextL();
       
   264 	
       
   265 	private:
       
   266 	    TBool EditAccessPointItemL();
       
   267 
       
   268     private:
       
   269         HBufC* iSettingText;
       
   270         
       
   271         TInt& iAccessPointId;
       
   272         
       
   273    		// for access point selection
       
   274 		CIAUpdateAccessPointHandler* iApHandler;
       
   275 	};
       
   276 
       
   277 
       
   278 
       
   279 #endif      // IAUPDATESETTINGDIALOG_H
       
   280             
       
   281 // End of File