dom/xslt/xslt/txMozillaTextOutput.h
author Ehsan Akhgari <ehsan@mozilla.com>
Mon, 01 Sep 2014 18:00:53 -0400
changeset 202897 da6c71a8f5ae293ea58368d928ff3faf9ef0f1e9
parent 162342 67ff9392766b53c51bb876b5f74e5e6602347668
child 202904 912065e39dc3ab54f89582c3e1c964a98201a124
permissions -rw-r--r--
Bug 1060987 - Fix more bad implicit constructors in DOM; r=baku

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* 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 TRANSFRMX_MOZILLA_TEXT_OUTPUT_H
#define TRANSFRMX_MOZILLA_TEXT_OUTPUT_H

#include "txXMLEventHandler.h"
#include "nsCOMPtr.h"
#include "nsWeakPtr.h"
#include "txOutputFormat.h"

class nsIDOMCharacterData;
class nsIDOMDocument;
class nsIDOMDocumentFragment;
class nsITransformObserver;
class nsIDocument;
class nsIContent;

class txMozillaTextOutput : public txAOutputXMLEventHandler
{
public:
    explicit txMozillaTextOutput(nsITransformObserver* aObserver);
    explicit txMozillaTextOutput(nsIDOMDocumentFragment* aDest);
    virtual ~txMozillaTextOutput();

    TX_DECL_TXAXMLEVENTHANDLER
    TX_DECL_TXAOUTPUTXMLEVENTHANDLER

    nsresult createResultDocument(nsIDOMDocument* aSourceDocument,
                                  bool aLoadedAsData);

private:
    nsresult createXHTMLElement(nsIAtom* aName, nsIContent** aResult);

    nsCOMPtr<nsIContent> mTextParent;
    nsWeakPtr mObserver;
    nsCOMPtr<nsIDocument> mDocument;
    txOutputFormat mOutputFormat;
    nsString mText;
};

#endif