diff options
Diffstat (limited to 'dom/xslt/xslt/txRtfHandler.h')
-rw-r--r-- | dom/xslt/xslt/txRtfHandler.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/dom/xslt/xslt/txRtfHandler.h b/dom/xslt/xslt/txRtfHandler.h new file mode 100644 index 0000000000..ee0debf1a0 --- /dev/null +++ b/dom/xslt/xslt/txRtfHandler.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#ifndef txRtfHandler_h___ +#define txRtfHandler_h___ + +#include "mozilla/Attributes.h" +#include "txBufferingHandler.h" +#include "txExprResult.h" +#include "txXPathNode.h" + +class txResultTreeFragment : public txAExprResult { + public: + explicit txResultTreeFragment(mozilla::UniquePtr<txResultBuffer>&& aBuffer); + + TX_DECL_EXPRRESULT + + nsresult flushToHandler(txAXMLEventHandler* aHandler); + + void setNode(const txXPathNode* aNode) { + NS_ASSERTION(!mNode, "Already converted!"); + + mNode = mozilla::WrapUnique(aNode); + } + const txXPathNode* getNode() const { return mNode.get(); } + + private: + mozilla::UniquePtr<txResultBuffer> mBuffer; + mozilla::UniquePtr<const txXPathNode> mNode; +}; + +class txRtfHandler : public txBufferingHandler { + public: + nsresult getAsRTF(txAExprResult** aResult); + + nsresult endDocument(nsresult aResult) override; + nsresult startDocument() override; +}; + +#endif /* txRtfHandler_h___ */ |