idlefw/inc/framework/aipluginfactory.h
changeset 0 79c6a41cd166
child 8 d0529222e3f0
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Content plugin manager class for Active idle framework.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_AIPLUGINASYNCFACTORY_H
       
    21 #define C_AIPLUGINASYNCFACTORY_H
       
    22 
       
    23 #include "aicontentpublisher.h"
       
    24 #include "aipropertyextension.h"
       
    25 #include "aifwdefs.h"
       
    26 #include <e32base.h>
       
    27 
       
    28 class MAiContentObserver;
       
    29 class MAiEventHandlerExtension;
       
    30 class MAiContentItemIterator;
       
    31 class CAiContentPublisher;
       
    32 class CAiUiController;
       
    33 class CAiPluginActivityRegistry;
       
    34 class CImplementationInformation;
       
    35 class CAiContentPluginManager;
       
    36 class MAiPluginTool;
       
    37 class MAiPluginLifecycleObserver;
       
    38 
       
    39 /**
       
    40  * @ingroup group_aifw
       
    41  * 
       
    42  *  Content plugin factory class for Active idle framework.
       
    43  *
       
    44  *  @lib aifw
       
    45  *  @since S60 3.2
       
    46  */
       
    47 NONSHARABLE_CLASS( CAiPluginFactory ) : public CBase
       
    48 	{
       
    49 	public:
       
    50 	
       
    51 // Constructor and destructor
       
    52 		
       
    53 		static CAiPluginFactory* NewL( RPointerArray<CAiContentPublisher>& aPlugins,
       
    54 		                                    CAiContentPluginManager& aManager );
       
    55 		
       
    56 		virtual ~CAiPluginFactory();
       
    57 
       
    58 // New functions
       
    59 		
       
    60         /**
       
    61          * Create plugin
       
    62          *
       
    63          * @since S60 5.0
       
    64          * @param aPublisherInfo plugin to load.
       
    65          * @param aControllerArray array of active UI controllers.
       
    66          */
       
    67 		void CreatePluginL( const TAiPublisherInfo& aPublisherInfo,						
       
    68 						     RPointerArray<CAiUiController>& aControllerArray );						
       
    69 
       
    70         /**
       
    71          * Destroy plugin
       
    72          *
       
    73          * @since S60 5.0
       
    74          * @param aPublisherInfo plugin to destroy.
       
    75          * @param aControllerArray array of active UI controllers.
       
    76          */
       
    77 		void DestroyPluginL( const TAiPublisherInfo& aPublisherInfo,		    
       
    78                              RPointerArray<CAiUiController>& aControllerArray );
       
    79 
       
    80         /**
       
    81          * Destroys all plugins
       
    82          * 
       
    83          * @since S60 5.0         
       
    84          */
       
    85 		void DestroyPlugins();
       
    86 		
       
    87 		
       
    88         void AddLifecycleObserverL( MAiPluginLifecycleObserver& aObserver );
       
    89 
       
    90         /**
       
    91          * Finds plugin by publisher info.
       
    92          *
       
    93          * @since S60 5.0
       
    94          * @param aInfo publisher info.
       
    95          * @return Pointer to plugin, NULL if not found.
       
    96          */        
       
    97         CAiContentPublisher* PluginByInfoL( const TAiPublisherInfo& aInfo ) const;
       
    98 
       
    99         /**
       
   100          * Finds plugin by name.
       
   101          *
       
   102          * @since S60 5.0
       
   103          * @param aInfo publisher info.
       
   104          * @return Pointer to plugin, NULL if not found.
       
   105          */                
       
   106         CAiContentPublisher* PluginByNameL( const TDesC& aName ) const;
       
   107 						
       
   108 	private:	
       
   109 
       
   110 // Constructors
       
   111 		
       
   112 		CAiPluginFactory( RPointerArray<CAiContentPublisher>& aPlugins,
       
   113 		                       CAiContentPluginManager& aManager );
       
   114 		
       
   115 		void ConstructL();
       
   116 										
       
   117 // New functions
       
   118 		
       
   119 		CAiContentPublisher* CreatePluginLC( const TAiPublisherInfo& aPluginInfo );
       
   120 								
       
   121 		void SubscribeContentObserversL( CAiContentPublisher& aContentPublisher,		    
       
   122             const TAiPublisherInfo& aPublisherInfo,
       
   123 		    RPointerArray<CAiUiController>& aControllerArray );
       
   124 		                              
       
   125         void ConfigurePluginL( RPointerArray<CAiUiController>& aControllerArray,
       
   126                                CAiContentPublisher& aContentPublisher,
       
   127                                const TAiPublisherInfo& aPubInfo );		                           
       
   128         
       
   129 	private:     // Data	
       
   130 	    // Array of loaded data plugins, Not owned
       
   131 	    RPointerArray<CAiContentPublisher>& iPlugins;
       
   132 	    // Content plugin manager, Not owned	    		
       
   133         CAiContentPluginManager& iManager;
       
   134         // Ecom implementation info, Owned
       
   135 		RImplInfoPtrArray iEComPlugins;		
       
   136 		// Plugin tool from utility lib, Owned
       
   137 		MAiPluginTool* iPluginTool;      
       
   138         // Life cycle observers, Owned
       
   139 		RPointerArray<MAiPluginLifecycleObserver> iLifecycleObservers;		
       
   140     };
       
   141 
       
   142 #endif // C_AIPLUGINASYNCFACTORY_H
       
   143 
       
   144 // End of File.