messagingapp/msgappfw/server/inc/ccsplugininterface.h
changeset 23 238255e8b033
equal deleted inserted replaced
5:4697dfb2d7ad 23:238255e8b033
       
     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:  This defines the interface for E-com plugins
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __C_CS_PLUGIN_INTERFACE_H
       
    19 #define __C_CS_PLUGIN_INTERFACE_H
       
    20 
       
    21 // SYSTEM INCLUDE FILES
       
    22 
       
    23 // USER INCLUDES
       
    24 
       
    25 // FORWARD DECLARATION	
       
    26 class CCsPlugin;
       
    27 class CCsServer;
       
    28 // CLASS DECLARATION
       
    29 /**
       
    30 * Class is used to instantiate the required plugins when the 
       
    31 * conversation deatils has been asked. 
       
    32 * Acts as interface to all Plugins.
       
    33 */
       
    34 
       
    35 class CCsPluginInterface: public CBase 
       
    36 {
       
    37 	public:
       
    38 
       
    39 		/** 
       
    40 		* NewL
       
    41 		* Symbian OS 2 phased constructor
       
    42 		* 
       
    43 		* @return	A pointer to the created instance of CCsPluginInterface.
       
    44 		*/
       
    45 		static CCsPluginInterface* NewL();
       
    46 
       
    47 		/** 
       
    48 		* NewLC
       
    49 		* Symbian OS 2 phased constructor
       
    50 		* 
       
    51 		* @return	A pointer to the created instance of CCsPluginInterface.
       
    52 		*/
       
    53 		static CCsPluginInterface* NewLC();
       
    54 
       
    55 		/**
       
    56 		* Destructor.
       
    57 		*/      
       
    58 		virtual ~CCsPluginInterface();
       
    59 
       
    60 		/**
       
    61 		* InstantiatePluginL
       
    62 		* Instantiates the required plug-ins known by the ecom framework.
       
    63 		* basically this function first calls ListAllImplementationsL()
       
    64 		* 
       
    65 		* @param aCsServer server instance
       
    66 		*/
       
    67 		void InstantiatePluginL(CCsServer* aCsServer);
       
    68 
       
    69 		/**
       
    70 		* UnloadPlugIns
       
    71 		* Unloads all plugins
       
    72 		* This should internally call  REComSession::DestroyedImplementation( iDtor_ID_Key )
       
    73 		* and then REComSession::FinalClose()
       
    74 		*/
       
    75 		void UnloadPlugIns(); 
       
    76 
       
    77 		/**
       
    78 		* ListAllImplementationsL
       
    79 		* Lists all implementations which satisfy this ecom interface
       
    80 		* 
       
    81 		* @param aImplInfoArray On return, contains the list of available implementations
       
    82 		*/   
       
    83 		inline void ListAllImplementationsL( 
       
    84 		        RImplInfoPtrArray& aImplInfoArray )
       
    85 		    {
       
    86 		    REComSession::ListImplementationsL( 
       
    87 		            KCsPluginInterfaceUid, 
       
    88 		            aImplInfoArray );
       
    89 		    }
       
    90 		
       
    91 		/**
       
    92 		 * GetConversationsL
       
    93 		 * Forwards the request to the plugin instance ,
       
    94 		 * to get the all conversations from the plugins
       
    95 		 */
       
    96 		void  GetConversationsL();
       
    97 
       
    98 		/**
       
    99 		 * GetPluginsCount
       
   100 		 * Gets the  plugins count
       
   101 		 * 
       
   102 		 * @return  Plugin count
       
   103 		 */
       
   104 		TInt  GetPluginsCount();
       
   105 
       
   106 	private: 
       
   107 
       
   108 	  /** 
       
   109 	   * Performs the first phase of two phase construction.
       
   110 	   */
       
   111 	  CCsPluginInterface();  
       
   112 
       
   113 		/** 
       
   114 		* Symbian OS 2 phased constructor.
       
   115 		*/
       
   116 		void ConstructL();
       
   117 
       
   118 		/**
       
   119 		* InstantiatePlugInFromImpUidL
       
   120 		* Instantiates a CS plug-in, knowing the implementation uid
       
   121 		* 
       
   122 		* @param aImpUid imp uID
       
   123 		* @param aCsServer, instance of server class
       
   124 		*/
       
   125 		CCsPlugin* InstantiatePlugInFromImpUidL( 
       
   126 		        const TUid& aImpUid, 
       
   127 		        CCsServer* aCsServer );
       
   128 
       
   129 
       
   130 	private: 
       
   131 	    
       
   132 	    /**
       
   133 	     * iDtor_ID_Key
       
   134 	     * Unique Key, handle by ECom plugin
       
   135 	     */
       
   136 	    TUid iDtor_ID_Key;
       
   137 
       
   138 		/**
       
   139 		 * iCsPluginInstances
       
   140 		 * Array of all the plugin instances
       
   141 		 */
       
   142 		RPointerArray<CCsPlugin>  iCsPluginInstances; 
       
   143 
       
   144 		/**
       
   145 		 * iPluginInUse
       
   146 		 * Uid of the plugin in use.
       
   147 		 */
       
   148 		TUid iPluginInUse;
       
   149 };
       
   150 
       
   151 #endif // __C_CS_PLUGIN_INTERFACE_H
       
   152 
       
   153 //End of File