1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include
"nsISupports.idl"
39 #include
"nsIPluginInstance.idl"
42 #include
"nsPluginNativeWindow.h"
45 interface nsIPluginInstanceOwner
;
47 [ptr] native nsPluginNativeWindowPtr
(nsPluginNativeWindow
);
49 [uuid(673811fb
-83d6
-4b8f
-b1a9
-bb3a9033f256
)]
50 interface nsPIPluginHost
: nsISupports
53 * To notify the plugin manager that the plugin created a script object
55 void setIsScriptableInstance
(in nsIPluginInstance aInstance
, in boolean aScriptable
);
58 * This method parses post buffer to find out case insensitive "Content-length" string
59 * and CR or LF some where after that, then it assumes there is http headers in
60 * the input buffer and continue to search for end of headers (CRLFCRLF or LFLF).
61 * It will *always malloc()* output buffer (caller is responsible to free it)
62 * if input buffer starts with LF, which comes from 4.x spec
63 * http://developer.netscape.com/docs/manuals/communicator/plugin/pgfn2.htm#1007754
64 * "If no custom headers are required, simply add a blank
65 * line ('\n') to the beginning of the file or buffer.",
66 * it skips that '\n' and considers rest of the input buffer as data.
67 * If "Content-length" string and end of headers is found
68 * it substitutes single LF with CRLF in the headers, so the end of headers
69 * always will be CRLFCRLF (single CR in headers, if any, remain untouched)
71 * it puts "Content-length: "+size_of_data+CRLFCRLF at the beginning of the output buffer
72 * and memcpy data to the output buffer
74 * On failure outPostData and outPostDataLen will be set in 0.
75 * @param aInPostData - the post data
76 * @param aInPostDataLen - the length aInPostData
77 * @param aOutPostData - the buffer
78 * @param aOutPostDataLen - the length of aOutPostData
80 void parsePostBufferToFixHeaders
(in string aInPostData
,
81 in unsigned long aInPostDataLen
,
82 out string aOutPostData
,
83 out unsigned long aOutPostDataLen
);
85 * To create tmp file with Content len header in, it will use by http POST
87 void createTmpFileToPost
(in string aPostDataURL
, out string aTmpFileName
);
90 * Creates a new plugin native window object
92 void newPluginNativeWindow
(out nsPluginNativeWindowPtr aPluginNativeWindow
);
95 * Deletes plugin native window object created by NewPluginNativeWindow
97 void deletePluginNativeWindow
(in nsPluginNativeWindowPtr aPluginNativeWindow
);
99 * Instantiate a "dummy" java plugin if a java plugin that supports
100 * NPRuntime is installed. This plugin is used for exposing
101 * window.java and window.Packages. If the java plugin supports
102 * NPRuntime and instantiation was successful, aOwners instance will
103 * be non-null, if not, it will be null.
105 [noscript
] void instantiateDummyJavaPlugin
(in nsIPluginInstanceOwner aOwner
);
108 * Get the plugin name for the plugin instance.
109 * @param aInstance the plugin instance object
110 * @param aPluginName returns a pointer to a shared readonly string value,
111 * it's only valid for the lifetime of the plugin instance - you must
112 * copy the string value if you need it longer than that.
114 [noscript
] void getPluginName
(in nsIPluginInstance aInstance
, [shared
] out string aPluginName
);