cecombrowserplugininterface.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : CEcomBrowserPluginInterface.h
00004 *  Part of     : Webkit \ Plugin
00005 *  Interface   : 
00006 *  Description :
00007 *  Version     : 3.1
00008 *
00009 *    Copyright (c) 2006, Nokia Corporation
00010 *    All rights reserved.
00011 *  
00012 *       Redistribution and use in source and binary forms, with or without
00013 *       modification, are permitted provided that the following conditions
00014 *       are met:
00015 *  
00016 *      * Redistributions of source code must retain the above copyright
00017 *        notice, this list of conditions and the following disclaimer.
00018 *      * Redistributions in binary form must reproduce the above copyright
00019 *        notice, this list of conditions and the following disclaimer in
00020 *        the documentation and/or other materials provided with the
00021 *        distribution.
00022 *      * Neither the name of the Nokia Corporation nor the names of its
00023 *        contributors may be used to endorse or promote products derived
00024 *        from this software without specific prior written permission.
00025 *  
00026 *       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00027 *       "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00028 *       LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00029 *       A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00030 *       OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00031 *       SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00032 *       LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00033 *       DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00034 *       THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00035 *       (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00036 *       USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00037 *       DAMAGE.
00038 *  
00039 *    Please see file patentlicense.txt for further grants.
00040 * ==============================================================================
00041 */
00042 
00043 #ifndef CECOMBROWSERPLUGININTERFACE_H
00044 #define CECOMBROWSERPLUGININTERFACE_H
00045 
00046 // System includes
00047 #include <e32base.h>
00048 #include <ecom/ecom.h>
00049 
00050 // User includes
00051 #include "npupp.h"
00052 #include "BrowserPluginInterface.h"
00053 
00054 typedef struct
00055     {
00056     NPNetscapeFuncs* iNetscapeFuncs;
00057     NPPluginFuncs* iPluginFuncs;
00058     }TFuncs;
00059 
00060 //
00061 // The ECOM interface definition for a Netscape plugin interface class.
00062 //
00063 class CEcomBrowserPluginInterface: public CBase
00064         {
00065         public: 
00066 
00067         inline static CEcomBrowserPluginInterface* CreatePluginL(
00068                                         TUid aImplementationUid,
00069                                         NPNetscapeFuncs* aNetscapeFuncs,
00070                                         NPPluginFuncs* aPluginFuncs);
00071                 
00072                 inline virtual ~CEcomBrowserPluginInterface();
00073                 
00074   public:
00075 
00076         private:
00077   //    The ECom destructor key identifier
00078         TUid iEcomDtorID;
00079 
00080         // A refedrence count
00081         TInt iCount;
00082 
00083         };
00084 
00085 //
00086 //
00087 inline CEcomBrowserPluginInterface* CEcomBrowserPluginInterface::CreatePluginL(
00088         TUid aImplementationUid,
00089         NPNetscapeFuncs* aNetscapeFuncs,
00090         NPPluginFuncs* aPluginFuncs)
00091         {
00092 
00093         TFuncs initParams;
00094         initParams.iNetscapeFuncs = aNetscapeFuncs;
00095         initParams.iPluginFuncs = aPluginFuncs;
00096 
00097         TAny* ptr = REComSession::CreateImplementationL(aImplementationUid, 
00098                                                                         _FOFF(CEcomBrowserPluginInterface, iEcomDtorID),
00099                                     &initParams);
00100 
00101         return REINTERPRET_CAST(CEcomBrowserPluginInterface*, ptr);
00102         }
00103 
00104 inline CEcomBrowserPluginInterface::~CEcomBrowserPluginInterface()
00105         {
00106         REComSession::DestroyedImplementation(iEcomDtorID);
00107         }       
00108 
00109 
00110 // CECOMBROWSERPLUGININTERFACE_H
00111 #endif
00112 
00113 
00114 
00115 

Copyright © Nokia Corporation 2001-2008
Back to top