contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/cpluginvalidator.h
branchRCL_3
changeset 31 8baec10861af
parent 0 79c6a41cd166
equal deleted inserted replaced
30:a5a39a295112 31:8baec10861af
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  
    14 * Description:
    15  *
    15  *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #ifndef CPLUGINVALIDATOR_H
    19 #ifndef CPLUGINVALIDATOR_H
    28 class REComSession;
    28 class REComSession;
    29 
    29 
    30 /**
    30 /**
    31  *  Class containing information regarding a plugin
    31  *  Class containing information regarding a plugin
    32  *
    32  *
    33  * 
    33  *
    34  *  @lib cpclient.dll
    34  *  @lib cpclient.dll
    35  *  @since S60 v 5.0
    35  *  @since S60 v 5.0
    36  */
    36  */
    37 NONSHARABLE_CLASS( TPluginInfo )
    37 NONSHARABLE_CLASS( TPluginInfo )
    38 	{
    38     {
    39 public:
    39 public:
    40 	TAny* iPlugin; // not own
    40     TAny* iPlugin; // not own
    41 	TUid iImplementationUid;
    41     TUid iImplementationUid;
    42 	TInt iVersion;
    42     TInt iVersion;
    43 	TUid iDtor_ID_Key;
    43     TUid iDtor_ID_Key;
    44 	};
    44     };
    45 
    45 
    46 /**
    46 /**
    47  *  Class used to maintain required ECOM plugins implementations
    47  *  Class used to maintain required ECOM plugins implementations
    48  *
    48  *
    49  * 
    49  *
    50  *  @lib cpclient.dll
    50  *  @lib cpclient.dll
    51  *  @since S60 v 5.0
    51  *  @since S60 v 5.0
    52  */
    52  */
    53 NONSHARABLE_CLASS( CPluginValidator ): public CActive
    53 NONSHARABLE_CLASS( CPluginValidator ): public CActive
    54     {
    54     {
    55 public:
    55 public:
    56 
    56 
    57     /**
    57     /**
    58      * Two-phased constructor.
    58      * Two-phased constructor.
    59      * 
    59      *
    60      */     
    60      */
    61     IMPORT_C static CPluginValidator* NewL( TUid aUid, 
    61     IMPORT_C static CPluginValidator* NewL( TUid aUid,
    62                                             TAny *aParameter = NULL );
    62                                             TAny *aParameter = NULL );
    63 
    63 
    64     /**
    64     /**
    65      * Two-phased constructor.
    65      * Two-phased constructor.
    66      * 
    66      *
    67      */     
    67      */
    68     IMPORT_C static CPluginValidator* NewLC( TUid aUid,
    68     IMPORT_C static CPluginValidator* NewLC( TUid aUid,
    69                                              TAny *aParameter = NULL );
    69                                              TAny *aParameter = NULL );
    70 
    70 
    71     /**
    71     /**
    72      * Gets plugin with provided UID
    72      * Gets plugin with provided UID
    73      *
    73      *
    74      * @param aUid required plugin
    74      * @param aUid required plugin
    75      * @return pointer to plugin implementation
    75      * @return pointer to plugin implementation
    76      */   
    76      */
    77     IMPORT_C TAny* GetImplementation( TUid aUid );
    77     IMPORT_C TAny* GetImplementation( TUid aUid );
    78 
    78 
    79     /**
    79     /**
    80      * Gets plugin with provided index
    80      * Gets plugin with provided index
    81      *
    81      *
    82      * @param aIndex index of plugin
    82      * @param aIndex index of plugin
    83      * @return pointer to plugin implementation
    83      * @return pointer to plugin implementation
    84      */   
    84      */
    85     IMPORT_C TAny* GetImplementation( TInt aIndex );
    85     IMPORT_C TAny* GetImplementation( TInt aIndex );
    86     
    86 
    87     /**
    87     /**
    88      * Gets number of plugins
    88      * Gets number of plugins
    89      *
    89      *
    90      * @return number of plugins
    90      * @return number of plugins
    91      */    
    91      */
    92     IMPORT_C TInt GetCount();
    92     IMPORT_C TInt GetCount();
    93     
    93 
    94     /**
    94     /**
    95      * Desctructor.
    95      * Desctructor.
    96      */     
    96      */
    97     virtual ~CPluginValidator();
    97     virtual ~CPluginValidator();
    98 
    98 
    99 protected:
    99 protected:
   100 
   100 
   101     /**
   101     /**
   118 
   118 
   119 protected:
   119 protected:
   120 
   120 
   121     /**
   121     /**
   122      * C++ default constructor.
   122      * C++ default constructor.
   123      */    
   123      */
   124     CPluginValidator( TUid aUid, TAny *aParameter );
   124     CPluginValidator( TUid aUid, TAny *aParameter );
   125 
   125 
   126     /**
   126     /**
   127      * Perform the second phase construction of a CPluginValidator object.
   127      * Perform the second phase construction of a CPluginValidator object.
   128      */    
   128      */
   129     void ConstructL();
   129     void ConstructL();
   130     
   130 
   131     /*
   131     /*
   132      * Checks if plugin is present in an array
   132      * Checks if plugin is present in an array
   133      */
   133      */
   134     TBool PresentInArrayL( TPluginInfo aPluginInfo, 
   134     TBool PresentInArrayL( TPluginInfo aPluginInfo,
   135     		const RImplInfoPtrArray& aInfoArray );
   135         const RImplInfoPtrArray& aInfoArray );
   136 
   136 
   137     /*
   137     /*
   138      * 
   138      *
   139      */
   139      */
   140     void DestroyPlugin( TInt aIndex );    
   140     void DestroyPlugin( TInt aIndex );
   141     
   141 
   142     /**
   142     /**
   143      * Cleans plugins table;
   143      * Cleans plugins table;
   144      */    
   144      */
   145     void CleanPluginsTable();
   145     void CleanPluginsTable();
   146     
   146 
   147     /**
   147     /**
   148      * Loads or destroys plugins
   148      * Loads or destroys plugins
   149      */    
   149      */
   150     virtual void ManagePluginsL();    
   150     virtual void ManagePluginsL();
   151 
   151 
   152     /**
   152     /**
   153      * Loads ECOM plugins
   153      * Loads ECOM plugins
   154      */    
   154      */
   155     virtual void LoadPluginL( TPluginInfo& aPluginInfo );    
   155     virtual void LoadPluginL( TPluginInfo& aPluginInfo );
   156     
   156 
   157 protected:
   157 protected:
   158     
   158 
   159     /**
   159     /**
   160      * ECOM handler
   160      * ECOM handler
   161      * Own.
   161      * Own.
   162      */
   162      */
   163     REComSession* iSession;
   163     REComSession* iSession;
   164     
   164 
   165     /**
   165     /**
   166      * Array containing plugins
   166      * Array containing plugins
   167      * Own.
   167      * Own.
   168      */
   168      */
   169     RArray<TPluginInfo> iPluginArray;
   169     RArray<TPluginInfo> iPluginArray;
   170     
   170 
   171     /**
   171     /**
   172      * UID of the interface
   172      * UID of the interface
   173      */
   173      */
   174     const TUid iUid;
   174     const TUid iUid;
   175         
   175 
   176     /**
   176     /**
   177      * Parameter to pass to the object creation method.
   177      * Parameter to pass to the object creation method.
   178      */
   178      */
   179     TAny* iParameter;
   179     TAny* iParameter;
   180      };
   180      };