Bug 104298 -- clean up in plugin module, r=serge, r=bnesse, sr=beard

This commit is contained in:
av%netscape.com 2002-10-03 21:05:30 +00:00
Родитель 2c26194a5f
Коммит 2ef38d15b1
11 изменённых файлов: 901 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,68 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
%{C++
#include "nsplugindefs.h"
// {a55d21ca-1dd1-11b2-9b0f-8fe1adaf129d}
#define NS_CLASSIC_PLUGIN_FACTORY_CID \
{ 0xa55d21ca, 0x1dd1, 0x11b2, { 0x9b, 0x0f, 0x8f, 0xe1, 0xad, 0xaf, 0x12, 0x9d } }
// Prefix for ContractID of all plugins
#define NS_CLASSIC_PLUGIN_FACTORY_CONTRACTID "@mozilla.org/plugin/classicpluginfactory;1"
struct PRLibrary;
%}
interface nsIServiceManagerObsolete;
interface nsIPlugin;
[ptr] native PRLibraryPtr(PRLibrary);
[uuid(07bfa284-1dd2-11b2-90f8-fef5608e8a56)]
interface nsIClassicPluginFactory : nsISupports
{
/**
* A factory method for constructing 4.x plugins.
* Constructs and initializes an ns4xPlugin object
*/
void createPlugin(in nsIServiceManagerObsolete aServiceMgr,
in string aFileName, in string aFullPath,
in PRLibraryPtr aLibrary, out nsIPlugin aResult);
};

Просмотреть файл

@ -0,0 +1,77 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nspluginroot.idl"
%{C++
#include "nsplugindefs.h"
%}
/**
* The nsIFileUtilities interface provides access to random file operations.
* To obtain: QueryInterface on nsIPluginManager.
*/
[uuid(89a31ce0-019a-11d2-815b-006008119d7a)]
interface nsIFileUtilities : nsISupports
{
/**
* Returns the name of the browser executable program.
*
* @param aProgramPath - the returned path to the program
* @result - NS_OK if this operation was successful
*/
void getProgramPath(out constCharPtr aProgramPath);
/**
* Returns the name of the temporary directory.
*
* @param aTempDirPath - the returned path to the temp directory
* @result - NS_OK if this operation was successful
*/
void getTempDirPath(out constCharPtr aTempDirPath);
/**
* Returns a unique temporary file name.
*
* @param aPrefix - a string to prefix to the temporary file name
* @param aLength - the length of the resulting buffer to receive the data
* @param aBuffer - the returned temp file name
* @result - NS_OK if this operation was successful
*/
void newTempFileName(in string aPrefix, in unsigned long aLength, in charPtr aBuffer);
};

Просмотреть файл

