browserplugin/cpixnpplugin/inc/ccpixnpsearcherinterface.h
changeset 0 ccd0fd43f247
equal deleted inserted replaced
-1:000000000000 0:ccd0fd43f247
       
     1 /*
       
     2 * Copyright (c) 2010 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: 
       
    15 *
       
    16 */
       
    17 #ifndef CCPIXNPSEARCHERINTERFACE_H_
       
    18 #define CCPIXNPSEARCHERINTERFACE_H_
       
    19 
       
    20 //  INCLUDES
       
    21 #include "CObjectInterface.h"
       
    22 #include "ICPixNPSearcher.h"
       
    23 
       
    24 // CLASS DECLARATION
       
    25 
       
    26 /**
       
    27  * CCPixNPSearcherInterface
       
    28  * Provides the interface between browser and the actual functionality implemented 
       
    29  * in CCPixNPSearcher. Calls MCPixNPSearcher methods of the implementing class
       
    30  * as a response to method invokation requests from the browser.
       
    31  */
       
    32 class CCPixNPSearcherInterface : public CObjectInterface, public MCPixNPSearcher
       
    33     {
       
    34  public:
       
    35     virtual ~CCPixNPSearcherInterface();
       
    36 
       
    37  public:
       
    38     bool InvokeL( NPIdentifier name, NPVariant *args, uint32_t argCount, NPVariant *result );
       
    39     bool GetProperty( NPIdentifier name, NPVariant *variant );
       
    40     bool SetPropertyL( NPIdentifier name, NPVariant *variant );
       
    41     
       
    42     virtual void Invalidate() = 0; 
       
    43     
       
    44  protected:
       
    45 	void InitInterfaceL();
       
    46     };
       
    47 
       
    48     
       
    49 /**
       
    50  ********************************************************************************
       
    51      CPixNPSearcherObject Plugin API methods
       
    52  *********************************************************************************
       
    53  */
       
    54  typedef struct
       
    55      {
       
    56      NPObject object;
       
    57      CCPixNPSearcherInterface *plugin;
       
    58      } CPixNPSearcherObject;
       
    59 
       
    60  NPObject* CPixNPSearcherAllocate();
       
    61 
       
    62  void CPixNPSearcherInvalidate( CPixNPSearcherObject *obj );
       
    63 
       
    64  void CPixNPSearcherDeallocate( CPixNPSearcherObject *obj );
       
    65 
       
    66  bool CPixNPSearcherHasMethod( CPixNPSearcherObject *obj, NPIdentifier name );
       
    67 
       
    68  bool CPixNPSearcherInvokeFunctionL( CPixNPSearcherObject* obj, NPIdentifier name,
       
    69                                       NPVariant *args, uint32_t argCount, NPVariant *result );
       
    70 
       
    71  bool CPixNPSearcherHasProperty( CPixNPSearcherObject *obj, NPIdentifier name );
       
    72 
       
    73  bool CPixNPSearcherGetProperty ( CPixNPSearcherObject *obj, NPIdentifier name,
       
    74                                     NPVariant *variant);
       
    75 
       
    76  void CPixNPSearcherSetProperty( CPixNPSearcherObject *obj, NPIdentifier name,
       
    77                                    NPVariant *variant);
       
    78 
       
    79  static NPClass _CPixNPSearcherClass =
       
    80      {
       
    81      0,
       
    82      (NPAllocateFunctionPtr) CPixNPSearcherAllocate,
       
    83      (NPDeallocateFunctionPtr) CPixNPSearcherDeallocate,
       
    84      (NPInvalidateFunctionPtr) CPixNPSearcherInvalidate,
       
    85      (NPHasMethodFunctionPtr) CPixNPSearcherHasMethod,
       
    86      (NPInvokeFunctionPtr) CPixNPSearcherInvokeFunctionL,
       
    87      (NPInvokeDefaultFunctionPtr) 0,
       
    88      (NPHasPropertyFunctionPtr) CPixNPSearcherHasProperty,
       
    89      (NPGetPropertyFunctionPtr) CPixNPSearcherGetProperty,
       
    90      (NPSetPropertyFunctionPtr) CPixNPSearcherSetProperty,
       
    91      (NPRemovePropertyFunctionPtr) 0
       
    92      };
       
    93 
       
    94  /**
       
    95   * static instance of the function pointer table
       
    96   */
       
    97  static NPClass* CPixNPSearcherClass = &_CPixNPSearcherClass;
       
    98 
       
    99 #endif /*CCPIXNPSEARCHERINTERFACE_H_*/