umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
|
#include <umlviewimageexportermodel.h>
Public Member Functions | |
UMLViewImageExporterModel (float resolution=0.0) | |
virtual | ~UMLViewImageExporterModel () |
QString | exportView (UMLScene *scene, const QString &imageType, const KUrl &url) const |
QStringList | exportViews (const UMLViewList &views, const QString &imageType, const QUrl &directory, bool useFolders) const |
Static Public Member Functions | |
static QStringList | supportedImageTypes () |
static QStringList | supportedMimeTypes () |
static QString | imageTypeToMimeType (const QString &imageType) |
static QString | mimeTypeToImageType (const QString &mimeType) |
Private Member Functions | |
QString | getDiagramFileName (UMLScene *scene, const QString &imageType, bool useFolders=false) const |
bool | prepareDirectory (const KUrl &url) const |
bool | exportViewTo (UMLScene *scene, const QString &imageType, const QString &fileName) const |
bool | exportViewToDot (UMLScene *scene, const QString &fileName) const |
bool | exportViewToEps (UMLScene *scene, const QString &fileName) const |
bool | exportViewToSvg (UMLScene *scene, const QString &fileName) const |
bool | exportViewToPixmap (UMLScene *scene, const QString &imageType, const QString &fileName) const |
Private Attributes | |
float | m_resolution |
Static Private Attributes | |
static QStringList | s_supportedImageTypesList |
static QStringList | s_supportedMimeTypesList |
Exports a UMLView in various image formats. It can also export all the views in the current document.
The methods in this class don't communicate with the user, so asking the format to save the images in, checking if the target file exists and so on must be done before calling those methods, if needed. The only exception is asking passwords for example when KIO slaves are used, as this operation is made automatically by the KIO classes.
|
explicit |
Constructor for UMLViewImageExporterModel.
resolution | resolution of export in DPI (default 0.0 means export type related default) |
|
virtual |
Destructor for UMLViewImageExporterModel.
QString UMLViewImageExporterModel::exportView | ( | UMLScene * | scene, |
const QString & | imageType, | ||
const KUrl & | url | ||
) | const |
Exports the view to the url using the 'imageType' for the image.
This method creates the needed directories, if any. If there was an existing file in the specified url overwrites it without asking. The url used can be local or remote, using supported KIO slaves.
If some problem occurs when exporting, an error message is returned.
scene | The UMLScene to export. |
imageType | The type of the image the view will be exported to. |
url | The url where the image will be saved. |
QStringList UMLViewImageExporterModel::exportViews | ( | const UMLViewList & | views, |
const QString & | imageType, | ||
const QUrl & | directory, | ||
bool | useFolders | ||
) | const |
Exports views in the document to the directory specified in the url using the 'imageType' for the images. The name of the exported images will be like their view's name and using the 'imageType' as extension.
The views are stored in folders in the document. The same tree structure used in the document to store the views can be created in the target directory with 'useFolders'. Only the folders made by the user are created in the target directory (Logical view, use case view and so on aren't created).
This method creates the specified target directory if needed. If there was an existing file with the same path as one to be created overwrites it without asking. The url used can be local or remote, using supported KIO slaves.
views | The list of views to export. |
imageType | The type of the images the views will be exported to. |
directory | The url of the directory where the images will be saved. |
useFolders | If the tree structure of the views in the document must be created in the target directory. |
|
private |
Exports the scene to the file 'fileName' as the specified type.
scene | The scene to export. |
imageType | The type of the image the scene will be exported to. |
fileName | The name of the file where the image will be saved. |
|
private |
Exports the view to the file 'fileName' as a dot file.
scene | The scene to export. |
fileName | The name of the file where the image will be saved. |
|
private |
Exports the view to the file 'fileName' as EPS.
scene | The scene to export. |
fileName | The name of the file where the image will be saved. |
|
private |
Exports the view to the file 'fileName' as a pixmap of the specified type. The valid types are those supported by QPixmap save method.
scene | The scene to export. |
imageType | The type of the image the view will be exported to. |
fileName | The name of the file where the image will be saved. |
|
private |
Exports the view to the file 'fileName' as SVG.
scene | The scene to export. |
fileName | The name of the file where the image will be saved. |
|
private |
Returns the diagram file name.
scene | the diagram |
imageType | the image type as file name extension |
useFolders | flag whether to add folder to the file name |
|
static |
Returns the mime type for an image type. The supported image types are those that the diagrams can be exported to.
imageType | The type of the image. |
|
static |
Returns the image type for a mime type. The supported image types are those that the diagrams can be exported to.
mimeType | The mime type. |
|
private |
Creates, if it doesn't exist, the directory to save the file. It also creates all the needed parent directories.
url | The url where the image will be saved. |
|
static |
Returns a QStringList containing all the supported image types to use when exporting. All the types will be lower case.
|
static |
Returns a QStringList containing all the supported mime types to use when exporting. All the types will be lower case.
|
private |
|
staticprivate |
|
staticprivate |