pjs/java/pluggable-jvm/wf_moz6/public/nsIJavaHTMLObject.idl

130 строки
3.8 KiB
Plaintext

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: nsIJavaHTMLObject.idl,v 1.1 2001-05-10 18:12:41 edburns%acm.org Exp $
*
*
* Contributor(s):
*
* Nikolay N. Igotti <inn@sparc.spb.su>
*/
#include "nsoji2.idl"
#include "nsIPluggableJVM.idl"
%{C++
#include "nsIDOMElement.h"
%}
native nsIDOMElement(nsIDOMElement*);
/**
* this is instance of visible object on browser's page controlled by
* Java code, like <APPLET> or <OBJECT> tag content.
*/
[scriptable, uuid(d0bc700b-aadb-417f-b584-5d644bb3432f)]
interface nsIJavaHTMLObject : nsISupports {
/**
* Initialization stuff. Used by browser when it wishes to create
* Java-driven object on page. Argument is nsISupports
* to simplify using new OJI module - it can be nsIPluginInstancePeer
* for older cases and smth else in the future.
* Second one argument is JVM which should be responsible for this object.
*/
void Initialize(in nsISupports peer, in nsIPluggableJVM jvm);
/**
* Starts/resumes this object's operations.
*/
void Start();
/**
* Stops/suspends this object's operations
*/
void Stop();
/**
* Die!
*/
void Destroy();
/**
* Method to set drawing window.
* I intentionally will not allow generic Java object here to
* avoid mess. Register window in nsIPluggableJVM first (from C++) or
* in Plugin class (from Java).
*/
[noscript] void SetWindow(in jp_jint ID);
/**
* Get object peer in browser/host application.
*/
void GetPeer(out nsISupports peer);
/**
* Set type of this Java object
*/
[noscript] void SetType(in jp_jint type);
/**
* Get Java JSObject for this object.
*/
[noscript] void GetJavaPeer(out jp_jobject ID);
// can ask owner document from this guy
[noscript] void GetDOMElement(out nsIDOMElement result);
/**
* Methods called by Java side
*/
[noscript] void PostEvent(in jp_jint event, in jp_jlong data);
[noscript] void SendEvent(in jp_jint event, in jp_jlong data);
// peer event types, synchronize with HostObjectPeer.java
const long PE_NOPE = 0;
const long PE_CREATE = 1;
const long PE_SETWINDOW = 2;
const long PE_DESTROY = 3;
const long PE_START = 4;
const long PE_STOP = 5;
const long PE_NEWPARAMS = 6;
const long PE_SETTYPE = 7;
// generic event sent by browser
const long PE_PEEREVENT = 8;
const long PE_GETPEER = 9;
// java event types
const long JE_NOPE = 0;
const long JE_SHOWSTATUS = 1;
const long JE_SHOWDOCUMENT = 2;
// generic event sent by applet
const long JE_APPLETEVENT = 3;
// error requiring browser's attention happened in applet
const long JE_APPLETERROR = 4;
// error requiring browser's attention happened in JVM
const long JE_JVMERROR = 5;
// peer's host applications
const long PV_UNKNOWN = 0;
const long PV_MOZILLA6 = 1;
// peer's types
const long PT_UNKNOWN = 0;
const long PT_EMBED = 1;
const long PT_OBJECT = 2;
const long PT_APPLET = 3;
const long PT_PLUGLET = 4;
};