omads/omadsappui/AspSyncUtil/inc/AspPreSyncPluginInterface.h
branchRCL_3
changeset 25 4f0867e42d62
equal deleted inserted replaced
24:8e7494275d3a 25:4f0867e42d62
       
     1 /*
       
     2 * Copyright (c) 2007 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: Roaming warning plugin interface implementation 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef ASPPRESYNCPLUGININTERFACE_H
       
    19 #define ASPPRESYNCPLUGININTERFACE_H
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <s32mem.h>
       
    23 #include <coemain.h>
       
    24 #include <ecom/ecom.h>
       
    25 #include <ecom/implementationinformation.h>
       
    26 #include <SyncMLDef.h>
       
    27 
       
    28 class CPreSyncPlugin;
       
    29 
       
    30 /**
       
    31 * Class is used to instantiate the required plugins when the search has been
       
    32 * asked. Acts as interface to all Plugins.
       
    33 */
       
    34 
       
    35 class CPreSyncPluginInterface: public CBase 
       
    36 {
       
    37 	public:
       
    38 
       
    39 		/** 
       
    40 		* Symbian OS 2 phased constructor.
       
    41 		* @return	A pointer to the created instance of CPreSyncPluginInterface.
       
    42 		*/
       
    43 		static CPreSyncPluginInterface* NewL();
       
    44 
       
    45 		/** 
       
    46 		* Symbian OS 2 phased constructor.
       
    47 		* @return	A pointer to the created instance of CPreSyncPluginInterface.
       
    48 		*/
       
    49 		static CPreSyncPluginInterface* NewLC();
       
    50 
       
    51 		/**
       
    52 		* Destructor.
       
    53 		*/      
       
    54 		virtual ~CPreSyncPluginInterface();
       
    55 
       
    56 		/**
       
    57 		* Instantiates the required search plug-ins known by the ecom framework.
       
    58 		* basically this function first calls ListAllImplementationsL()
       
    59 		* and then checks them one by one to match the algorithm name
       
    60 		*/
       
    61 		void InstantiatePluginL();
       
    62 		
       
    63 		CPreSyncPlugin* InstantiateRoamingPluginLC( TSmlProfileId aProfileId );
       
    64 
       
    65 		/**
       
    66 		* Unloads all plugins
       
    67 		* This should internally call  REComSession::DestroyedImplementation( iDtor_ID_Key )
       
    68 		* and then REComSession::FinalClose()
       
    69 		*/
       
    70 		void UnloadPlugIns(); 
       
    71 
       
    72 		/**
       
    73 		* Lists all implementations which satisfy this ecom interface
       
    74 		*
       
    75 		* @param aImplInfoArray On return, contains the list of available implementations
       
    76 		* 
       
    77 		*/   
       
    78 		void ListAllImplementationsL( RImplInfoPtrArray& aImplInfoArray );
       
    79 		
       
    80 
       
    81 		/**
       
    82 		* Forwards the request to check if language is supported
       
    83 		* to the algorithm instance
       
    84 		*/
       
    85 		TBool IsDefault();   
       
    86 		              
       
    87 		/**
       
    88 		* Forwards the request to recover data fields order for a URI
       
    89 		* to the algorithm instance
       
    90 		*/
       
    91 		TBool IsProfileYours(TSmlProfileId aProfileId);
       
    92 
       
    93 		/**
       
    94 		* Forwards the request to recover sort order for a URI
       
    95 		* to the algorithm instance
       
    96 		*/
       
    97 		void Handle(TSmlProfileId aProfileId); 
       
    98 
       
    99 	private: 
       
   100 
       
   101 		/** 
       
   102 		* Performs the first phase of two phase construction.
       
   103 		*/
       
   104 		CPreSyncPluginInterface();  
       
   105 
       
   106 		/** 
       
   107 		* Symbian OS 2 phased constructor.
       
   108 		*/
       
   109 		void ConstructL();
       
   110 
       
   111 		/**
       
   112 		* Instantiates a PCS plug-in, knowing the implementation uid.
       
   113 		* @param aImpUid imp uID
       
   114 		*/
       
   115 		CPreSyncPlugin* InstantiatePlugInFromImpUidL( const TUid& aImpUid );
       
   116 
       
   117 
       
   118 	private: 
       
   119 
       
   120 	    /** iDtor_ID_Key Instance identifier key. When instance of an
       
   121 	         *               implementation is created by ECOM framework, the
       
   122 	         *               framework will assign UID for it. The UID is used in
       
   123 	         *               destructor to notify framework that this instance is
       
   124 	         *               being destroyed and resources can be released.
       
   125 	         */
       
   126 	    TUid iDtor_ID_Key;
       
   127 
       
   128 		// List of plugins that this interface will interact with
       
   129 		RPointerArray<CPreSyncPlugin>  iPluginInstances; 
       
   130 
       
   131 		// Uid of the algorithm in use
       
   132 		TUid iPluginInUse;
       
   133 };
       
   134 
       
   135 #endif // ASPPRESYNCPLUGININTERFACE_H
       
   136 
       
   137 //End of File