|
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 |
|
18 #ifndef CCPIXNPPLUGINECOM_H |
|
19 #define CCPIXNPPLUGINECOM_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <CEcomBrowserPluginInterface.h> |
|
23 |
|
24 #ifdef __S60_50__ |
|
25 #include <npscript.h> |
|
26 #else |
|
27 #include <Javascriptcore/npruntime.h> |
|
28 #endif |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /****************************************** |
|
33 This class is specific to ECom Style Plugin. This is used for passing |
|
34 plugin specific initialization information to and from browser. |
|
35 *******************************************/ |
|
36 IMPORT_C NPError InitializeFuncs( NPPluginFuncs* aPpf ); |
|
37 |
|
38 // CONSTANTS |
|
39 const TInt KCPixNPPluginImplementationValue = 0x2001f6f9; // Matches implementation_uid in rss file |
|
40 |
|
41 /** |
|
42 * CPixNPPluginEcom |
|
43 * Used for passing plugin specific initialization information to and from browser. |
|
44 * @since S60 v3.2 |
|
45 */ |
|
46 class CCPixNPPluginEcom : public CEcomBrowserPluginInterface |
|
47 { |
|
48 public: // Functions from base classes |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 static CCPixNPPluginEcom* NewL( TAny* aInitParam ); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 */ |
|
58 virtual ~CCPixNPPluginEcom(); |
|
59 |
|
60 /** |
|
61 * Passed from the browser to the plugin and delcares what |
|
62 * functions the browser makes available |
|
63 */ |
|
64 NPNetscapeFuncs* Funcs() const { return iNpf; } |
|
65 |
|
66 private: |
|
67 |
|
68 // Default constructor |
|
69 CCPixNPPluginEcom( NPNetscapeFuncs* aNpf ); |
|
70 |
|
71 // By default Symbian 2nd phase constructor is private. |
|
72 void ConstructL( NPPluginFuncs* aPluginFuncs ); |
|
73 |
|
74 // Netscape Function Pointer |
|
75 NPNetscapeFuncs* iNpf; |
|
76 }; |
|
77 |
|
78 /** |
|
79 ******************************************************************************** |
|
80 Plugin API methods. Source located in CSystemInfoApi.cpp |
|
81 ********************************************************************************* |
|
82 */ |
|
83 |
|
84 /** |
|
85 * Create a plugin. |
|
86 */ |
|
87 |
|
88 NPError CPixPluginNewp( NPMIMEType pluginType, NPP instance, uint16 mode, |
|
89 CDesCArray* argn, CDesCArray* argv, NPSavedData* saved ); |
|
90 |
|
91 /** |
|
92 * Checks, whether it is ok to load the plugin. The page, which attempts |
|
93 * to load plugin should be originated in a secure domain, like *.nokia.com or |
|
94 * the local filesystem. |
|
95 */ |
|
96 TBool CPixPluginAcceptLoadAttempt( NPP instance ); |
|
97 /** |
|
98 * Wrapper the errors |
|
99 */ |
|
100 void CPixPluginConstructL( NPP aInstance, CDesCArray* argn, CDesCArray* argv ); |
|
101 |
|
102 /** |
|
103 * Destroy a plugin. |
|
104 */ |
|
105 NPError CPixPluginDestroy( NPP aInstance, NPSavedData** save ); |
|
106 |
|
107 /** |
|
108 * Generic hook to retrieve values/attributes from the plugin. |
|
109 */ |
|
110 NPError CPixPluginGetvalue( NPP aInstance, NPPVariable variable, void *ret_value ); |
|
111 |
|
112 |
|
113 #endif /*CCPIXNPPLUGINECOM_H*/ |
|
114 |
|
115 // End of File |