2009-09-09 10:31:35 +04:00
|
|
|
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-09-09 10:31:35 +04:00
|
|
|
|
2010-04-27 05:11:46 +04:00
|
|
|
include protocol PPluginInstance;
|
|
|
|
include protocol PPluginIdentifier;
|
2009-09-09 10:31:35 +04:00
|
|
|
|
2013-10-01 23:25:07 +04:00
|
|
|
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
|
|
|
|
using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
|
2009-06-30 22:51:05 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace plugins {
|
|
|
|
|
2009-09-18 02:15:12 +04:00
|
|
|
union Variant {
|
|
|
|
void_t;
|
|
|
|
null_t;
|
|
|
|
bool;
|
|
|
|
int;
|
|
|
|
double;
|
|
|
|
nsCString;
|
2009-12-03 09:35:22 +03:00
|
|
|
nullable PPluginScriptableObject;
|
2009-09-18 02:15:12 +04:00
|
|
|
};
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr protocol PPluginScriptableObject
|
2009-06-30 22:51:05 +04:00
|
|
|
{
|
2009-09-09 10:31:35 +04:00
|
|
|
manager PPluginInstance;
|
|
|
|
|
2009-12-03 11:16:14 +03:00
|
|
|
both:
|
2010-03-05 00:20:14 +03:00
|
|
|
async __delete__();
|
2009-12-03 11:16:14 +03:00
|
|
|
|
2009-10-13 21:54:41 +04:00
|
|
|
parent:
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_Evaluate(nsCString aScript)
|
2009-10-13 21:54:41 +04:00
|
|
|
returns (Variant aResult,
|
|
|
|
bool aSuccess);
|
|
|
|
|
2010-01-15 23:35:57 +03:00
|
|
|
child:
|
2013-10-01 04:27:45 +04:00
|
|
|
intr Invalidate();
|
2010-01-19 15:00:58 +03:00
|
|
|
|
2010-01-15 23:35:57 +03:00
|
|
|
both:
|
|
|
|
// NPClass methods
|
2013-10-01 04:27:45 +04:00
|
|
|
intr HasMethod(PPluginIdentifier aId)
|
2009-09-09 10:31:35 +04:00
|
|
|
returns (bool aHasMethod);
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr Invoke(PPluginIdentifier aId,
|
2009-10-19 23:10:52 +04:00
|
|
|
Variant[] aArgs)
|
2009-10-08 03:50:48 +04:00
|
|
|
returns (Variant aResult,
|
2009-09-09 10:31:35 +04:00
|
|
|
bool aSuccess);
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr InvokeDefault(Variant[] aArgs)
|
2009-10-08 03:50:48 +04:00
|
|
|
returns (Variant aResult,
|
2009-09-09 10:31:35 +04:00
|
|
|
bool aSuccess);
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr HasProperty(PPluginIdentifier aId)
|
2009-09-09 10:31:35 +04:00
|
|
|
returns (bool aHasProperty);
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr SetProperty(PPluginIdentifier aId,
|
2009-10-08 03:50:48 +04:00
|
|
|
Variant aValue)
|
2009-09-09 10:31:35 +04:00
|
|
|
returns (bool aSuccess);
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr RemoveProperty(PPluginIdentifier aId)
|
2009-09-09 10:31:35 +04:00
|
|
|
returns (bool aSuccess);
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr Enumerate()
|
2010-03-23 17:30:51 +03:00
|
|
|
returns (PPluginIdentifier[] aProperties,
|
2009-09-09 10:31:35 +04:00
|
|
|
bool aSuccess);
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr Construct(Variant[] aArgs)
|
2009-10-08 03:50:48 +04:00
|
|
|
returns (Variant aResult,
|
2009-09-09 10:31:35 +04:00
|
|
|
bool aSuccess);
|
2010-01-15 23:35:57 +03:00
|
|
|
|
|
|
|
// Objects are initially unprotected, and the Protect and Unprotect functions
|
|
|
|
// only affect protocol objects that represent NPObjects created in the same
|
|
|
|
// process (rather than protocol objects that are a proxy for an NPObject
|
|
|
|
// created in another process). Protocol objects representing local NPObjects
|
|
|
|
// are protected after an NPObject has been associated with the protocol
|
|
|
|
// object. Sending the protocol object as an argument to the other process
|
|
|
|
// temporarily protects the protocol object again for the duration of the call.
|
2010-03-05 00:20:14 +03:00
|
|
|
async Protect();
|
|
|
|
async Unprotect();
|
2010-04-08 04:16:19 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GetProperty is slightly wonky due to the way we support NPObjects that have
|
|
|
|
* methods and properties with the same name. When child calls parent we
|
|
|
|
* simply return a property. When parent calls child, however, we need to do
|
|
|
|
* several checks at once and return all the results simultaneously.
|
|
|
|
*/
|
|
|
|
parent:
|
2013-10-01 04:27:45 +04:00
|
|
|
intr GetParentProperty(PPluginIdentifier aId)
|
2010-04-08 04:16:19 +04:00
|
|
|
returns (Variant aResult,
|
|
|
|
bool aSuccess);
|
|
|
|
|
|
|
|
child:
|
2013-10-01 04:27:45 +04:00
|
|
|
intr GetChildProperty(PPluginIdentifier aId)
|
2010-04-08 04:16:19 +04:00
|
|
|
returns (bool aHasProperty,
|
|
|
|
bool aHasMethod,
|
|
|
|
Variant aResult,
|
|
|
|
bool aSuccess);
|
2009-09-09 10:31:35 +04:00
|
|
|
};
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2009-09-09 10:31:35 +04:00
|
|
|
} // namespace plugins
|
|
|
|
} // namespace mozilla
|