umbrello API Documentation

UMLViewImageExporterModel Class Reference

Exports an UMLView in various image formats. More...

#include <umlviewimageexportermodel.h>

List of all members.

Public Member Functions

 UMLViewImageExporterModel ()
 Constructor for UMLViewImageExporterModel.
virtual ~UMLViewImageExporterModel ()
 Destructor for UMLViewImageExporterModel.
QStringList exportAllViews (const QString &imageType, const KURL &directory, bool useFolders) const
 Exports all the views in the document to the directory specified in the url using the 'imageType' for the images.
QString exportView (UMLView *view, const QString &imageType, const KURL &url) const
 Exports the view to the url using the 'imageType' for the image.

Static Public Member Functions

static QStringList supportedImageTypes ()
 Returns a QStringList containing all the supported image types to use when exporting.
static QStringList supportedMimeTypes ()
 Returns a QStringList containing all the supported mime types to use when exporting.
static QString imageTypeToMimeType (const QString &imageType)
 Returns the mime type for an image type.
static QString mimeTypeToImageType (const QString &mimeType)
 Returns the image type for a mime type.


Detailed Description

Exports an 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.

Definition at line 35 of file umlviewimageexportermodel.h.


Constructor & Destructor Documentation

UMLViewImageExporterModel::UMLViewImageExporterModel  )  [inline]
 

Constructor for UMLViewImageExporterModel.

Definition at line 77 of file umlviewimageexportermodel.h.

virtual UMLViewImageExporterModel::~UMLViewImageExporterModel  )  [inline, virtual]
 

Destructor for UMLViewImageExporterModel.

Definition at line 83 of file umlviewimageexportermodel.h.


Member Function Documentation

QStringList UMLViewImageExporterModel::supportedImageTypes  )  [static]
 

Returns a QStringList containing all the supported image types to use when exporting.

All the types will be lower case.

Returns:
A QStringList containing all the supported image types to use when exporting.

Definition at line 45 of file umlviewimageexportermodel.cpp.

Referenced by supportedMimeTypes().

QStringList UMLViewImageExporterModel::supportedMimeTypes  )  [static]
 

Returns a QStringList containing all the supported mime types to use when exporting.

All the types will be lower case.

Returns:
A QStringList containing all the supported mime types to use when exporting.

Definition at line 61 of file umlviewimageexportermodel.cpp.

References imageTypeToMimeType(), and supportedImageTypes().

QString UMLViewImageExporterModel::imageTypeToMimeType const QString &  imageType  )  [static]
 

Returns the mime type for an image type.

The supported image types are those that the diagrams can be exported to.

Parameters:
imageType The type of the image.
Returns:
A QString with the equivalent mime type, or QString::null if it's unknown.

Definition at line 74 of file umlviewimageexportermodel.cpp.

Referenced by supportedMimeTypes().

QString UMLViewImageExporterModel::mimeTypeToImageType const QString &  mimeType  )  [static]
 

Returns the image type for a mime type.

The supported image types are those that the diagrams can be exported to.

Parameters:
mimeType The mime type.
Returns:
A lowercase QString with the equivalent image type, or QString::null if it's unknown.

Definition at line 89 of file umlviewimageexportermodel.cpp.

QStringList UMLViewImageExporterModel::exportAllViews const QString &  imageType,
const KURL &  directory,
bool  useFolders
const
 

Exports all the 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.

Parameters:
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.
Returns:
A QStringList with all the error messages that occurred during export. If the list is empty, all the views were exported successfully.

Definition at line 103 of file umlviewimageexportermodel.cpp.

References exportView(), UMLApp::getDocument(), UMLView::getName(), and UMLDoc::getViewIterator().

QString UMLViewImageExporterModel::exportView UMLView view,
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.

Parameters:
view The view to export.
imageType The type of the image the view will be exported to.
url The url where the image will be saved.
Returns:
The message error if some problem occurred when exporting, or QString::null if all went fine.

Definition at line 123 of file umlviewimageexportermodel.cpp.

Referenced by exportAllViews().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:08:08 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003