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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
|
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2008 Novell, Inc.
//
// Authors:
// Andreia Gaita (avidigal@novell.com)
//
using System;
namespace Mono.Mozilla.DOM
{
internal enum DocumentEncoderFlags: uint
{
/**
* Output only the selection (as opposed to the whole document).
*/
OutputSelectionOnly = (1 << 0),
/** Plaintext output: Convert html to plaintext that looks like the html.
* Implies wrap (except inside <pre>), since html wraps.
* HTML output: always do prettyprinting, ignoring existing formatting.
* (Probably not well tested for HTML output.)
*/
OutputFormatted = (1 << 1),
/** Don't do prettyprinting of HTML. Don't do any wrapping that's not in
* the existing HTML source. This option overrides OutputFormatted if both
* are set.
* @note This option does not affect entity conversion.
*/
OutputRaw = (1 << 2),
/**
* Do not print html head tags.
*/
OutputBodyOnly = (1 << 3),
/**
* Wrap even if we're not doing formatted output (e.g. for text fields)
* XXXbz this doesn't seem to be used by all serializers... document? How
* does this interact with
* OutputFormatted/OutputRaw/OutputWrap/OutputFormatFlowed?
*/
OutputPreformatted = (1 << 4),
/**
* Output as though the content is preformatted
* (e.g. maybe it's wrapped in a MOZ_PRE or MOZ_PRE_WRAP style tag)
* XXXbz this doesn't seem to be used by all serializers... document? How
* does this interact with
* OutputFormatted/OutputRaw/OutputPreformatted/OutputFormatFlowed?
*/
OutputWrap = (1 << 5),
/**
* Output for format flowed (RFC 2646). This is used when converting
* to text for mail sending. This differs just slightly
* but in an important way from normal formatted, and that is that
* lines are space stuffed. This can't (correctly) be done later.
* XXXbz this doesn't seem to be used by all serializers... document? How
* does this interact with
* OutputFormatted/OutputRaw/OutputPreformatted/OutputWrap?
*/
OutputFormatFlowed = (1 << 6),
/**
* Convert links, image src, and script src to absolute URLs when possible
*/
OutputAbsoluteLinks = (1 << 7),
/**
* Attempt to encode entities standardized at W3C (HTML, MathML, etc).
* This is a catch-all flag for documents with mixed contents. Beware of
* interoperability issues. See below for other flags which might likely
* do what you want.
*/
OutputEncodeW3CEntities = (1 << 8),
/**
* LineBreak processing: if this flag is set than CR line breaks will
* be written. If neither this nor OutputLFLineBreak is set, then we
* will use platform line breaks. The combination of the two flags will
* cause CRLF line breaks to be written.
*/
OutputCRLineBreak = (1 << 9),
/**
* LineBreak processing: if this flag is set than LF line breaks will
* be written. If neither this nor OutputCRLineBreak is set, then we
* will use platform line breaks. The combination of the two flags will
* cause CRLF line breaks to be written.
*/
OutputLFLineBreak = (1 << 10),
/**
* Output the content of noscript elements (only for serializing
* to plaintext).
*/
OutputNoScriptContent = (1 << 11),
/**
* Output the content of noframes elements (only for serializing
* to plaintext).
*/
OutputNoFramesContent = (1 << 12),
/**
* Don't allow any formatting nodes (e.g. <br>, <b>) inside a <pre>.
* This is used primarily by mail.
*/
OutputNoFormattingInPre = (1 << 13),
/**
* Encode entities when outputting to a string.
* E.g. If set, we'll output if clear, we'll output 0xa0.
* The basic set is just & < > " for interoperability
* with older products that don't support α and friends.
*/
OutputEncodeBasicEntities = (1 << 14),
/**
* Encode entities when outputting to a string.
* The Latin1 entity set additionally includes 8bit accented letters
* between 128 and 255.
*/
OutputEncodeLatin1Entities = (1 << 15),
/**
* Encode entities when outputting to a string.
* The HTML entity set additionally includes accented letters, greek
* letters, and other special markup symbols as defined in HTML4.
*/
OutputEncodeHTMLEntities = (1 << 16),
/**
* Normally is replaced with a space character when
* encoding data as plain text, set this flag if that's
* not desired.
*/
OutputPersistNBSP = (1 << 17),
}
}
|