HTMLTitleElement.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_dom_HTMLTITLEElement_h_
  6. #define mozilla_dom_HTMLTITLEElement_h_
  7. #include "mozilla/Attributes.h"
  8. #include "nsGenericHTMLElement.h"
  9. #include "nsStubMutationObserver.h"
  10. namespace mozilla {
  11. class ErrorResult;
  12. namespace dom {
  13. class HTMLTitleElement final : public nsGenericHTMLElement,
  14. public nsStubMutationObserver
  15. {
  16. public:
  17. using Element::GetText;
  18. using Element::SetText;
  19. explicit HTMLTitleElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
  20. // nsISupports
  21. NS_DECL_ISUPPORTS_INHERITED
  22. //HTMLTitleElement
  23. void GetText(DOMString& aText, ErrorResult& aError);
  24. void SetText(const nsAString& aText, ErrorResult& aError);
  25. // nsIMutationObserver
  26. NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
  27. NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
  28. NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
  29. NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
  30. virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
  31. virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
  32. nsIContent *aBindingParent,
  33. bool aCompileEventHandlers) override;
  34. virtual void UnbindFromTree(bool aDeep = true,
  35. bool aNullParent = true) override;
  36. virtual void DoneAddingChildren(bool aHaveNotified) override;
  37. protected:
  38. virtual ~HTMLTitleElement();
  39. virtual JSObject* WrapNode(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
  40. override final;
  41. private:
  42. void SendTitleChangeEvent(bool aBound);
  43. };
  44. } // namespace dom
  45. } // namespace mozilla
  46. #endif // mozilla_dom_HTMLTitleElement_h_