2004-10-08 00:59:53 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2004-12-02 01:27:03 +03:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-10-08 00:59:53 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
2004-12-02 01:27:03 +03:00
|
|
|
* 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
|
2004-10-08 00:59:53 +04:00
|
|
|
* 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 Mozilla XTF project.
|
|
|
|
*
|
2004-12-02 01:27:03 +03:00
|
|
|
* The Initial Developer of the Original Code is
|
2004-10-08 00:59:53 +04:00
|
|
|
* Alex Fritze.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2004
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
2004-12-02 01:27:03 +03:00
|
|
|
* Alex Fritze <alex@croczilla.com> (original author)
|
2006-10-08 18:15:02 +04:00
|
|
|
* Olli Pettay <Olli.Pettay@helsinki.fi>
|
2004-10-08 00:59:53 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-12-02 01:27:03 +03:00
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
2004-10-08 00:59:53 +04:00
|
|
|
* 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
|
2004-12-02 01:27:03 +03:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2004-10-08 00:59:53 +04:00
|
|
|
* 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 MPL, the GPL or the LGPL.
|
|
|
|
*
|
2004-12-02 01:27:03 +03:00
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2004-10-08 00:59:53 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
interface nsIAtom;
|
|
|
|
interface nsIDOMDocument;
|
|
|
|
interface nsIDOMElement;
|
|
|
|
interface nsIDOMNode;
|
2007-02-13 18:02:57 +03:00
|
|
|
interface nsIDOMAttr;
|
2004-10-13 20:05:13 +04:00
|
|
|
interface nsIDOMEvent;
|
2006-10-08 18:15:02 +04:00
|
|
|
interface nsIXTFElementWrapper;
|
2004-10-08 00:59:53 +04:00
|
|
|
|
2007-02-13 18:02:57 +03:00
|
|
|
[scriptable, uuid(4f144387-796d-4baf-8641-5db45dba1808)]
|
2004-10-08 00:59:53 +04:00
|
|
|
interface nsIXTFElement : nsISupports
|
|
|
|
{
|
2006-10-08 18:15:02 +04:00
|
|
|
// onCreated will be called before any notifications are sent to
|
|
|
|
// the xtf element.
|
|
|
|
//
|
|
|
|
// @param wrapper is a weak proxy to the wrapping element
|
|
|
|
// (i.e. holding a reference to this will not create a cycle).
|
|
|
|
void onCreated(in nsIXTFElementWrapper wrapper);
|
|
|
|
|
2004-10-08 00:59:53 +04:00
|
|
|
// called when the wrapper object is being destroyed.
|
|
|
|
void onDestroyed();
|
|
|
|
|
|
|
|
// If isAttributeHandler is set to 'true', the xtf element indicates
|
|
|
|
// that it wants to manage its own attributes. In this case it needs
|
|
|
|
// to implement the nsIXTFAttributeHandler interface in addition to
|
|
|
|
// its other interfaces. 'isAttributeHandler' must remain constant
|
|
|
|
// for the entire lifetime of the xtf element (i.e. before any
|
|
|
|
// onCreated()-calls until after onDestroyed()-calls).
|
|
|
|
readonly attribute boolean isAttributeHandler;
|
|
|
|
|
|
|
|
// getScriptingInterfaces: This array serves 2 purposes: a) All
|
|
|
|
// interfaces in this array will automatically be accessible when
|
|
|
|
// our wrapper element is used from JS (other interfaces need to be
|
|
|
|
// explicitly QI'ed for), and b) All these interfaces are callable
|
|
|
|
// from unpriviliged script.
|
2006-10-08 18:15:02 +04:00
|
|
|
// @note 'Normal' DOM interfaces are always automatically scriptable.
|
2004-10-08 00:59:53 +04:00
|
|
|
void getScriptingInterfaces(out unsigned long count,
|
|
|
|
[array, size_is(count), retval] out nsIIDPtr array);
|
|
|
|
|
|
|
|
// Notification mask constants:
|
|
|
|
// To receive a given event set the corresponding bit in
|
|
|
|
// nsIXTFElementWrapper::notificationMask.
|
|
|
|
const unsigned long NOTIFY_WILL_CHANGE_DOCUMENT = 0x00000001;
|
|
|
|
const unsigned long NOTIFY_DOCUMENT_CHANGED = 0x00000002;
|
|
|
|
|
|
|
|
const unsigned long NOTIFY_WILL_CHANGE_PARENT = 0x00000004;
|
|
|
|
const unsigned long NOTIFY_PARENT_CHANGED = 0x00000008;
|
|
|
|
|
|
|
|
const unsigned long NOTIFY_WILL_INSERT_CHILD = 0x00000010;
|
|
|
|
const unsigned long NOTIFY_CHILD_INSERTED = 0x00000020;
|
|
|
|
|
|
|
|
const unsigned long NOTIFY_WILL_APPEND_CHILD = 0x00000040;
|
|
|
|
const unsigned long NOTIFY_CHILD_APPENDED = 0x00000080;
|
|
|
|
|
|
|
|
const unsigned long NOTIFY_WILL_REMOVE_CHILD = 0x00000100;
|
|
|
|
const unsigned long NOTIFY_CHILD_REMOVED = 0x00000200;
|
|
|
|
|
|
|
|
const unsigned long NOTIFY_WILL_SET_ATTRIBUTE = 0x00000400;
|
|
|
|
const unsigned long NOTIFY_ATTRIBUTE_SET = 0x00000800;
|
|
|
|
|
|
|
|
const unsigned long NOTIFY_WILL_REMOVE_ATTRIBUTE = 0x00001000;
|
|
|
|
const unsigned long NOTIFY_ATTRIBUTE_REMOVED = 0x00002000;
|
|
|
|
|
2004-11-10 02:59:24 +03:00
|
|
|
const unsigned long NOTIFY_BEGIN_ADDING_CHILDREN = 0x00004000;
|
|
|
|
const unsigned long NOTIFY_DONE_ADDING_CHILDREN = 0x00008000;
|
2004-10-08 00:59:53 +04:00
|
|
|
|
2004-11-10 02:59:24 +03:00
|
|
|
const unsigned long NOTIFY_HANDLE_DEFAULT = 0x00010000;
|
2007-02-13 18:02:57 +03:00
|
|
|
|
|
|
|
const unsigned long NOTIFY_PERFORM_ACCESSKEY = 0x00020000;
|
|
|
|
|
2004-10-08 00:59:53 +04:00
|
|
|
// Event notifications:
|
|
|
|
|
|
|
|
void willChangeDocument(in nsIDOMDocument newDoc);
|
|
|
|
void documentChanged(in nsIDOMDocument newDoc);
|
|
|
|
|
|
|
|
void willChangeParent(in nsIDOMElement newParent);
|
|
|
|
void parentChanged(in nsIDOMElement newParent);
|
|
|
|
|
|
|
|
void willInsertChild(in nsIDOMNode child, in unsigned long index);
|
|
|
|
void childInserted(in nsIDOMNode child, in unsigned long index);
|
|
|
|
|
|
|
|
void willAppendChild(in nsIDOMNode child);
|
|
|
|
void childAppended(in nsIDOMNode child);
|
|
|
|
|
|
|
|
void willRemoveChild(in unsigned long index);
|
|
|
|
void childRemoved(in unsigned long index);
|
|
|
|
|
|
|
|
void willSetAttribute(in nsIAtom name, in AString newValue);
|
|
|
|
void attributeSet(in nsIAtom name, in AString newValue);
|
|
|
|
|
|
|
|
void willRemoveAttribute(in nsIAtom name);
|
|
|
|
void attributeRemoved(in nsIAtom name);
|
|
|
|
|
2004-11-10 02:59:24 +03:00
|
|
|
// These are for batching of child insertions during document load
|
2004-12-07 02:09:32 +03:00
|
|
|
|
|
|
|
// beginAddingChildren is called before any attributes or child nodes are
|
|
|
|
// added to the element.
|
2004-11-10 02:59:24 +03:00
|
|
|
void beginAddingChildren();
|
2004-10-08 00:59:53 +04:00
|
|
|
void doneAddingChildren();
|
2004-10-13 20:05:13 +04:00
|
|
|
|
|
|
|
// The default handler for DOM Events.
|
|
|
|
// This method is called after the normal DOM event flow.
|
|
|
|
// If the return value is true, the event is marked as handled and
|
|
|
|
// other default handlers won't be able to handle it again.
|
|
|
|
boolean handleDefault(in nsIDOMEvent aEvent);
|
2005-01-28 06:49:44 +03:00
|
|
|
|
|
|
|
// Set this element to be equivalent to |aElement|. This does not need
|
|
|
|
// to worry about copying attributes or child nodes, but should copy any
|
|
|
|
// other needed state.
|
|
|
|
void cloneState(in nsIDOMElement aElement);
|
2007-02-13 18:02:57 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns accesskey attribute node.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDOMAttr accesskeyNode;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Performs accesskey. The method is called when accesskey is activated.
|
|
|
|
*/
|
|
|
|
void performAccesskey();
|
2004-10-08 00:59:53 +04:00
|
|
|
};
|
|
|
|
|