searchui/searchapp/plugins/inc/srchuiserviceplugin.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2006-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:      interface class for search plugins
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef C_SRCHUISERVICEPLUGIN_H
       
    24 #define C_SRCHUISERVICEPLUGIN_H
       
    25 
       
    26 //System Includes
       
    27 #include <e32base.h>
       
    28 #include <ecom/ecom.h>
       
    29 
       
    30 //Forward Declarations
       
    31 class CFbsBitmap;
       
    32 class MSrchUiCustomService;
       
    33 
       
    34 /**
       
    35  *  
       
    36  */
       
    37 class CSrchUiServicePlugin : public CBase
       
    38     {
       
    39 
       
    40 public: // Enumerations
       
    41 
       
    42     /**
       
    43     * Plugin provider
       
    44     **/
       
    45     enum TSrchUiServicePluginProvider
       
    46         {
       
    47         ESrchUiServicePluginProviderOEM        = 1,
       
    48         ESrchUiServicePluginProviderOperator   = 2,
       
    49         ESrchUiServicePluginProvider3rdParty   = 3
       
    50         };
       
    51 
       
    52 public: // Constructors and destructor
       
    53 
       
    54     /**
       
    55     * Ecom interface static factory method implementation.
       
    56     *
       
    57     * @param aImpUid Ecom's implementation uid
       
    58     * @return A pointer to the created instance of CSrchUiServicePlugin
       
    59     */
       
    60     static inline CSrchUiServicePlugin* NewL( TUid aImpUid /*, CAknAppUi* aAppUi */);
       
    61     
       
    62     /**
       
    63     * Ecom interface static factory method implementation.
       
    64     *
       
    65     * @param aImpUid Ecom's implementation uid
       
    66     * @return A pointer to the created instance of CSrchUiServicePlugin
       
    67     */
       
    68     static inline CSrchUiServicePlugin* NewLC( TUid aImpUid /*, CAknAppUi* aAppUi */);
       
    69     
       
    70     /**
       
    71     * Destructor
       
    72     */
       
    73     virtual ~CSrchUiServicePlugin()
       
    74     {
       
    75       REComSession::DestroyedImplementation( iDtor_ID_Key );
       
    76     // REComSession::Close();
       
    77     }
       
    78     
       
    79 public: // New functions
       
    80 
       
    81     /**
       
    82     * Lists all implementations which satisfy this ecom interface.
       
    83     *
       
    84     * @param aImplInfoArray On return, contains the list of available implementations
       
    85     */
       
    86     static inline void ListAllImplementationsL( RImplInfoPtrArray& aImplInfoArray );
       
    87 
       
    88     /**
       
    89     * Gets the plugin id.
       
    90     *
       
    91     * @return Id of the plugin.
       
    92     */   
       
    93     inline TUid PluginId() const;
       
    94     
       
    95     /**
       
    96     * Gets the service id.
       
    97     *
       
    98     * @return Id of the service.
       
    99     */   
       
   100     virtual TUid ServiceId() = 0;    
       
   101    
       
   102     /**
       
   103     * Gets the primary caption of the service.
       
   104     *
       
   105     * @return Primary caption.
       
   106     */      
       
   107     virtual const TDesC& PrimaryCaptionL() = 0;
       
   108 
       
   109     /**
       
   110     * Gets the secondary caption of the service.
       
   111     *
       
   112     * @return Primary caption.
       
   113     */      
       
   114     virtual const TDesC& SecondaryCaptionL() = 0;
       
   115     
       
   116     /**
       
   117     * Gets the service icon. Ownership transferres to the caller.
       
   118     *
       
   119     * @return Service icon.
       
   120     */      
       
   121     virtual CFbsBitmap* ServiceIconL() = 0;
       
   122     
       
   123     /**
       
   124     * Gets the service icon mask. Ownership transferres to the caller.
       
   125     *
       
   126     * @return Service icon mask. NULL if mask is not supported.
       
   127     */  
       
   128     virtual CFbsBitmap* ServiceIconMaskL() = 0;
       
   129     
       
   130     /**
       
   131     * Gets the branding parameters for the find box. Ownership transferres to the
       
   132     * caller.
       
   133     *
       
   134     * @return Find box parameters.
       
   135     */  
       
   136     //virtual CSrchUiFindBoxParams* FindBoxParamsL() = 0;
       
   137 
       
   138     /**
       
   139     * Checks if the service plugin should be visible in the Search UI.
       
   140     *
       
   141     * @return ETrue if plugin should be visible, EFalse otherwise.
       
   142     */
       
   143     virtual TBool IsVisible() = 0;    
       
   144     
       
   145     /**
       
   146     * Gets the custom service.
       
   147     *
       
   148     * @return Custom service.
       
   149     */  
       
   150     virtual MSrchUiCustomService* CustomServiceL() = 0;
       
   151 
       
   152     /**
       
   153     * Get the plugin provider. PluginProviderCategory can be used for
       
   154     * sorting plugins.
       
   155     *
       
   156     * @return Plugin provider.
       
   157     */
       
   158     virtual TSrchUiServicePluginProvider PluginProvider() = 0;    
       
   159 
       
   160     /**
       
   161     * Returns the extension for this interface. If no extension is available, return NULL.
       
   162     *
       
   163     * @param aExtensionUid Uid of the extension.
       
   164     */ 
       
   165     virtual TAny* ServicePluginExtensionL( TUid /*aExtension*/ )  { return NULL; };
       
   166     
       
   167     //static TUid iDtor_ID_Key;
       
   168 
       
   169 protected:
       
   170     CSrchUiServicePlugin::TSrchUiServicePluginProvider  iProvider;    
       
   171     
       
   172 private:  // Data
       
   173 
       
   174     
       
   175     TUid iPluginId;
       
   176     TUid iDtor_ID_Key;
       
   177     TInt32 iExtension1;
       
   178     TInt32 iExtension2;  
       
   179     };
       
   180     
       
   181     
       
   182 #include "srchuiserviceplugin.inl"
       
   183 
       
   184 #endif // C_SRCHUISERVICEPLUGIN_H