browserplugins/browsergpsplugin/src/GpsPluginEcomMain.cpp
branchRCL_3
changeset 64 6385c4c93049
parent 63 4baee4f15982
child 65 8e6fa1719340
equal deleted inserted replaced
63:4baee4f15982 64:6385c4c93049
     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 "GpsPlugin.h"
       
    22 #include <ecom/implementationproxy.h>
       
    23 #include <cecombrowserplugininterface.h>
       
    24 
       
    25 
       
    26 /*********************************************************/
       
    27 /******** ECOM STYLE GPS PLUGIN ENTRY POINTS ********/
       
    28 /*********************************************************/
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CGpsPluginEcomMain::NewL
       
    32 // -----------------------------------------------------------------------------
       
    33 CGpsPluginEcomMain* CGpsPluginEcomMain::NewL( TAny* aInitParam )
       
    34     {
       
    35     TFuncs* funcs = REINTERPRET_CAST( TFuncs*, aInitParam );
       
    36     CGpsPluginEcomMain* self = new (ELeave) CGpsPluginEcomMain( funcs->iNetscapeFuncs );
       
    37     CleanupStack::PushL( self );
       
    38     self->ConstructL( funcs->iPluginFuncs );
       
    39     CleanupStack::Pop( self );
       
    40     Dll::SetTls ( (void*)self );
       
    41     return self;
       
    42     }
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // CGpsPluginEcomMain::ConstructL
       
    46 // -----------------------------------------------------------------------------
       
    47 void CGpsPluginEcomMain::ConstructL( NPPluginFuncs* aPluginFuncs )
       
    48     {
       
    49     InitializeFuncs( aPluginFuncs );
       
    50     }
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 // CGpsPluginEcomMain::CGpsPluginEcomMain
       
    54 // -----------------------------------------------------------------------------
       
    55 CGpsPluginEcomMain::CGpsPluginEcomMain( NPNetscapeFuncs* aNpf )
       
    56     : CEcomBrowserPluginInterface(),
       
    57       iNpf( aNpf )
       
    58     {
       
    59     }
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // CGpsPluginEcomMain::~CGpsPluginEcomMain
       
    63 // -----------------------------------------------------------------------------
       
    64 CGpsPluginEcomMain::~CGpsPluginEcomMain()
       
    65     {
       
    66     }
       
    67 
       
    68 // -----------------------------------------------------------------------------
       
    69 // KImplementationTable
       
    70 // -----------------------------------------------------------------------------
       
    71 const TImplementationProxy KImplementationTable[] =
       
    72     {
       
    73     {{KFirstGpsImplementationValue}, (TProxyNewLPtr)CGpsPluginEcomMain::NewL}
       
    74     };
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // ImplementationGroupProxy
       
    78 // Returns the filters implemented in this DLL
       
    79 // Returns: The filters implemented in this DLL
       
    80 // -----------------------------------------------------------------------------
       
    81 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
    82     {
       
    83     aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy);
       
    84     return KImplementationTable;
       
    85     }
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // InitializeFuncs
       
    89 // -----------------------------------------------------------------------------
       
    90 EXPORT_C NPError InitializeFuncs( NPPluginFuncs* aPpf )
       
    91     {
       
    92     aPpf->size          = sizeof(NPPluginFuncs);
       
    93     aPpf->version       = 1;
       
    94     aPpf->newp          = NewNPP_NewProc(GpsNewp);
       
    95     aPpf->destroy       = NewNPP_DestroyProc(GpsDestroy);
       
    96     aPpf->setwindow     = NewNPP_SetWindowProc(GpsSetwindow);
       
    97     aPpf->newstream     = 0;
       
    98     aPpf->destroystream = 0;
       
    99     aPpf->asfile        = 0;
       
   100     aPpf->writeready    = 0;
       
   101     aPpf->write         = 0;
       
   102     aPpf->print         = 0;
       
   103     aPpf->event         = 0;
       
   104     aPpf->urlnotify     = 0;
       
   105     aPpf->javaClass     = 0;
       
   106     aPpf->getvalue      = NewNPP_GetValueProc(GpsGetvalue);
       
   107     aPpf->setvalue      = 0;
       
   108 
       
   109     return NPERR_NO_ERROR;
       
   110     }
       
   111 
       
   112 // -----------------------------------------------------------------------------
       
   113 // NPP_Shutdown
       
   114 // -----------------------------------------------------------------------------
       
   115 EXPORT_C void NPP_Shutdown(void)
       
   116     {
       
   117     CGpsPluginEcomMain* npm = (CGpsPluginEcomMain*)Dll::Tls();
       
   118     delete npm;
       
   119     Dll::SetTls( NULL );
       
   120     }
       
   121 
       
   122 //  End of File