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
{
16 explicit txResultTreeFragment(mozilla::UniquePtr
<txResultBuffer
>&& aBuffer
);
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(); }
30 mozilla::UniquePtr
<txResultBuffer
> mBuffer
;
31 mozilla::UniquePtr
<const txXPathNode
> mNode
;
34 class txRtfHandler
: public txBufferingHandler
{
36 nsresult
getAsRTF(txAExprResult
** aResult
);
38 nsresult
endDocument(nsresult aResult
) override
;
39 nsresult
startDocument() override
;
42 #endif /* txRtfHandler_h___ */