Bug 1494333 - index crons just like artifacts r=Callek
[gecko.git] / dom / html / nsIHTMLDocument.h
blob742e90b089bbb18bcd61bedecb4d8de810a21d9c
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"
13 class nsIContent;
14 class nsContentList;
16 #define NS_IHTMLDOCUMENT_IID \
17 { 0xcf814492, 0x303c, 0x4718, \
18 { 0x9a, 0x3e, 0x39, 0xbc, 0xd5, 0x2c, 0x10, 0xdb } }
20 /**
21 * HTML document extensions to nsIDocument.
23 class nsIHTMLDocument : public nsISupports
25 public:
26 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHTMLDOCUMENT_IID)
28 /**
29 * Set compatibility mode for this document
31 virtual void SetCompatibilityMode(nsCompatibility aMode) = 0;
33 /**
34 * Called when form->BindToTree() is called so that document knows
35 * immediately when a form is added
37 virtual void AddedForm() = 0;
38 /**
39 * Called when form->SetDocument() is called so that document knows
40 * immediately when a form is removed
42 virtual void RemovedForm() = 0;
43 /**
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,
48 // not the rest?
49 virtual int32_t GetNumFormsSynchronous() = 0;
51 virtual bool IsWriting() = 0;
53 /**
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,
63 int32_t aChange) = 0;
65 enum EditingState {
66 eTearingDown = -2,
67 eSettingUp = -1,
68 eOff = 0,
69 eDesignMode,
70 eContentEditable
73 /**
74 * Returns whether the document is editable.
76 bool IsEditingOn()
78 return GetEditingState() == eDesignMode ||
79 GetEditingState() == eContentEditable;
82 /**
83 * Returns the editing state of the document (not editable, contentEditable or
84 * designMode).
86 virtual EditingState GetEditingState() = 0;
88 /**
89 * Set the editing state of the document. Don't use this if you want
90 * to enable/disable editing, call EditingStateChanged() or
91 * SetDesignMode().
93 virtual nsresult SetEditingState(EditingState aState) = 0;
95 /**
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 */