1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsIHTMLDocument_h
8 #define nsIHTMLDocument_h
10 #include "nsISupports.h"
11 #include "nsCompatibility.h"
16 #define NS_IHTMLDOCUMENT_IID \
17 { 0xcf814492, 0x303c, 0x4718, \
18 { 0x9a, 0x3e, 0x39, 0xbc, 0xd5, 0x2c, 0x10, 0xdb } }
21 * HTML document extensions to nsIDocument.
23 class nsIHTMLDocument
: public nsISupports
26 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHTMLDOCUMENT_IID
)
29 * Set compatibility mode for this document
31 virtual void SetCompatibilityMode(nsCompatibility aMode
) = 0;
34 * Called when form->BindToTree() is called so that document knows
35 * immediately when a form is added
37 virtual void AddedForm() = 0;
39 * Called when form->SetDocument() is called so that document knows
40 * immediately when a form is removed
42 virtual void RemovedForm() = 0;
44 * Called to get a better count of forms than document.forms can provide
45 * without calling FlushPendingNotifications (bug 138892).
47 // XXXbz is this still needed now that we can flush just content,
49 virtual int32_t GetNumFormsSynchronous() = 0;
51 virtual bool IsWriting() = 0;
54 * Should be called when an element's editable changes as a result of
55 * changing its contentEditable attribute/property.
57 * @param aElement the element for which the contentEditable
58 * attribute/property was changed
59 * @param aChange +1 if the contentEditable attribute/property was changed to
60 * true, -1 if it was changed to false
62 virtual nsresult
ChangeContentEditableCount(nsIContent
*aElement
,
74 * Returns whether the document is editable.
78 return GetEditingState() == eDesignMode
||
79 GetEditingState() == eContentEditable
;
83 * Returns the editing state of the document (not editable, contentEditable or
86 virtual EditingState
GetEditingState() = 0;
89 * Set the editing state of the document. Don't use this if you want
90 * to enable/disable editing, call EditingStateChanged() or
93 virtual nsresult
SetEditingState(EditingState aState
) = 0;
96 * Disables getting and setting cookies
98 virtual void DisableCookieAccess() = 0;
101 * Called when this nsIHTMLDocument's editor is destroyed.
103 virtual void TearingDownEditor() = 0;
105 virtual void SetIsXHTML(bool aXHTML
) = 0;
107 virtual void SetDocWriteDisabled(bool aDisabled
) = 0;
110 NS_DEFINE_STATIC_IID_ACCESSOR(nsIHTMLDocument
, NS_IHTMLDOCUMENT_IID
)
112 #endif /* nsIHTMLDocument_h */