com.trolltech.qt.svg
Class QSvgGenerator

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.svg.QSvgGenerator
All Implemented Interfaces:
QPaintDeviceInterface, QtJambiInterface

public class QSvgGenerator
extends QtJambiObject
implements QPaintDeviceInterface

The QSvgGenerator class provides a paint device that is used to create SVG drawings.

See also:
QSvgRenderer, and QSvgWidget.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
QSvgGenerator()
          Constructs a new generator.
 
Method Summary
 int depth()
          Returns the bit depth (number of bit planes) of the paint device.
 java.lang.String description()
          This property holds the description of the generated SVG drawing.
 java.lang.String fileName()
          This property holds the target filename for the generated SVG drawing.
 int height()
          Returns the height of the paint device in default coordinate system units (e.
 int heightMM()
          Returns the height of the paint device in millimeters.
 int logicalDpiX()
          Returns the horizontal resolution of the device in dots per inch, which is used when computing font sizes.
 int logicalDpiY()
          Returns the vertical resolution of the device in dots per inch, which is used when computing font sizes.
 int metric(QPaintDevice.PaintDeviceMetric metric)
          Returns the metric information for the given paint device metric.
 int numColors()
          Returns the number of different colors available for the paint device.
 QIODevice outputDevice()
          This property holds the output device for the generated SVG drawing.
 QPaintEngine paintEngine()
          Returns a pointer to the paint engine used for drawing on the device.
 boolean paintingActive()
          Returns true if the device is currently being painted on, i.
 int physicalDpiX()
          Returns the horizontal resolution of the device in dots per inch.
 int physicalDpiY()
          Returns the horizontal resolution of the device in dots per inch.
 int resolution()
          This property holds the resolution of the generated output.
 void setDescription(java.lang.String description)
          This property holds the description of the generated SVG drawing.
 void setFileName(java.lang.String fileName)
          This property holds the target filename for the generated SVG drawing.
 void setOutputDevice(QIODevice outputDevice)
          This property holds the output device for the generated SVG drawing.
 void setResolution(int dpi)
          This property holds the resolution of the generated output.
 void setSize(QSize size)
          This property holds the size of the generated SVG drawing.
 void setTitle(java.lang.String title)
          This property holds the title of the generated SVG drawing.
 void setViewBox(QRect viewBox)
          This property holds the viewBox of the generated SVG drawing.
 void setViewBox(QRectF viewBox)
          This property holds the viewBox of the generated SVG drawing.
 QSize size()
          This property holds the size of the generated SVG drawing.
 java.lang.String title()
          This property holds the title of the generated SVG drawing.
 QRect viewBox()
          Returns viewBoxF().toRect().
 QRectF viewBoxF()
          This property holds the viewBox of the generated SVG drawing.
 int width()
          Returns the width of the paint device in default coordinate system units (e.
 int widthMM()
          Returns the width of the paint device in millimeters.
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QSvgGenerator

public QSvgGenerator()
Constructs a new generator.

Method Detail

depth

public final int depth()
Returns the bit depth (number of bit planes) of the paint device.

Specified by:
depth in interface QPaintDeviceInterface

description

public final java.lang.String description()
This property holds the description of the generated SVG drawing.

See also:
title.


fileName

public final java.lang.String fileName()
This property holds the target filename for the generated SVG drawing.

See also:
outputDevice.


height

public final int height()
Returns the height of the paint device in default coordinate system units (e. . pixels for QPixmap and QWidget).

See also:
heightMM().

Specified by:
height in interface QPaintDeviceInterface

heightMM

public final int heightMM()
Returns the height of the paint device in millimeters. Due to platform limitations it may not be possible to use this function to determine the actual physical size of a widget on the screen.

See also:
height().

Specified by:
heightMM in interface QPaintDeviceInterface

logicalDpiX

public final int logicalDpiX()
Returns the horizontal resolution of the device in dots per inch, which is used when computing font sizes. For X11, this is usually the same as could be computed from widthMM().

Note that if the logicalDpiX() doesn't equal the physicalDpiX(), the corresponding QPaintEngine must handle the resolution mapping.

See also:
logicalDpiY(), and physicalDpiX().

Specified by:
logicalDpiX in interface QPaintDeviceInterface

logicalDpiY

public final int logicalDpiY()
Returns the vertical resolution of the device in dots per inch, which is used when computing font sizes. For X11, this is usually the same as could be computed from heightMM().

Note that if the logicalDpiY() doesn't equal the physicalDpiY(), the corresponding QPaintEngine must handle the resolution mapping.

See also:
logicalDpiX(), and physicalDpiY().

Specified by:
logicalDpiY in interface QPaintDeviceInterface

numColors

public final int numColors()
Returns the number of different colors available for the paint device. Since this value is an int, it will not be sufficient to represent the number of colors on 32 bit displays, in this case INT_MAX is returned instead.

Specified by:
numColors in interface QPaintDeviceInterface

outputDevice

public final QIODevice outputDevice()
This property holds the output device for the generated SVG drawing. If both output device and file name are specified, the output device will have precedence.

See also:
fileName.


paintingActive

public final boolean paintingActive()
Returns true if the device is currently being painted on, i. . someone has called QPainter::begin() but not yet called QPainter::end() for this device; otherwise returns false.

See also:
QPainter::isActive().

Specified by:
paintingActive in interface QPaintDeviceInterface

physicalDpiX

public final int physicalDpiX()
Returns the horizontal resolution of the device in dots per inch. For example, when printing, this resolution refers to the physical printer's resolution. The logical DPI on the other hand, refers to the resolution used by the actual paint engine.

Note that if the physicalDpiX() doesn't equal the logicalDpiX(), the corresponding QPaintEngine must handle the resolution mapping.

See also:
physicalDpiY(), and logicalDpiX().

Specified by:
physicalDpiX in interface QPaintDeviceInterface

physicalDpiY

public final int physicalDpiY()
Returns the horizontal resolution of the device in dots per inch. For example, when printing, this resolution refers to the physical printer's resolution. The logical DPI on the other hand, refers to the resolution used by the actual paint engine.

Note that if the physicalDpiY() doesn't equal the logicalDpiY(), the corresponding QPaintEngine must handle the resolution mapping.

See also:
physicalDpiX(), and logicalDpiY().

Specified by:
physicalDpiY in interface QPaintDeviceInterface

resolution

public final int resolution()
This property holds the resolution of the generated output. The resolution is specified in dots per inch, and is used to calculate the physical size of an SVG drawing.

See also:
size, and viewBox.


setDescription

public final void setDescription(java.lang.String description)
This property holds the description of the generated SVG drawing.

See also:
title.


setFileName

public final void setFileName(java.lang.String fileName)
This property holds the target filename for the generated SVG drawing.

See also:
outputDevice.


setOutputDevice

public final void setOutputDevice(QIODevice outputDevice)
This property holds the output device for the generated SVG drawing. If both output device and file name are specified, the output device will have precedence.

See also:
fileName.


setResolution

public final void setResolution(int dpi)
This property holds the resolution of the generated output. The resolution is specified in dots per inch, and is used to calculate the physical size of an SVG drawing.

See also:
size, and viewBox.


setSize

public final void setSize(QSize size)
This property holds the size of the generated SVG drawing. By default this property is set to QSize(-1, -1), which indicates that the generator should not output the width and height attributes of the <svg> element.

Note: It is not possible to change this property while a QPainter is active on the generator.

See also:
viewBox, and resolution.


setTitle

public final void setTitle(java.lang.String title)
This property holds the title of the generated SVG drawing.

See also:
description.


setViewBox

public final void setViewBox(QRect viewBox)
This property holds the viewBox of the generated SVG drawing. By default this property is set to QRect(0, 0, -1, -1), which indicates that the generator should not output the viewBox attribute of the <svg> element.

Note: It is not possible to change this property while a QPainter is active on the generator.

See also:
viewBox(), size, and resolution.


setViewBox

public final void setViewBox(QRectF viewBox)
This property holds the viewBox of the generated SVG drawing. By default this property is set to QRect(0, 0, -1, -1), which indicates that the generator should not output the viewBox attribute of the <svg> element.

Note: It is not possible to change this property while a QPainter is active on the generator.

See also:
viewBox(), size, and resolution.


size

public final QSize size()
This property holds the size of the generated SVG drawing. By default this property is set to QSize(-1, -1), which indicates that the generator should not output the width and height attributes of the <svg> element.

Note: It is not possible to change this property while a QPainter is active on the generator.

See also:
viewBox, and resolution.


title

public final java.lang.String title()
This property holds the title of the generated SVG drawing.

See also:
description.


viewBox

public final QRect viewBox()
Returns viewBoxF().toRect().

See also:
setViewBox(), and viewBoxF().


viewBoxF

public final QRectF viewBoxF()
This property holds the viewBox of the generated SVG drawing. By default this property is set to QRect(0, 0, -1, -1), which indicates that the generator should not output the viewBox attribute of the <svg> element.

Note: It is not possible to change this property while a QPainter is active on the generator.

See also:
viewBox(), size, and resolution.


width

public final int width()
Returns the width of the paint device in default coordinate system units (e. . pixels for QPixmap and QWidget).

See also:
widthMM().

Specified by:
width in interface QPaintDeviceInterface

widthMM

public final int widthMM()
Returns the width of the paint device in millimeters. Due to platform limitations it may not be possible to use this function to determine the actual physical size of a widget on the screen.

See also:
width().

Specified by:
widthMM in interface QPaintDeviceInterface

metric

public int metric(QPaintDevice.PaintDeviceMetric metric)
Returns the metric information for the given paint device metric.

See also:
PaintDeviceMetric .

Specified by:
metric in interface QPaintDeviceInterface

paintEngine

public QPaintEngine paintEngine()
Returns a pointer to the paint engine used for drawing on the device.

Specified by:
paintEngine in interface QPaintDeviceInterface