Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtGui.QTextDocumentWriter Class Reference

The QTextDocumentWriter class provides a format-independent interface for writing a QTextDocument to files or other devices. More...

Inheritance diagram for QtGui.QTextDocumentWriter:
Collaboration diagram for QtGui.QTextDocumentWriter:

Public Member Functions

 QTextDocumentWriter ()
 
 
 QTextDocumentWriter (QIODevice device, QByteArray format)
 
 
 QTextDocumentWriter (string fileName)
 
 
 QTextDocumentWriter (string fileName, QByteArray format)
 
 
virtual void CreateProxy ()
 
new bool Write (QTextDocument document)
 
 
new bool Write (QTextDocumentFragment fragment)
 
 
new void Dispose ()
 

Static Public Member Functions

static
System.Collections.Generic.List
< QByteArray
SupportedDocumentFormats ()
 
 

Protected Member Functions

 QTextDocumentWriter (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

new QTextCodec Codec [get, set]
 
 
new QIODevice Device [get, set]
 
 
new string FileName [get, set]
 
 
new QByteArray Format [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QTextDocumentWriter class provides a format-independent interface for writing a QTextDocument to files or other devices.

To write a document, construct a QTextDocumentWriter object with either a file name or a device object, and specify the document format to be written. You can construct a writer and set the format using setFormat() later.

Call write() to write the document to the device. If the document is successfully written, this function returns true. However, if an error occurs when writing the document, it will return false.

Call supportedDocumentFormats() for a list of formats that QTextDocumentWriter can write.

Since the capabilities of the supported output formats vary considerably, the writer simply outputs the appropriate subset of objects for each format. This typically includes the formatted text and images contained in a document.

Constructor & Destructor Documentation

QtGui.QTextDocumentWriter.QTextDocumentWriter ( System.Type  dummy)
protected
QtGui.QTextDocumentWriter.QTextDocumentWriter ( )

Constructs an empty QTextDocumentWriter object. Before writing, you must call setFormat() to set a document format, then setDevice() or setFileName().

QtGui.QTextDocumentWriter.QTextDocumentWriter ( QIODevice  device,
QByteArray  format 
)

Constructs a QTextDocumentWriter object to write to the given device in the document format specified by format.

QtGui.QTextDocumentWriter.QTextDocumentWriter ( string  fileName)

Constructs an empty QTextDocumentWriter object. Before writing, you must call setFormat() to set a document format, then setDevice() or setFileName().

QtGui.QTextDocumentWriter.QTextDocumentWriter ( string  fileName,
QByteArray  format 
)

Constructs an empty QTextDocumentWriter object. Before writing, you must call setFormat() to set a document format, then setDevice() or setFileName().

Member Function Documentation

virtual void QtGui.QTextDocumentWriter.CreateProxy ( )
virtual
new void QtGui.QTextDocumentWriter.Dispose ( )
static System.Collections.Generic.List<QByteArray> QtGui.QTextDocumentWriter.SupportedDocumentFormats ( )
static

Returns the list of document formats supported by QTextDocumentWriter.

By default, Qt can write the following formats:

FormatDescription

plaintext Plain text

HTML HyperText Markup Language

ODF OpenDocument Format

See also setFormat().

new bool QtGui.QTextDocumentWriter.Write ( QTextDocument  document)

Writes the given document to the assigned device or file and returns true if successful; otherwise returns false.

new bool QtGui.QTextDocumentWriter.Write ( QTextDocumentFragment  fragment)

Writes the document fragment specified by fragment to the assigned device or file and returns true if successful; otherwise returns false.

Member Data Documentation

SmokeInvocation QtGui.QTextDocumentWriter.interceptor
protected

Property Documentation

new QTextCodec QtGui.QTextDocumentWriter.Codec
getset

Returns the codec that is currently assigned to the writer.

Sets the codec for this stream to codec. The codec is used for encoding any data that is written. By default, QTextDocumentWriter uses UTF-8.

new QIODevice QtGui.QTextDocumentWriter.Device
getset

Returns the device currently assigned, or 0 if no device has been assigned.

Sets the writer's device to the device specified. If a device has already been set, the old device is removed but otherwise left unchanged.

If the device is not already open, QTextDocumentWriter will attempt to open the device in QIODevice::WriteOnly mode by calling open().

Note: This will not work for certain devices, such as QProcess, QTcpSocket and QUdpSocket, where some configuration is required before the device can be opened.

new string QtGui.QTextDocumentWriter.FileName
getset

If the currently assigned device is a QFile, or if setFileName() has been called, this function returns the name of the file to be written to. In all other cases, it returns an empty string.

Sets the name of the file to be written to fileName. Internally, QTextDocumentWriter will create a QFile and open it in QIODevice::WriteOnly mode, and use this file when writing the document.

new QByteArray QtGui.QTextDocumentWriter.Format
getset

Returns the format used for writing documents.

Sets the format used to write documents to the format specified. format is a case insensitive text string. For example:

QTextDocumentWriter writer;

writer.setFormat("odf"); // same as writer.setFormat("ODF");

You can call supportedDocumentFormats() for the full list of formats QTextDocumentWriter supports.

virtual System.IntPtr QtGui.QTextDocumentWriter.SmokeObject
getset