2001-09-25 01:32:19 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
1998-12-24 05:07:14 +00:00
|
|
|
|
1999-10-05 21:13:55 +00:00
|
|
|
#ifndef nsIXULDocument_h___
|
|
|
|
#define nsIXULDocument_h___
|
1998-12-24 05:07:14 +00:00
|
|
|
|
2003-03-26 07:41:30 +00:00
|
|
|
#include "nsISupports.h"
|
2001-02-03 01:16:20 +00:00
|
|
|
#include "nsString.h"
|
2007-01-28 13:17:27 +00:00
|
|
|
#include "nsCOMArray.h"
|
1998-12-24 05:07:14 +00:00
|
|
|
|
2001-03-23 10:56:18 +00:00
|
|
|
class nsIXULTemplateBuilder;
|
2003-04-22 21:57:25 +00:00
|
|
|
class nsIContent;
|
1998-12-24 05:07:14 +00:00
|
|
|
|
2007-04-27 14:15:25 +00:00
|
|
|
|
2013-02-15 16:22:51 +00:00
|
|
|
// 81ba4be5-6cc5-478a-9b08-b3e7ed524455
|
2003-03-26 07:41:30 +00:00
|
|
|
#define NS_IXULDOCUMENT_IID \
|
2013-02-15 16:22:51 +00:00
|
|
|
{0x81ba4be5, 0x6cc5, 0x478a, {0x9b, 0x08, 0xb3, 0xe7, 0xed, 0x52, 0x44, 0x55}}
|
2007-01-28 13:17:27 +00:00
|
|
|
|
1998-12-24 05:07:14 +00:00
|
|
|
|
2006-11-11 22:27:00 +00:00
|
|
|
/*
|
|
|
|
* An XUL-specific extension to nsIDocument. Includes methods for
|
|
|
|
* setting the root resource of the document content model, a factory
|
|
|
|
* method for constructing the children of a node, etc.
|
1998-12-24 05:07:14 +00:00
|
|
|
*/
|
2003-03-26 07:41:30 +00:00
|
|
|
class nsIXULDocument : public nsISupports
|
1999-01-12 19:41:06 +00:00
|
|
|
{
|
1998-12-24 05:07:14 +00:00
|
|
|
public:
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXULDOCUMENT_IID)
|
1999-02-01 22:34:51 +00:00
|
|
|
|
1999-05-28 11:30:59 +00:00
|
|
|
/**
|
2008-06-23 01:48:05 +00:00
|
|
|
* Get the elements for a particular resource --- all elements whose 'id'
|
|
|
|
* or 'ref' is aID. The nsCOMArray will be truncated and filled in with
|
1999-05-28 11:30:59 +00:00
|
|
|
* nsIContent pointers.
|
|
|
|
*/
|
2010-06-22 03:00:26 +00:00
|
|
|
virtual void GetElementsForID(const nsAString& aID, nsCOMArray<nsIContent>& aElements) = 0;
|
1999-02-09 03:15:41 +00:00
|
|
|
|
2001-02-20 01:05:34 +00:00
|
|
|
/**
|
|
|
|
* Notify the XUL document that a subtree has been added
|
|
|
|
*/
|
|
|
|
NS_IMETHOD AddSubtreeToDocument(nsIContent* aElement) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify the XUL document that a subtree has been removed
|
|
|
|
*/
|
|
|
|
NS_IMETHOD RemoveSubtreeFromDocument(nsIContent* aElement) = 0;
|
2001-03-23 10:56:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Attach a XUL template builder to the specified content node.
|
2005-11-25 21:57:13 +00:00
|
|
|
* @param aBuilder the template builder to attach, or null if
|
2001-03-23 10:56:18 +00:00
|
|
|
* the builder is to be removed.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD SetTemplateBuilderFor(nsIContent* aContent, nsIXULTemplateBuilder* aBuilder) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve the XUL template builder that's attached to a content
|
|
|
|
* node.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetTemplateBuilderFor(nsIContent* aContent, nsIXULTemplateBuilder** aResult) = 0;
|
2001-07-31 19:05:34 +00:00
|
|
|
|
|
|
|
/**
|
2006-11-11 22:27:00 +00:00
|
|
|
* This is invoked whenever the prototype for this document is loaded
|
|
|
|
* and should be walked, regardless of whether the XUL cache is
|
|
|
|
* disabled, whether the protototype was loaded, whether the
|
|
|
|
* prototype was loaded from the cache or created by parsing the
|
|
|
|
* actual XUL source, etc.
|
|
|
|
*
|
|
|
|
* @param aResumeWalk whether this should also call ResumeWalk().
|
|
|
|
* Sometimes the caller of OnPrototypeLoadDone resumes the walk itself
|
2001-07-31 19:05:34 +00:00
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
NS_IMETHOD OnPrototypeLoadDone(bool aResumeWalk) = 0;
|
2006-06-06 14:08:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback notifying when a document could not be parsed properly.
|
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual bool OnDocumentParserError() = 0;
|
2009-07-29 18:33:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Reset the document direction so that it is recomputed.
|
|
|
|
*/
|
|
|
|
virtual void ResetDocumentDirection() = 0;
|
2009-10-02 06:22:18 +00:00
|
|
|
|
|
|
|
virtual void ResetDocumentLWTheme() = 0;
|
1998-12-24 05:07:14 +00:00
|
|
|
};
|
|
|
|
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIXULDocument, NS_IXULDOCUMENT_IID)
|
|
|
|
|
1998-12-24 05:07:14 +00:00
|
|
|
// factory functions
|
1999-10-05 21:13:55 +00:00
|
|
|
nsresult NS_NewXULDocument(nsIXULDocument** result);
|
1998-12-24 05:07:14 +00:00
|
|
|
|
1999-10-05 21:13:55 +00:00
|
|
|
#endif // nsIXULDocument_h___
|