2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04: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/. */
|
2006-04-20 07:36:50 +04:00
|
|
|
|
2012-12-04 05:26:16 +04:00
|
|
|
#ifndef nsDOMSerializer_h_
|
|
|
|
#define nsDOMSerializer_h_
|
2006-04-20 07:36:50 +04:00
|
|
|
|
2018-04-09 23:30:33 +03:00
|
|
|
#include "mozilla/dom/NonRefcountedDOMObject.h"
|
2012-12-04 05:26:16 +04:00
|
|
|
#include "mozilla/ErrorResult.h"
|
|
|
|
#include "mozilla/dom/XMLSerializerBinding.h"
|
2012-12-26 03:06:15 +04:00
|
|
|
|
|
|
|
class nsINode;
|
2018-04-09 23:30:33 +03:00
|
|
|
class nsIOutputStream;
|
2006-04-20 07:36:50 +04:00
|
|
|
|
2018-04-09 23:30:33 +03:00
|
|
|
class nsDOMSerializer final : public mozilla::dom::NonRefcountedDOMObject {
|
2006-04-20 07:36:50 +04:00
|
|
|
public:
|
|
|
|
nsDOMSerializer();
|
|
|
|
|
2012-12-04 05:26:16 +04:00
|
|
|
// WebIDL API
|
2012-12-03 20:07:49 +04:00
|
|
|
static nsDOMSerializer* Constructor(const mozilla::dom::GlobalObject& aOwner,
|
|
|
|
mozilla::ErrorResult& rv) {
|
2018-04-09 23:30:33 +03:00
|
|
|
return new nsDOMSerializer();
|
2012-12-04 05:26:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void SerializeToString(nsINode& aRoot, nsAString& aStr,
|
|
|
|
mozilla::ErrorResult& rv);
|
|
|
|
|
|
|
|
void SerializeToStream(nsINode& aRoot, nsIOutputStream* aStream,
|
2018-04-09 23:30:32 +03:00
|
|
|
const nsAString& aCharset, mozilla::ErrorResult& aRv);
|
2012-12-04 05:26:16 +04:00
|
|
|
|
2018-04-09 23:30:33 +03:00
|
|
|
bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto,
|
|
|
|
JS::MutableHandle<JSObject*> aReflector) {
|
2018-06-26 00:20:54 +03:00
|
|
|
return mozilla::dom::XMLSerializer_Binding::Wrap(aCx, this, aGivenProto,
|
2018-04-09 23:30:33 +03:00
|
|
|
aReflector);
|
2012-12-04 05:26:16 +04:00
|
|
|
}
|
2006-04-20 07:36:50 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|