phonebookui/Phonebook2/xSPExtensionManager/src/xSPOrderOrganizer.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2006 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: 
       
    15 *       xSP order organizer
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __XSPORDERORGANIZER_H__
       
    21 #define __XSPORDERORGANIZER_H__
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CxSPViewInfo;
       
    28 
       
    29 class TxSPOrderUnit
       
    30 	{
       
    31 	public:
       
    32 	
       
    33 		/**
       
    34 		 * Internalize the class data
       
    35 		 *
       
    36 		 * @param aStream Stream for internalizing
       
    37 		 */	
       
    38 		void InternalizeL( RReadStream& aStream );
       
    39 		
       
    40 		/**
       
    41 		 * Externalize the class data
       
    42 		 *
       
    43 		 * @param aStream Stream for externalizing
       
    44 		 */	
       
    45 		void ExternalizeL( RWriteStream& aStream ) const;
       
    46 		
       
    47 	public: // data
       
    48 	
       
    49 		/// Own: xSP id
       
    50 		TUint32 iId;
       
    51 		/// Own: tab view old (unmapped) id
       
    52 		TUint32 iViewId;	
       
    53 	};
       
    54 
       
    55 /**
       
    56  * xSP order organizer
       
    57  */
       
    58 class xSPOrderOrganizer
       
    59     {
       
    60     public:
       
    61     
       
    62     	/**
       
    63 		 *	Check and arrange xSP view order. Currently present extension
       
    64 		 *	data is compared to the data from the previous start. Newly
       
    65 		 *	installed extensions will go to the end of array.
       
    66 		 *	
       
    67 		 *	@param aViewIdMap array of view id mappings. Possibly
       
    68 		 *			will be rearranged on return
       
    69 		 *	@return error code
       
    70 		 */
       
    71     	static TInt OrderCheck( RPointerArray<CxSPViewInfo>& aViewIdMap );
       
    72     	
       
    73     	/**
       
    74 		 *	Reorganize xSP view order. Will be effective on Phonebook restart.
       
    75 		 *	
       
    76 		 *	@param aNewOrder xSP view ids in new order
       
    77 		 *	@return error code
       
    78 		 */
       
    79     	static TInt Reorganize( const RArray<TxSPOrderUnit>& aNewOrder );
       
    80     	
       
    81     private:
       
    82     
       
    83     	/**
       
    84 		 *	Check and arrange xSP view order. Currently present extension
       
    85 		 *	data is compared to the data from the previous start. Newly
       
    86 		 *	installed extensions will go to the end of array.
       
    87 		 *	
       
    88 		 *	@param aViewIdMap array of view id mappings
       
    89 		 */
       
    90     	static void OrderCheckL( RPointerArray<CxSPViewInfo>& aViewIdMap );
       
    91     
       
    92     	/**
       
    93     	 * Creates a new private folder defined by given parametres
       
    94     	 *
       
    95     	 * @param aSession file session to be used
       
    96     	 * @param aPath path of the folder to be created
       
    97     	 * @param aDrive Drive number to which the folder is to be created
       
    98     	 */
       
    99     	static TInt CreatePrivateFolder( RFs& aSession, 
       
   100     									TDes& aPath, 
       
   101     									TDriveNumber aDrive );
       
   102     	
       
   103     	/**
       
   104 		 *	Makes new xSP view order. Currently present extension
       
   105 		 *	data is compared to the data from the previous start. Newly
       
   106 		 *	installed extensions will go to the end of array.
       
   107 		 *	
       
   108 		 *	@param aViewIdMap array of view id mappings
       
   109 		 *	@param aNewOrder array placeholder for new order
       
   110 		 */
       
   111     	static void MakeNewOrderL( RPointerArray<CxSPViewInfo>& aViewIdMap, 
       
   112     									RArray<TxSPOrderUnit>& aNewOrder );
       
   113     	    	
       
   114     	/**
       
   115 		 *	Rearrange xSP views
       
   116 		 *
       
   117 		 *	@param aViewIdMap array of view id mappings
       
   118 		 *	@param aNewOrder xSP view order
       
   119 		 */
       
   120     	static void RearrangeExtensionsL( RPointerArray<CxSPViewInfo>& aViewIdMap,
       
   121     									const RArray<TxSPOrderUnit>& aNewOrder );
       
   122     	
       
   123     	/**
       
   124 		 *	Write xSP view order to file
       
   125 		 *
       
   126 		 *	@param aNewOrder xSP view order
       
   127 		 */
       
   128     	static void WriteOrderL( const RArray<TxSPOrderUnit>& aNewOrder );
       
   129     								
       
   130     	/**
       
   131 		 *	Delete order file
       
   132 		 *
       
   133 		 *	@return error code
       
   134 		 */
       
   135     	static TInt DeleteOrderFile();
       
   136     };
       
   137 
       
   138 
       
   139 #endif // __XSPORDERORGANIZER_H__
       
   140 
       
   141 // End of File