Bug 1879816: Make nsCocoaWindow::Destroy close the window and let destruction happen...
[gecko.git] / dom / serializers / nsDOMSerializer.h
blob21a898f712ffe1738e0d468c9e97cae192624011
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 nsDOMSerializer_h_
8 #define nsDOMSerializer_h_
10 #include "mozilla/dom/NonRefcountedDOMObject.h"
11 #include "mozilla/dom/XMLSerializerBinding.h"
13 class nsINode;
14 class nsIOutputStream;
16 namespace mozilla {
17 class ErrorResult;
20 class nsDOMSerializer final : public mozilla::dom::NonRefcountedDOMObject {
21 public:
22 nsDOMSerializer();
24 // WebIDL API
25 static mozilla::UniquePtr<nsDOMSerializer> Constructor(
26 const mozilla::dom::GlobalObject& aOwner) {
27 return mozilla::MakeUnique<nsDOMSerializer>();
30 void SerializeToString(nsINode& aRoot, nsAString& aStr,
31 mozilla::ErrorResult& rv);
33 void SerializeToStream(nsINode& aRoot, nsIOutputStream* aStream,
34 const nsAString& aCharset, mozilla::ErrorResult& aRv);
36 bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto,
37 JS::MutableHandle<JSObject*> aReflector) {
38 return mozilla::dom::XMLSerializer_Binding::Wrap(aCx, this, aGivenProto,
39 aReflector);
43 #endif