omads/omadsappui/AspSyncUtil/inc/AspContentListDialog.h
branchRCL_3
changeset 52 4f0867e42d62
parent 0 dab8a81a92de
equal deleted inserted replaced
51:8e7494275d3a 52: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: Editing Content list (not used anymore) 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ASPCONTENTLISTDIALOG_H
       
    20 #define ASPCONTENTLISTDIALOG_H
       
    21 
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <eikdialg.h>
       
    26 #include <eiklbo.h>
       
    27 #include <aknlists.h>
       
    28 
       
    29 #include "aspdefines.h"
       
    30 #include "asputil.h"
       
    31 #include "aspdialogutil.h"
       
    32 #include "aspreshandler.h"
       
    33 
       
    34 #include <aknlistquerydialog.h>
       
    35 
       
    36 
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 * CAspContentListDialog
       
    42 *  
       
    43 * Content list dialog shows all available sync contents (sync data providers).
       
    44 */
       
    45 NONSHARABLE_CLASS (CAspContentListDialog) : public CAknDialog, public MEikListBoxObserver
       
    46     {
       
    47     enum TAspContentListDialogIconIndex
       
    48 		{
       
    49 	    EIconBothDirections = 0,
       
    50 	    EIconDeviceToServer = 1,
       
    51 	    EIconServerToDevice = 2,
       
    52 	    EIconNotDefined     = 3
       
    53 		};
       
    54 
       
    55 	public:
       
    56 
       
    57 	    /**
       
    58         * Launches setting dialog.
       
    59         * @param aParam Class that contains dialog parameters.
       
    60         * @return Completion code.
       
    61         */
       
    62 		static TBool ShowDialogL(const TAspParam& aParam);
       
    63 
       
    64     public:// Constructors and destructor
       
    65 
       
    66         /**
       
    67         * Two-phased constructor.
       
    68         */
       
    69         static CAspContentListDialog* NewL(const TAspParam& aParam);
       
    70         
       
    71         /**
       
    72         * Destructor.
       
    73         */
       
    74         virtual ~CAspContentListDialog();
       
    75     
       
    76     private:
       
    77 
       
    78         /**
       
    79         * C++ default constructor.
       
    80         */
       
    81         CAspContentListDialog(const TAspParam& aParam);
       
    82 	
       
    83         /**
       
    84         * By default Symbian OS constructor is private.
       
    85         */
       
    86         void ConstructL();
       
    87 
       
    88 
       
    89 	private:
       
    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 		* Handles menu events.
       
   101 		* @param  aCommandId Command id.
       
   102 		* @return None.
       
   103 		*/
       
   104 		void ProcessCommandL(TInt aCommandId);
       
   105 
       
   106         /**
       
   107         * From the base class.
       
   108 		* Called by framework before exiting the dialog.
       
   109         * @param Button id.
       
   110 		* @return ETrue to exit\ EFalse to not to exit.
       
   111         */
       
   112 		TBool OkToExitL(TInt aButtonId);
       
   113 		
       
   114         /**
       
   115         * From the base class.
       
   116 		* Called by framework for key event handling.
       
   117         * @param aKeyEvent.
       
   118 		* @param TEventCode.
       
   119 		* @return Return code.
       
   120         */
       
   121 		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   122 
       
   123 		/**
       
   124         * From the base class.
       
   125 		* Called by framework before menu is shown.
       
   126         * @param aResourceId Menu resource id.
       
   127 		* @param aMenuPane Pointer to the menu.
       
   128         * @return None.
       
   129         */
       
   130 		void DynInitMenuPaneL(TInt aResourceID,	CEikMenuPane* aMenuPane);
       
   131 
       
   132 	   /**
       
   133 		* From the base class.
       
   134         * Called when dialog is activated.
       
   135         * @return None.
       
   136         */
       
   137 		void ActivateL();
       
   138 		
       
   139 		/**
       
   140 		* Method to get context sensitive help topic.
       
   141         * @param aContext Help topic to open.
       
   142 		* @return None.
       
   143         */
       
   144 		void GetHelpContext(TCoeHelpContext& aContext) const;
       
   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: // from MEikListBoxObserver
       
   155 
       
   156 	    /**
       
   157         * From MEikListBoxObserver
       
   158         * @param aListBox Pointer to listbox.
       
   159 		* @param aEventType Event type.
       
   160         * @return None.
       
   161         */
       
   162 		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   163 
       
   164 	
       
   165     private:
       
   166 		/**
       
   167         * Creates icon.
       
   168 		* @param aId.
       
   169         * @param aFileName.
       
   170 		* @param aFileIndex.
       
   171 		* @param aFileMaskIndex.
       
   172         * @return Created icon.
       
   173         */
       
   174 		CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex);
       
   175 
       
   176 
       
   177 		/**
       
   178         * Updates listbox items.
       
   179         * @param None.
       
   180         * @return None.
       
   181         */
       
   182 		void UpdateListBoxL();
       
   183 
       
   184 		/**
       
   185         * Shows content dialog.
       
   186         * @param None.
       
   187         * @return None.
       
   188         */
       
   189 		void ShowContentL();
       
   190 
       
   191     private:
       
   192 		/**
       
   193 		* Utility function.
       
   194 		* @return Sync session.
       
   195         */
       
   196 		RSyncMLSession& Session();
       
   197 
       
   198 		/**
       
   199         * Utility function.
       
   200         * @return Dialog list box.
       
   201         */
       
   202 		CAknDoubleLargeStyleListBox* ListBox();
       
   203 
       
   204 		/**
       
   205         * Utility function.
       
   206         * @return Currently selected list box item.
       
   207         */
       
   208 		TAspProviderItem& SelectedProvider();
       
   209 
       
   210 
       
   211     private:
       
   212 		// id of the calling application
       
   213 		TInt iApplicationId;
       
   214 
       
   215 		// sync profile
       
   216 		CAspProfile* iProfile;
       
   217 		
       
   218 		// sync session
       
   219 		RSyncMLSession* iSyncSession;
       
   220 
       
   221 		// list box that contains all contents (applications)
       
   222 		CAknDoubleLargeStyleListBox* iSettingListBox;
       
   223 
       
   224 		// for title and icon handling
       
   225 		CStatusPaneHandler* iStatusPaneHandler;
       
   226 
       
   227     	// resource handler
       
   228 		CAspResHandler* iResHandler;
       
   229 
       
   230 		// list that contains all contents (applications)
       
   231 		CAspContentList* iContentList;
       
   232     };
       
   233 
       
   234 
       
   235 #endif    // ASPCONTENTLISTDIALOG_H
       
   236             
       
   237 // End of File