summaryrefslogtreecommitdiffstats
path: root/dom/xslt/xslt/txOutputFormat.h
blob: 6ff4e22ca0d1c8272693fc0941ce8471804c9758 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* -*- 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_OUTPUTFORMAT_H
#define TRANSFRMX_OUTPUTFORMAT_H

#include "txList.h"
#include "nsString.h"

enum txOutputMethod {
    eMethodNotSet,
    eXMLOutput,
    eHTMLOutput,
    eTextOutput
};

enum txThreeState {
    eNotSet,
    eFalse,
    eTrue
};

class txOutputFormat {
public:
    txOutputFormat();
    ~txOutputFormat();

    // "Unset" all values
    void reset();

    // Merges in the values of aOutputFormat, members that already
    // have a value in this txOutputFormat will not be changed.
    void merge(txOutputFormat& aOutputFormat);

    // Sets members that have no value to their default value.
    void setFromDefaults();

    // The XSLT output method, which can be "xml", "html", or "text"
    txOutputMethod mMethod;

    // The xml version number that should be used when serializing
    // xml documents
    nsString mVersion;

    // The XML character encoding that should be used when serializing
    // xml documents
    nsString mEncoding;

    // Signals if we should output an XML declaration
    txThreeState mOmitXMLDeclaration;

    // Signals if we should output a standalone document declaration
    txThreeState mStandalone;

    // The public Id for creating a DOCTYPE
    nsString mPublicId;

    // The System Id for creating a DOCTYPE
    nsString mSystemId;

    // The elements whose text node children should be output as CDATA
    txList mCDATASectionElements;

    // Signals if output should be indented
    txThreeState mIndent;

    // The media type of the output
    nsString mMediaType;
};

#endif