scrsaver/scrsaverplugins/ScreenSaverAnimPlugin/src/NpnImplementation.cpp
changeset 14 8a173132b0aa
parent 2 058b1fc1663a
equal deleted inserted replaced
2:058b1fc1663a 14:8a173132b0aa
     1 /*
       
     2 * Copyright (c) 2005 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:     This file defines the functions 
       
    15 *                _NPNetscapeFuncs of Browser's Netscape API
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #include "NpnImplementation.h"
       
    24 
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // NpnGetUrl
       
    28 //
       
    29 // Requests the associated pluginInst to load the given url.
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32  NPError NpnGetUrl( NPP /*aInstance*/, const TDesC& /*aUrl*/,
       
    33                    const TDesC* /*aWindowType*/ )
       
    34     {
       
    35     return NPERR_GENERIC_ERROR;
       
    36     }
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // NpnPostUrl
       
    40 //
       
    41 // Requests the associated pluginInst to POST to the given url.
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44  NPError NpnPostUrl( NPP /*aInstance*/, const TDesC& /*aUrl*/, 
       
    45                     const TDesC* /*aWindowType*/,
       
    46                     const TDesC& /*aBuf*/, NPBool /*aFile*/ )
       
    47     {
       
    48     return NPERR_GENERIC_ERROR;
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // NpnRequestRead
       
    53 //
       
    54 // Unsupported.
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57  NPError NpnRequestRead( NPStream* /*aStream*/, NPByteRange* /*aRangeList*/ )
       
    58     {
       
    59     // This function is not supported
       
    60     return NPERR_GENERIC_ERROR;
       
    61     }
       
    62 
       
    63 // -----------------------------------------------------------------------------
       
    64 // NpnNewStream
       
    65 //
       
    66 // Unsupported.
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69  NPError NpnNewStream( NPP /*aInstance*/, NPMIMEType /*aType*/,
       
    70                       const TDesC* /*aWindowType*/, NPStream** /*aStream*/ )
       
    71     {
       
    72     // This function is not supported.
       
    73     // It is specifically intended to create a new Browser window
       
    74     return NPERR_GENERIC_ERROR;
       
    75     }
       
    76 
       
    77 // -----------------------------------------------------------------------------
       
    78 // NpnWrite
       
    79 //
       
    80 // Unsupported.
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83  TInt32 NpnWrite( NPP /*aInstance*/, NPStream* /*aStream*/,
       
    84                  TInt32 /*aLen*/, void* /*aBuffer*/ )
       
    85     {
       
    86     // This function is not supported.
       
    87     // It is specifically intended to create a new Browser window
       
    88     return NPERR_GENERIC_ERROR;
       
    89     }
       
    90 
       
    91 // -----------------------------------------------------------------------------
       
    92 // NpnDestroyStream
       
    93 //
       
    94 // Unsupported.
       
    95 // -----------------------------------------------------------------------------
       
    96 //
       
    97  NPError NpnDestroyStream( NPP /*aInstance*/, NPStream* /*aStream*/,
       
    98                           NPReason /*aReason*/ )
       
    99     {
       
   100     // This function is not supported.
       
   101     // It is specifically intended to create a new Browser window
       
   102     return NPERR_GENERIC_ERROR;
       
   103     }
       
   104 
       
   105 // -----------------------------------------------------------------------------
       
   106 // NpnStatus
       
   107 //
       
   108 // Allows a plugin to report its current status to the associated PluginInst.
       
   109 // -----------------------------------------------------------------------------
       
   110 //
       
   111  void NpnStatus( NPP /*aInstance*/, const TDesC& /*aMessage*/ )
       
   112     {   
       
   113     }
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 // NpnUAgent
       
   117 //
       
   118 // Returns the user agent of the Series 60 Browser.
       
   119 // -----------------------------------------------------------------------------
       
   120 //
       
   121  const TDesC* NpnUAgent( NPP /*aInstance*/ )
       
   122     {
       
   123     return NULL;
       
   124     }
       
   125 
       
   126 // -----------------------------------------------------------------------------
       
   127 // NpnMemAlloc
       
   128 //
       
   129 // Allocates a chunk of memory on the behalf of the plugin.
       
   130 // -----------------------------------------------------------------------------
       
   131 //
       
   132  void* NpnMemAlloc( uint32 aSize )
       
   133     {
       
   134     if ( aSize )
       
   135         {
       
   136         return User::Alloc( aSize );
       
   137         }
       
   138     return NULL;
       
   139     }
       
   140 
       
   141 // -----------------------------------------------------------------------------
       
   142 // NpnMemFree
       
   143 //
       
   144 // Deallocates a chunk of memory on the behalf of the plugin.
       
   145 // -----------------------------------------------------------------------------
       
   146 //
       
   147  void NpnMemFree( void* aPtr )
       
   148     {
       
   149     User::Free( aPtr );
       
   150     }
       
   151 
       
   152 // -----------------------------------------------------------------------------
       
   153 // NpnMemFlush
       
   154 //
       
   155 // Unsupported.
       
   156 // -----------------------------------------------------------------------------
       
   157 //
       
   158  uint32 NpnMemFlush( uint32 /*aSize*/ )
       
   159     {
       
   160     // This function is not supported
       
   161     return NPERR_GENERIC_ERROR;
       
   162     }
       
   163 
       
   164 // -----------------------------------------------------------------------------
       
   165 // NpnReloadPlugins
       
   166 //
       
   167 // Causes the PluginHandler to scan for new plugins and reloads the current
       
   168 // page if aReloadPages is true.
       
   169 // -----------------------------------------------------------------------------
       
   170 //
       
   171  void NpnReloadPlugins( NPBool /*aReloadPages*/ )
       
   172     {
       
   173     //This is currently not supported since CPluginHandler is non static
       
   174     }
       
   175 
       
   176 // -----------------------------------------------------------------------------
       
   177 // NpnGetJavaEnv
       
   178 //
       
   179 // Unsupported.
       
   180 // -----------------------------------------------------------------------------
       
   181 //
       
   182  JRIEnv* NpnGetJavaEnv()
       
   183     {
       
   184     // This function is not supported
       
   185     return NULL;
       
   186     }
       
   187 
       
   188 // -----------------------------------------------------------------------------
       
   189 // NpnGetJavaPeer
       
   190 //
       
   191 // Unsupported.
       
   192 // -----------------------------------------------------------------------------
       
   193 //
       
   194  jref NpnGetJavaPeer( NPP /*aInstance*/ )
       
   195     {
       
   196     // This function is not supported
       
   197     return NULL;
       
   198     }
       
   199 
       
   200 // -----------------------------------------------------------------------------
       
   201 // NpnGetUrlNotify
       
   202 //
       
   203 // Requests the associated PluginInst to load the given url.  The plugin is
       
   204 // notified when the request completes.
       
   205 // -----------------------------------------------------------------------------
       
   206 //
       
   207  NPError NpnGetUrlNotify( NPP /*aInstance*/, const TDesC& /*aUrl*/,
       
   208                          const TDesC* /*aWindowType*/, void* /*aNotifyData*/ )
       
   209     {
       
   210     return NPERR_GENERIC_ERROR;
       
   211     }
       
   212 
       
   213 // -----------------------------------------------------------------------------
       
   214 // NpnPostUrlNotify
       
   215 //
       
   216 // Requests the associated PluginInst to POST to the given url.  The plugin is
       
   217 // notified when the request completes.
       
   218 // -----------------------------------------------------------------------------
       
   219 //
       
   220  NPError NpnPostUrlNotify( NPP /*aInstance*/, const TDesC& /*aUrl*/,
       
   221                           const TDesC* /*aWindowType*/, const TDesC& /*aBuf*/,
       
   222                           NPBool /*aFile*/, void* /*aNotifyData*/ )
       
   223     {
       
   224     return NPERR_GENERIC_ERROR;
       
   225     }
       
   226 
       
   227 // -----------------------------------------------------------------------------
       
   228 // NpnGetValue
       
   229 //
       
   230 // Query the associated PluginInst for information.
       
   231 // -----------------------------------------------------------------------------
       
   232 //
       
   233  NPError NpnGetValue( NPP /*aInstance*/, NPNVariable /*aVariable*/, 
       
   234                      void* /*aRetValue*/ )
       
   235     {   
       
   236     return NPERR_GENERIC_ERROR;
       
   237     }
       
   238 
       
   239 // -----------------------------------------------------------------------------
       
   240 // NpnSetValue
       
   241 //
       
   242 // Set a value on the associated PluginInst
       
   243 // -----------------------------------------------------------------------------
       
   244 //
       
   245  NPError NpnSetValue( NPP /*aInstance*/, NPPVariable /*aVariable*/, 
       
   246                                         void* /*aSetValue*/ )
       
   247     {   
       
   248     return NPERR_GENERIC_ERROR;
       
   249     }
       
   250 
       
   251 // -----------------------------------------------------------------------------
       
   252 // NpnInvalidateRect
       
   253 //
       
   254 // Unsupported.
       
   255 // -----------------------------------------------------------------------------
       
   256 //
       
   257  void NpnInvalidateRect( NPP /*aInstance*/, NPRect * /*aRect*/ )
       
   258     {
       
   259     // This function is not supported
       
   260     }
       
   261 
       
   262 // -----------------------------------------------------------------------------
       
   263 // NpnInvalidateRegion
       
   264 //
       
   265 // Unsupported.
       
   266 // -----------------------------------------------------------------------------
       
   267 //
       
   268  void NpnInvalidateRegion( NPP /*aInstance*/, NPRegion /*aRegion*/ )
       
   269     {
       
   270     // This function is not supported
       
   271     }
       
   272 
       
   273 // -----------------------------------------------------------------------------
       
   274 // NpnForceRedraw
       
   275 //
       
   276 // Unsupported.
       
   277 // -----------------------------------------------------------------------------
       
   278 //
       
   279  void NpnForceRedraw( NPP /*aInstance*/ )
       
   280     {
       
   281     // This function is not supported
       
   282     }
       
   283 
       
   284 
       
   285 // End Of File
       
   286