|
1 /* |
|
2 * Copyright (c) 2006 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 the License "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 to Browser |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <implementationproxy.h> |
|
22 #include <CEcomBrowserPluginInterface.h> |
|
23 #include "SystemInfoPlugin.h" |
|
24 |
|
25 |
|
26 /***************************************************/ |
|
27 /**********ECOM STYLE SystemInfo PLUGIN ENTRY POINTS******/ |
|
28 /***************************************************/ |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CSystemInfoPluginEcomMain::NewL |
|
32 // ----------------------------------------------------------------------------- |
|
33 CSystemInfoPluginEcomMain* CSystemInfoPluginEcomMain::NewL( TAny* aInitParam ) |
|
34 { |
|
35 TFuncs* funcs = REINTERPRET_CAST( TFuncs*, aInitParam ); |
|
36 CSystemInfoPluginEcomMain* self = new (ELeave) CSystemInfoPluginEcomMain( funcs->iNetscapeFuncs ); |
|
37 CleanupStack::PushL( self ); |
|
38 self->ConstructL( funcs->iPluginFuncs ); |
|
39 CleanupStack::Pop( self ); |
|
40 |
|
41 Dll::SetTls ( (void*) self ); |
|
42 |
|
43 return self; |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CSystemInfoPluginEcomMain::ConstructL |
|
48 // ----------------------------------------------------------------------------- |
|
49 void CSystemInfoPluginEcomMain::ConstructL( NPPluginFuncs* aPluginFuncs ) |
|
50 { |
|
51 InitializeFuncs( aPluginFuncs ); |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CSystemInfoPluginEcomMain::CSystemInfoPluginEcomMain |
|
56 // ----------------------------------------------------------------------------- |
|
57 CSystemInfoPluginEcomMain::CSystemInfoPluginEcomMain( NPNetscapeFuncs* aNpf ) |
|
58 : CEcomBrowserPluginInterface(), |
|
59 iNpf( aNpf ) |
|
60 { |
|
61 } |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // CSystemInfoPluginEcomMain::~CSystemInfoPluginEcomMain |
|
65 // ----------------------------------------------------------------------------- |
|
66 CSystemInfoPluginEcomMain::~CSystemInfoPluginEcomMain() |
|
67 { |
|
68 } |
|
69 |
|
70 // ----------------------------------------------------------------------------- |
|
71 // KImplementationTable |
|
72 // ----------------------------------------------------------------------------- |
|
73 const TImplementationProxy KImplementationTable[] = |
|
74 { |
|
75 {{KFirstSystemInfoImplementationValue}, (TProxyNewLPtr)CSystemInfoPluginEcomMain::NewL} |
|
76 }; |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // ImplementationGroupProxy |
|
80 // Returns the filters implemented in this DLL |
|
81 // Returns: The filters implemented in this DLL |
|
82 // ----------------------------------------------------------------------------- |
|
83 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) |
|
84 { |
|
85 aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy); |
|
86 return KImplementationTable; |
|
87 } |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // InitializeFuncs |
|
91 // ----------------------------------------------------------------------------- |
|
92 EXPORT_C NPError InitializeFuncs( NPPluginFuncs* aPpf ) |
|
93 { |
|
94 aPpf->size = sizeof(NPPluginFuncs); |
|
95 aPpf->version = 1; |
|
96 aPpf->newp = NewNPP_NewProc(SystemInfoNewp); |
|
97 aPpf->destroy = NewNPP_DestroyProc(SystemInfoDestroy); |
|
98 aPpf->setwindow = 0; |
|
99 aPpf->newstream = 0; |
|
100 aPpf->destroystream = 0; |
|
101 aPpf->asfile = 0; |
|
102 aPpf->writeready = 0; |
|
103 aPpf->write = 0; |
|
104 aPpf->print = 0; |
|
105 aPpf->event = 0; |
|
106 aPpf->urlnotify = 0; |
|
107 aPpf->javaClass = 0; |
|
108 aPpf->getvalue = NewNPP_GetValueProc(SystemInfoGetvalue); |
|
109 aPpf->setvalue = 0; |
|
110 |
|
111 return NPERR_NO_ERROR; |
|
112 } |
|
113 |
|
114 // ----------------------------------------------------------------------------- |
|
115 // NPP_Shutdown |
|
116 // ----------------------------------------------------------------------------- |
|
117 EXPORT_C void NPP_Shutdown(void) |
|
118 { |
|
119 CSystemInfoPluginEcomMain* npm = (CSystemInfoPluginEcomMain*)Dll::Tls(); |
|
120 delete npm; |
|
121 Dll::SetTls( NULL ); |
|
122 } |
|
123 |
|
124 // End of File |