omads/omadsappui/AspSyncUtil/inc/AspProfileSelectionDialog.h
branchRCL_3
changeset 25 4f0867e42d62
parent 0 dab8a81a92de
equal deleted inserted replaced
24:8e7494275d3a 25:4f0867e42d62
       
     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: Dialog to select profile to be used for scheduled sync 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef ASPPROFILESELECTIONDIALOG_H
       
    21 #define ASPPROFILESELECTIONDIALOG_H
       
    22 
       
    23 
       
    24 //  INCLUDES
       
    25 
       
    26 #include "AspDialogUtil.h"
       
    27 
       
    28 #include <e32base.h>
       
    29 #include <aknlists.h>
       
    30 #include <AknDialog.h>
       
    31 #include <aknselectionlist.h>
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 
       
    35 
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 
       
    40 /**
       
    41 *  CAspProfileSelectionDialog
       
    42 *
       
    43 * CAspProfileSelectionDialog is used for selecting auto sync profile.
       
    44 */
       
    45 NONSHARABLE_CLASS (CAspProfileSelectionDialog) : public CAknDialog, public MEikListBoxObserver
       
    46     {
       
    47     
       
    48 	public:
       
    49 	    /**
       
    50         * Launches dialog.
       
    51         * @param aParam Class that contains dialog parameters.
       
    52         * @return Completion code.
       
    53         */
       
    54 		static TBool ShowDialogL(TAspParam& aParam);
       
    55 
       
    56 	public:// Constructors and destructor
       
    57 
       
    58         /**
       
    59         * Two-phased constructor.
       
    60         */
       
    61 		static CAspProfileSelectionDialog* NewL(TAspParam& aParam);
       
    62         
       
    63         /**
       
    64         * Destructor.
       
    65         */
       
    66         virtual ~CAspProfileSelectionDialog();
       
    67     
       
    68     private:
       
    69 
       
    70         /**
       
    71         * C++ default constructor.
       
    72         */
       
    73         CAspProfileSelectionDialog(TAspParam& aParam);
       
    74 	
       
    75         /**
       
    76         * By default Symbian OS constructor is private.
       
    77         */
       
    78         void ConstructL();
       
    79 
       
    80 	private:
       
    81         /**
       
    82         * From MEikListBoxObserver, called by framework.
       
    83         * @param aListBox.
       
    84         * @param aEventType.
       
    85 		* @return None
       
    86         */
       
    87 		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
    88 
       
    89         /**
       
    90         * From the base class.
       
    91 		* Called by framework before the dialog is shown.
       
    92         * @param None
       
    93 		* @return None
       
    94         */
       
    95         void PreLayoutDynInitL();
       
    96 
       
    97         /**
       
    98         * From the base class.
       
    99 		* Called by framework before exiting the dialog.
       
   100         * @param aButtonId Button id.
       
   101 		* @return ETrue to exit\ EFalse to not to exit.
       
   102         */
       
   103         TBool OkToExitL(TInt aButtonId);
       
   104 
       
   105         /**
       
   106         * From the base class.
       
   107 		* Called by framework for key event handling.
       
   108         * @param aKeyEvent.
       
   109 		* @param aType.
       
   110 		* @return Return code.
       
   111         */
       
   112 		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   113 
       
   114         /**
       
   115         * From the base class.
       
   116 		* Called by framework when dialog is activated.
       
   117         * @param None.
       
   118 		* @return None.
       
   119         */
       
   120 		void ActivateL();
       
   121 		
       
   122 		/**
       
   123 		* Method to get context sensitive help topic.
       
   124         * @param aContext Help topic to open.
       
   125 		* @return None.
       
   126         */
       
   127 		void GetHelpContext(TCoeHelpContext& aContext) const;
       
   128 
       
   129 		/**
       
   130         * From the base class.
       
   131 		* Called by framework before menu is shown.
       
   132         * @param aResourceId Menu resource id.
       
   133 		* @param aMenuPane Pointer to the menu.
       
   134         * @return None.
       
   135         */
       
   136 		void DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane);
       
   137 
       
   138 		/**
       
   139 		* From the base class.
       
   140 		* Handles menu events.
       
   141 		* @param  aCommandId Command id.
       
   142 		* @return None.
       
   143 		*/
       
   144 		void ProcessCommandL(TInt aCommandId);
       
   145 		
       
   146 		/**
       
   147 		* From base class.
       
   148 		* Called when UI layout changes. 
       
   149 		* @param aType.
       
   150     	* @return None.
       
   151 		*/
       
   152         void HandleResourceChange(TInt aType);
       
   153 
       
   154     private:
       
   155 		/**
       
   156 		* Handles setting item editing.
       
   157 		* @param None.
       
   158 		* @return None.
       
   159 		*/
       
   160 		void HandleOKL();
       
   161 		
       
   162 		/**
       
   163 		* Set setting list icons.
       
   164 		* @param None.
       
   165 		* @return None.
       
   166 		*/
       
   167 		void SetIconsL();
       
   168 		
       
   169 		/**
       
   170 		* Shown sync profile content list.
       
   171 		* @param None.
       
   172 		* @return None.
       
   173 		*/
       
   174 		void ShowContentListL();
       
   175 
       
   176 
       
   177     private:
       
   178 		
       
   179 		/**
       
   180         * Add settings titles into listbox.
       
   181         * @param None.
       
   182         * @return None.
       
   183         */
       
   184 		void UpdateListBoxL();
       
   185 		
       
   186 		/**
       
   187 		* Utility function, updates dialog cba.
       
   188 		* @param None.
       
   189 		* @return None.
       
   190 		*/
       
   191 		void UpdateCbaL();
       
   192 		
       
   193 
       
   194     private:
       
   195 
       
   196 		/**
       
   197         * Creates icon.
       
   198 		* @param aId.
       
   199         * @param aFileName.
       
   200 		* @param aFileIndex.
       
   201 		* @param aFileMaskIndex.
       
   202         * @return Created icon.
       
   203         */
       
   204 		CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex);
       
   205 		
       
   206 
       
   207 
       
   208 	private:
       
   209 		// dialog parameter for returning value to caller
       
   210 		TAspParam* iDialogParam;
       
   211 
       
   212   		// id of the calling application
       
   213 		TInt iApplicationId;
       
   214 		
       
   215 		// currently selected profile
       
   216 		TInt iProfileId;
       
   217 
       
   218 		// setting list
       
   219 		CAknSingleGraphicStyleListBox* iListBox;
       
   220 
       
   221    		// sync session
       
   222 		RSyncMLSession* iSyncSession;
       
   223 
       
   224 		// for title and icon handling
       
   225 		CStatusPaneHandler* iStatusPaneHandler;
       
   226 
       
   227 		// long buffer for string handling
       
   228 		TBuf<KBufSize255> iBuf;
       
   229 		
       
   230 		// list that contains all profiles
       
   231 		CAspProfileList* iProfileList;
       
   232 		
       
   233 		// list that contains all contents (applications)
       
   234 		CAspContentList* iContentList;
       
   235 		
       
   236 		// id of current cba resource
       
   237 		TInt iCommandSetId;
       
   238     };
       
   239 
       
   240 
       
   241 #endif      // ASPPROFILESELECTIONDIALOG_H
       
   242             
       
   243 // End of File