1 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
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 Plugins.
17 * The Initial Developer of the Original Code is
18 * Chris Jones <jones.chris.g@gmail.com>.
19 * Portions created by the Initial Developer are Copyright (C) 2009
20 * the Initial Developer. All Rights Reserved.
23 * Benjamin Smedberg <benjamin@smedbergs.us>
24 * Ben Turner <bent.mozilla@gmail.com>
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 include protocol PPluginInstance;
41 include protocol PPluginIdentifier;
44 include "npruntime.h";
45 include "mozilla/plugins/PluginMessageUtils.h";
47 using mozilla::void_t;
48 using mozilla::null_t;
60 nullable PPluginScriptableObject;
63 rpc protocol PPluginScriptableObject
65 manager PPluginInstance;
71 rpc NPN_Evaluate(nsCString aScript)
72 returns (Variant aResult,
80 rpc HasMethod(PPluginIdentifier aId)
81 returns (bool aHasMethod);
83 rpc Invoke(PPluginIdentifier aId,
85 returns (Variant aResult,
88 rpc InvokeDefault(Variant[] aArgs)
89 returns (Variant aResult,
92 rpc HasProperty(PPluginIdentifier aId)
93 returns (bool aHasProperty);
95 rpc SetProperty(PPluginIdentifier aId,
97 returns (bool aSuccess);
99 rpc RemoveProperty(PPluginIdentifier aId)
100 returns (bool aSuccess);
103 returns (PPluginIdentifier[] aProperties,
106 rpc Construct(Variant[] aArgs)
107 returns (Variant aResult,
110 // Objects are initially unprotected, and the Protect and Unprotect functions
111 // only affect protocol objects that represent NPObjects created in the same
112 // process (rather than protocol objects that are a proxy for an NPObject
113 // created in another process). Protocol objects representing local NPObjects
114 // are protected after an NPObject has been associated with the protocol
115 // object. Sending the protocol object as an argument to the other process
116 // temporarily protects the protocol object again for the duration of the call.
121 * GetProperty is slightly wonky due to the way we support NPObjects that have
122 * methods and properties with the same name. When child calls parent we
123 * simply return a property. When parent calls child, however, we need to do
124 * several checks at once and return all the results simultaneously.
127 rpc GetParentProperty(PPluginIdentifier aId)
128 returns (Variant aResult,
132 rpc GetChildProperty(PPluginIdentifier aId)
133 returns (bool aHasProperty,
139 } // namespace plugins
140 } // namespace mozilla