|
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 CNPSEARCHDOCUMENTINTERFACE_H_ |
|
18 #define CNPSEARCHDOCUMENTINTERFACE_H_ |
|
19 |
|
20 // INCLUDES |
|
21 #include "CObjectInterface.h" |
|
22 #include "INPSearchDocument.h" |
|
23 |
|
24 // CLASS DECLARATION |
|
25 |
|
26 /** |
|
27 * Provides the interface between browser and the actual functionality implemented |
|
28 * in CNPSearchDocument. Calls MNPSearchDocument methods of the implementing class |
|
29 * as a response to method invokation requests from the browser. |
|
30 */ |
|
31 class CNPSearchDocumentInterface : public CObjectInterface, public MNPSearchDocument |
|
32 { |
|
33 public: |
|
34 virtual ~CNPSearchDocumentInterface(); |
|
35 |
|
36 public: |
|
37 bool InvokeL( NPIdentifier name, NPVariant *args, uint32_t argCount, NPVariant *result ); |
|
38 bool GetProperty( NPIdentifier name, NPVariant *variant ); |
|
39 bool SetPropertyL( NPIdentifier name, NPVariant *variant ); |
|
40 |
|
41 protected: |
|
42 void InitInterfaceL(); |
|
43 }; |
|
44 |
|
45 |
|
46 /** |
|
47 ******************************************************************************** |
|
48 NPSearchDocumentObject Plugin API methods |
|
49 ********************************************************************************* |
|
50 */ |
|
51 struct NPSearchDocumentObject |
|
52 { |
|
53 NPObject object; |
|
54 CNPSearchDocumentInterface *plugin; |
|
55 }; |
|
56 |
|
57 NPObject* NPSearchDocumentAllocate(); |
|
58 |
|
59 void NPSearchDocumentInvalidate(); |
|
60 |
|
61 void NPSearchDocumentDeallocate( NPSearchDocumentObject *obj ); |
|
62 |
|
63 bool NPSearchDocumentHasMethod( NPSearchDocumentObject *obj, NPIdentifier name ); |
|
64 |
|
65 bool NPSearchDocumentInvokeFunctionL( NPSearchDocumentObject* obj, NPIdentifier name, |
|
66 NPVariant *args, uint32_t argCount, NPVariant *result ); |
|
67 |
|
68 bool NPSearchDocumentHasProperty( NPSearchDocumentObject *obj, NPIdentifier name ); |
|
69 |
|
70 bool NPSearchDocumentGetProperty ( NPSearchDocumentObject *obj, NPIdentifier name, |
|
71 NPVariant *variant); |
|
72 |
|
73 void NPSearchDocumentSetProperty( NPSearchDocumentObject *obj, NPIdentifier name, |
|
74 NPVariant *variant); |
|
75 |
|
76 static NPClass _NPSearchDocumentClass = |
|
77 { |
|
78 0, |
|
79 (NPAllocateFunctionPtr) NPSearchDocumentAllocate, |
|
80 (NPDeallocateFunctionPtr) NPSearchDocumentDeallocate, |
|
81 (NPInvalidateFunctionPtr) NPSearchDocumentInvalidate, |
|
82 (NPHasMethodFunctionPtr) NPSearchDocumentHasMethod, |
|
83 (NPInvokeFunctionPtr) NPSearchDocumentInvokeFunctionL, |
|
84 (NPInvokeDefaultFunctionPtr) 0, |
|
85 (NPHasPropertyFunctionPtr) NPSearchDocumentHasProperty, |
|
86 (NPGetPropertyFunctionPtr) NPSearchDocumentGetProperty, |
|
87 (NPSetPropertyFunctionPtr) NPSearchDocumentSetProperty, |
|
88 (NPRemovePropertyFunctionPtr) 0 |
|
89 }; |
|
90 |
|
91 /** |
|
92 * static instance of the function pointer table |
|
93 */ |
|
94 static NPClass* NPSearchDocumentClass = &_NPSearchDocumentClass; |
|
95 |
|
96 #endif /*CNPSEARCHDOCUMENTINTERFACE_H_*/ |