omads/omadsappui/AspSyncUtil/inc/AspSettingViewDialog.h
changeset 19 2691f6aa1921
parent 4 e6e896426eac
child 20 e1de7d03f843
equal deleted inserted replaced
4:e6e896426eac 19:2691f6aa1921
     1 /*
       
     2 * Copyright (c) 2005 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: Edit view setting dialog 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef ASPSETTINGVIEWDIALOG_H
       
    21 #define ASPSETTINGVIEWDIALOG_H
       
    22 
       
    23 
       
    24 //  INCLUDES
       
    25 
       
    26 #include "AspDialogUtil.h"
       
    27 
       
    28 #include <e32base.h>
       
    29 #include <aknlists.h>
       
    30 #include <AknDialog.h>
       
    31 
       
    32 #include <AknInfoPopupNoteController.h> // CAknInfoPopupNoteController
       
    33 
       
    34 
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 
       
    39 /**
       
    40 *  CAspSettingViewDialog
       
    41 *
       
    42 * CAspSettingViewDialog is used for editing various settings.
       
    43 */
       
    44 NONSHARABLE_CLASS (CAspSettingViewDialog) : public CAknDialog, public MEikListBoxObserver
       
    45     {
       
    46     public:
       
    47     
       
    48     
       
    49 	public:
       
    50 	    /**
       
    51         * Launches dialog.
       
    52         * @param aParam Class that contains dialog parameters.
       
    53         * @return Completion code.
       
    54         */
       
    55 		static TBool ShowDialogL(const TAspParam& aParam);
       
    56 
       
    57 	public:// Constructors and destructor
       
    58 
       
    59         /**
       
    60         * Two-phased constructor.
       
    61         */
       
    62 		static CAspSettingViewDialog* NewL(const TAspParam& aParam);
       
    63         
       
    64         /**
       
    65         * Destructor.
       
    66         */
       
    67         virtual ~CAspSettingViewDialog();
       
    68     
       
    69     private:
       
    70 
       
    71         /**
       
    72         * C++ default constructor.
       
    73         */
       
    74         CAspSettingViewDialog(const TAspParam& aParam);
       
    75 	
       
    76         /**
       
    77         * By default Symbian OS constructor is private.
       
    78         */
       
    79         void ConstructL();
       
    80 
       
    81 	private:
       
    82         /**
       
    83         * From MEikListBoxObserver, called by framework.
       
    84         * @param aListBox.
       
    85         * @param aEventType.
       
    86 		* @return None
       
    87         */
       
    88 		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
    89 
       
    90         /**
       
    91         * From the base class.
       
    92 		* Called by framework before the dialog is shown.
       
    93         * @param None
       
    94 		* @return None
       
    95         */
       
    96         void PreLayoutDynInitL();
       
    97 
       
    98         /**
       
    99         * From the base class.
       
   100 		* Called by framework before exiting the dialog.
       
   101         * @param aButtonId Button id.
       
   102 		* @return ETrue to exit\ EFalse to not to exit.
       
   103         */
       
   104         TBool OkToExitL(TInt aButtonId);
       
   105 
       
   106         /**
       
   107         * From the base class.
       
   108 		* Called by framework for key event handling.
       
   109         * @param aKeyEvent.
       
   110 		* @param aType.
       
   111 		* @return Return code.
       
   112         */
       
   113 		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   114 
       
   115         /**
       
   116         * From the base class.
       
   117 		* Called by framework when dialog is activated.
       
   118         * @param None.
       
   119 		* @return None.
       
   120         */
       
   121 		void ActivateL();
       
   122 		
       
   123 		/**
       
   124 		* Method to get context sensitive help topic.
       
   125         * @param aContext Help topic to open.
       
   126 		* @return None.
       
   127         */
       
   128 		void GetHelpContext(TCoeHelpContext& aContext) const;
       
   129 
       
   130 
       
   131 		/**
       
   132 		* From the base class.
       
   133 		* Handles menu events.
       
   134 		* @param  aCommandId Command id.
       
   135 		* @return None.
       
   136 		*/
       
   137 		void ProcessCommandL(TInt aCommandId);
       
   138 		
       
   139 		/**
       
   140 		* From base class.
       
   141 		* Called when UI layout changes. 
       
   142 		* @param aType.
       
   143     	* @return None.
       
   144 		*/
       
   145         void HandleResourceChange(TInt aType);
       
   146 
       
   147     private:
       
   148 		/**
       
   149 		* Handles setting item editing.
       
   150 		* @param None.
       
   151 		* @return None.
       
   152 		*/
       
   153 		void HandleOKL();
       
   154 		
       
   155 		/**
       
   156 		* Set setting list icons.
       
   157 		* @param None.
       
   158 		* @return None.
       
   159 		*/
       
   160 		void SetIconsL();
       
   161 
       
   162 	
       
   163 	public:  // common editors
       
   164 	
       
   165     
       
   166     private:
       
   167     
       
   168 		/**
       
   169 		* Handles setting item editing.
       
   170 		* @param aItem Setting item data.
       
   171 		* @return Return code.
       
   172 		*/
       
   173 	   void EditSettingItemL(CAspListItemData& aItem);
       
   174 		
       
   175 		/**
       
   176 		* Opens profile setting dialog.
       
   177 		* @param None.
       
   178 		* @return Return code.
       
   179 		*/
       
   180 	  TInt EditSettingItemProfileSettingL();
       
   181 	  
       
   182 	  	/**
       
   183 		* Opens schedule dialog.
       
   184 		* @param None.
       
   185 		* @return Return code.
       
   186 		*/
       
   187 	  TInt EditSettingItemSchedulingSettingL();
       
   188     	/**
       
   189 		* Opens content dialog.
       
   190 		* @param None.
       
   191 		* @return Return code.
       
   192 		*/
       
   193 	  TInt EditSettingItemSyncContentL(CAspListItemData& aItem);
       
   194 
       
   195 
       
   196     private:
       
   197 
       
   198 		
       
   199 
       
   200 	private:
       
   201 		/**
       
   202         * Create one CNSmlDSProfileData for each setting.
       
   203         * @param None.
       
   204         * @return None.
       
   205         */
       
   206 		void CreateSettingsListL();
       
   207 		
       
   208 		/**
       
   209         * Initalizes setting item needed for listbox handling.
       
   210         * @param aItem.
       
   211         * @return None.
       
   212         */
       
   213 		void InitSettingItemL(CAspListItemData* aItem);
       
   214 		
       
   215 		/**
       
   216         * Add settings titles into listbox.
       
   217         * @param aListBox.
       
   218         * @param aItemList List of setting items.
       
   219         * @return None.
       
   220         */
       
   221 		void UpdateListBoxL(CEikTextListBox* aListBox, CAspSettingList* aItemList);
       
   222 
       
   223 		/**
       
   224         * Adds profile setting into item list.
       
   225         * @param None.
       
   226 		* @return None.
       
   227         */
       
   228 		void AddProfileSettingItemL();
       
   229 		/**
       
   230         * Adds scheduling setting into item list.
       
   231         * @param None.
       
   232 		* @return None.
       
   233         */
       
   234 		void AddSchedulingSettingItemL();
       
   235 		/**
       
   236         * Adds sync contents into item list.
       
   237         * @param None.
       
   238 		* @return None.
       
   239         */
       
   240 		void AddContentItemsL();
       
   241 		
       
   242 		
       
   243 
       
   244     private:
       
   245 
       
   246 		/**
       
   247         * Creates icon.
       
   248 		* @param aId.
       
   249         * @param aFileName.
       
   250 		* @param aFileIndex.
       
   251 		* @param aFileMaskIndex.
       
   252         * @return Created icon.
       
   253         */
       
   254 		CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex);
       
   255 		
       
   256 		/**
       
   257 		* Returns setting item with listbox position aIndex.
       
   258 		* @param aIndex Listbox index.
       
   259 		* @return Pointer to setting item.
       
   260         */
       
   261 		CAspListItemData* GetItemForIndex(TInt aIndex);
       
   262 
       
   263 		/**
       
   264         * Returns setting item with id aItemId.
       
   265         * @param aItemId Item id.
       
   266         * @return Pointer to setting item.
       
   267         */
       
   268 		CAspListItemData* Item(TInt aItemId);
       
   269 
       
   270 		/**
       
   271 		* Returns listbox.
       
   272 		* @param None.
       
   273 		* @return Pointer to listbox.
       
   274 		*/
       
   275 		CAknSettingStyleListBox* ListBox();
       
   276 
       
   277 		/**
       
   278 		* Returns profile.
       
   279 		* @param None.
       
   280 		* @return Pointer to sync profile.
       
   281 		*/
       
   282 		//CAspProfile* Profile();
       
   283 
       
   284 		TInt GetIndexFromProvider(TInt aDataProvider);
       
   285 
       
   286 		void SetVisibility();
       
   287 
       
   288 	private:
       
   289 		// setting list
       
   290 		CAknSettingStyleListBox* iSettingListBox;
       
   291 
       
   292 		// list of setting items
       
   293 		CAspSettingList *iSettingList;
       
   294 		
       
   295      	// profile data
       
   296 		CAspProfile* iProfile;
       
   297 
       
   298    		// sync session
       
   299 		RSyncMLSession* iSyncSession;
       
   300 
       
   301 		// for title and icon handling
       
   302 		CStatusPaneHandler* iStatusPaneHandler;
       
   303 
       
   304 		// resource handler
       
   305 		CAspResHandler* iResHandler;
       
   306 
       
   307 		// dialog edit mode
       
   308 		TInt iEditMode;
       
   309 
       
   310 		// long buffer for string handling
       
   311 		TBuf<KBufSize255> iBuf;
       
   312 
       
   313 		TInt iDataProviderId;
       
   314 		
       
   315 		// list that contains all contents (applications)
       
   316 		CAspContentList* iContentList;
       
   317 		
       
   318 		// list that contains all profiles
       
   319 		CAspProfileList* iProfileList;
       
   320 
       
   321 		// id of the calling application
       
   322 		TInt iApplicationId;
       
   323 
       
   324 		CAspSchedule* iSchedule;
       
   325 
       
   326 				
       
   327 		};
       
   328 
       
   329 
       
   330 #endif      // ASPSETTINGVIEWIALOG_H
       
   331             
       
   332 // End of File