@ -0,0 +1,105 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/**
* nsIJRILiveConnectPluginInstancePeer
*
* @status DEPRECATED
*
* Originally published XPCOM Plugin API is now deprecated
* Developers are welcome to use NPAPI, please refer to:
* http://mozilla.org/projects/plugins/
*/
#include "nsISupports.idl"
#include "nspluginroot.idl"
%{C++
#include "nsplugindefs.h"
#include "jri.h"
%}
////////////////////////////////////////////////////////////////////////////////
// JRI-Based LiveConnect Classes
////////////////////////////////////////////////////////////////////////////////
//
// This stuff is here so that the browser can support older JRI-based
// LiveConnected plugins (when using old plugin to new C++-style plugin
// adapter code).
//
// Warning: Don't use this anymore, unless you're sure that you have to!
////////////////////////////////////////////////////////////////////////////////
%{C++
// QueryInterface for this IID on nsIPluginManager to get a JRIEnv
// XXX change this
#define NS_IJRIENV_IID \
{ /* f9d4ea00-a1bc-11d1-85b1-00805f0e4dfe */ \
0xf9d4ea00, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
%}
/**
* The nsIJRILiveConnectPluginInstancePeer interface is implemented by browsers
* that support JRI-based LiveConnect. Note that for 5.0, LiveConnect support
* has become JNI-based, so this interface is effectively deprecated.
*
* To obtain: QueryInterface on nsIPluginInstancePeer
*/
[uuid(25b63f40-f773-11d1-815b-006008119d7a)]
interface nsIJRILiveConnectPluginInstancePeer : nsISupports
{
/**
* Returns a JRI env corresponding to the current Java thread of the
* browser.
*
* (Corresponds to NPN_GetJavaEnv.)
*/
void getJavaEnv(out JRIEnvPtr aEnv);
/**
* Returns a JRI reference to the Java peer object associated with the
* plugin instance. This object is an instance of the class specified
* by nsIJRILiveConnectPlugin::GetJavaClass.
*
* (Corresponds to NPN_GetJavaPeer.)
*/
void getJavaPeer(out jref aJavaPeer);
};

Просмотреть файл

@ -0,0 +1,147 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nspluginroot.idl"
#include "nsIFactory.idl"
#include "nsIPluginInstanceOwner.idl"
#include "nsIStreamListener.idl"
#include "nsIStringStream.idl"
%{C++
#include "nsplugindefs.h"
#include "nsString.h"
#include "nsNetUtil.h"
#include "prlink.h" // for PRLibrary
%}
interface nsIPlugin;
interface nsIURI;
interface nsIDOMPlugin;
[ref] native nsStringRef(nsString);
[ptr] native PRLibraryPtr(PRLibrary);
[ref] native nsIStreamListenerRef(nsIStreamListener *);
[uuid(264c0640-1c31-11d2-a82e-0040959a28c9)]
interface nsIPluginHost : nsIFactory
{
void init();
void destroy();
void loadPlugins();
void getPluginFactory(in string aMimeType, out nsIPlugin aPlugin);
void instantiateEmbededPlugin(in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner);
void instantiateFullPagePlugin(in string aMimeType, in nsStringRef aURLSpec, in nsIStreamListenerRef aStreamListener, in nsIPluginInstanceOwner aOwner);
void setUpPluginInstance(in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner);
void isPluginEnabledForType(in string aMimeType);
void isPluginEnabledForExtension(in string aExtension, in constCharStarRef aMimeType);
void getPluginCount(out unsigned long aPluginCount);
%{C++
NS_IMETHOD GetPlugins(PRUint32 aPluginCount, nsIDOMPlugin* aPluginArray[]) = 0;
%}
void stopPluginInstance(in nsIPluginInstance aInstance);
void handleBadPlugin(in PRLibraryPtr aLibrary, in nsIPluginInstance instance);
};
%{C++
/**
* Used for creating the correct input stream for plugins
* We can either have raw data (with or without \r\n\r\n) or a path to a file (but it must be native!)
* When making an nsIInputStream stream for the plugins POST data, be sure to take into
* account that it could be binary and full of nulls, see bug 105417. Also, we need
* to make a copy of the buffer because the plugin may have allocated it on the stack.
* For an example of this, see Shockwave registration or bug 108966
* We malloc only for headers here, buffer for data itself is malloced by ParsePostBufferToFixHeaders()
*/
inline nsresult
NS_NewPluginPostDataStream(nsIInputStream **result,
const char *data,
PRUint32 contentLength,
PRBool isFile = PR_FALSE,
PRBool headers = PR_FALSE)
{
nsresult rv = NS_ERROR_UNEXPECTED;
if (!data)
return rv;
if (!isFile) { // do raw data case first
if (contentLength < 1)
return rv;
char *buf = (char*) data;
if (headers) {
// in assumption we got correctly formated headers just passed in
if (!(buf = (char*)nsMemory::Alloc(contentLength)))
return NS_ERROR_OUT_OF_MEMORY;
memcpy(buf, data, contentLength);
}
nsCOMPtr<nsIStringInputStream> sis = do_CreateInstance("@mozilla.org/io/string-input-stream;1",&rv);
if (NS_SUCCEEDED(rv)) {
sis->AdoptData(buf, contentLength); // let the string stream manage our data
rv = CallQueryInterface(sis, result);
}
} else {
nsCOMPtr<nsILocalFile> file; // tmp file will be deleted on release of stream
nsCOMPtr<nsIInputStream> fileStream;
if (NS_SUCCEEDED(rv = NS_NewNativeLocalFile(nsDependentCString(data), PR_FALSE, getter_AddRefs(file))) &&
NS_SUCCEEDED(rv = NS_NewLocalFileInputStream(getter_AddRefs(fileStream),
file,
PR_RDONLY,
0600,
nsIFileInputStream::DELETE_ON_CLOSE |
nsIFileInputStream::CLOSE_ON_EOF))
)
{
// wrap the file stream with a buffered input stream
return NS_NewBufferedInputStream(result, fileStream, 8192);
}
}
return rv;
}
%}

Просмотреть файл

@ -0,0 +1,52 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIInputStream.idl"
#include "nspluginroot.idl"
/**
* The nsIPluginInputStream interface ...
*/
[uuid(af160530-542a-11d2-8164-006008119d7a)]
interface nsIPluginInputStream : nsIInputStream {
/**
* Corresponds to NPStream's lastmodified field.)
*/
void getLastModified(out unsigned long aResult);
void requestRead(out nsByteRange aRangeList);
};

Просмотреть файл

@ -0,0 +1,131 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nspluginroot.idl"
%{C++
#include "nsplugin.h"
%}
interface nsIPluginInstance;
interface nsIDocument;
[ref] native nsIPluginInstanceRef(nsIPluginInstance *);
[uuid(18270870-32f1-11d2-a830-0040959a28c9)]
interface nsIPluginInstanceOwner : nsISupports
{
/**
* Let the owner know that an instance has been created
*/
void setInstance(in nsIPluginInstance aInstance);
/**
* Get the instance associated with this owner.
*/
void getInstance(in nsIPluginInstanceRef aInstance);
/**
* Get a handle to the window structure of the owner.
* This pointer cannot be made persistant by the caller.
*/
void getWindow(in nsPluginWindowStarRef aWindow);
/**
* Get the display mode for the plugin instance.
*/
//void getMode(nsPluginMode *aMode);
readonly attribute nsPluginMode mode;
/**
* Create a place for the plugin to live in the owner's
* environment. this may or may not create a window
* depending on the windowless state of the plugin instance.
*/
void createWidget();
%{C++
/**
* Called when there is a valid target so that the proper
* frame can be updated with new content. will not be called
* with nsnull aTarget.
*/
NS_IMETHOD
GetURL(const char *aURL, const char *aTarget,
void *aPostData, PRUint32 aPostDataLen,
void *aHeadersData, PRUint32 aHeadersDataLen,
PRBool aIsFile = PR_FALSE) = 0;
%}
/**
* Show a status message in the host environment.
*/
void showStatus(in string aStatusMsg);
%{C++
NS_IMETHOD
ShowStatus(const PRUnichar *aStatusMsg) = 0;
%}
/**
* Get the associated document.
*/
//void getDocument(nsIDocument* *aDocument);
readonly attribute nsIDocument document;
/**
* Invalidate the rectangle
*/
void invalidateRect(in nsPluginRectPtr aRect);
/**
* Invalidate the region
*/
void invalidateRegion(in nsPluginRegion aRegion);
/**
* Force a redraw
*/
void forceRedraw();
/**
* Get the specified variable
*/
void getValue(in nsPluginInstancePeerVariable aVariable, in voidPtr aValue);
};

Просмотреть файл

@ -0,0 +1,62 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nspluginroot.idl"
%{C++
#include "nsplugindefs.h"
%}
[uuid(57b4e2f0-019b-11d2-815b-006008119d7a)]
interface nsIWindowlessPluginInstancePeer : nsISupports
{
/**
* Corresponds to NPN_InvalidateRect
*/
void invalidateRect(in nsPluginRectPtr aRect);
/**
* Corresponds to NPN_InvalidateRegion
*/
void invalidateRegion(in nsPluginRegion aRegion);
/**
* Corresponds to NPN_ForceRedraw
*/
void forceRedraw();
};

Просмотреть файл

@ -0,0 +1,96 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIPluginInstance.idl"
%{C++
#include "nsPluginNativeWindow.h"
%}
[ptr] native nsPluginNativeWindowPtr(nsPluginNativeWindow);
[uuid(8e3d71e6-2319-11d5-9cf8-0060b0fbd8ac)]
interface nsPIPluginHost : nsISupports
{
/**
* To notify the plugin manager that the plugin created a script object
*/
void setIsScriptableInstance(in nsIPluginInstance aInstance, in boolean aScriptable);
/**
* This method parses post buffer to find out case insensitive "Content-length" string
* and CR or LF some where after that, then it assumes there is http headers in
* the input buffer and continue to search for end of headers (CRLFCRLF or LFLF).
* It will *always malloc()* output buffer (caller is responsible to free it)
* if input buffer starts with LF, which comes from 4.x spec
* http://developer.netscape.com/docs/manuals/communicator/plugin/pgfn2.htm#1007754
* "If no custom headers are required, simply add a blank
* line ('\n') to the beginning of the file or buffer.",
* it skips that '\n' and considers rest of the input buffer as data.
* If "Content-length" string and end of headers is found
* it substitutes single LF with CRLF in the headers, so the end of headers
* always will be CRLFCRLF (single CR in headers, if any, remain untouched)
* else
* it puts "Content-length: "+size_of_data+CRLFCRLF at the beginning of the output buffer
* and memcpy data to the output buffer
*
* On failure outPostData and outPostDataLen will be set in 0.
* @param aInPostData - the post data
* @param aInPostDataLen - the length aInPostData
* @param aOutPostData - the buffer
* @param aOutPostDataLen - the length of aOutPostData
**/
void parsePostBufferToFixHeaders(in string aInPostData,
in unsigned long aInPostDataLen,
out string aOutPostData,
out unsigned long aOutPostDataLen);
/**
* To create tmp file with Content len header in, it will use by http POST
*/
void createTmpFileToPost(in string aPostDataURL, out string aTmpFileName);
/**
* Creates a new plugin native window object
*/
void newPluginNativeWindow(out nsPluginNativeWindowPtr aPluginNativeWindow);
/**
* Deletes plugin native window object created by NewPluginNativeWindow
*/
void deletePluginNativeWindow(in nsPluginNativeWindowPtr aPluginNativeWindow);
};

Просмотреть файл

@ -0,0 +1,48 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIPluginInstanceOwner.idl"
%{C++
%}
[uuid(4a708562-8a37-400b-8c08-20037d1adad3)]
interface nsPIPluginInstancePeer : nsISupports
{
readonly attribute nsIPluginInstanceOwner owner;
};

Просмотреть файл

@ -0,0 +1,49 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsPluginsCID_h__
#define nsPluginsCID_h__
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsIComponentManager.h"
#define NS_PLUGIN_HOST_CID \
{ 0xadea1880, 0x1a8e, 0x11d2, \
{ 0xa8, 0x2e, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } }
#endif // nsPluginsCID_h__

Просмотреть файл

@ -0,0 +1,66 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
native REFNSIID(REFNSIID);
native nativeVoid(void *);
native nativeChar(const char * *);
[ptr] native constVoidPtr(const void);
[ref] native PRUint32Ref(PRUint32);
[ref] native PRUint16Ref(PRUint16);
[ref] native constCharStarConstStar(const char* const*);
[ptr] native constCharPtr(const char);
[ref] native constCharStarRef(const char *);
native nsPluginMode(nsPluginMode);
native nsPluginStreamType(nsPluginStreamType);
native nsMIMEType(nsMIMEType);
native nsPluginWindow(nsPluginWindow);
[ptr] native nsPluginWindowPtr(nsPluginWindow);
[ref] native nsPluginWindowStarRef(nsPluginWindow *);
[ptr] native nsPluginPrintPtr(nsPluginPrint);
native nsByteRange(nsByteRange);
[ptr] native nsByteRangePtr(nsByteRange);
[ptr] native nsPluginEventPtr(nsPluginEvent);
native nsPluginManagerVariable(nsPluginManagerVariable);
native nsPluginVariable(nsPluginVariable);
native nsPluginInstanceVariable(nsPluginInstanceVariable);
native nsPluginInstancePeerVariable(nsPluginInstancePeerVariable);
[ptr] native nsPluginRectPtr(nsPluginRect);
native nsPluginRegion(nsPluginRegion);
[ptr] native JRIEnvPtr(JRIEnv);
native jref(jref);