Bug 1874684 - Part 4: Prefer const references instead of copying Instant values....
[gecko.git] / dom / xslt / xslt / txRtfHandler.h
blobee0debf1a04934c3175508a0940fe50f1d4a7b88
1 /* -*- Mode: C++; tab-width: 4; 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/. */
6 #ifndef txRtfHandler_h___
7 #define txRtfHandler_h___
9 #include "mozilla/Attributes.h"
10 #include "txBufferingHandler.h"
11 #include "txExprResult.h"
12 #include "txXPathNode.h"
14 class txResultTreeFragment : public txAExprResult {
15 public:
16 explicit txResultTreeFragment(mozilla::UniquePtr<txResultBuffer>&& aBuffer);
18 TX_DECL_EXPRRESULT
20 nsresult flushToHandler(txAXMLEventHandler* aHandler);
22 void setNode(const txXPathNode* aNode) {
23 NS_ASSERTION(!mNode, "Already converted!");
25 mNode = mozilla::WrapUnique(aNode);
27 const txXPathNode* getNode() const { return mNode.get(); }
29 private:
30 mozilla::UniquePtr<txResultBuffer> mBuffer;
31 mozilla::UniquePtr<const txXPathNode> mNode;
34 class txRtfHandler : public txBufferingHandler {
35 public:
36 nsresult getAsRTF(txAExprResult** aResult);
38 nsresult endDocument(nsresult aResult) override;
39 nsresult startDocument() override;
42 #endif /* txRtfHandler_h___ */