umbrello 2.32.3 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

umlviewimageexportermodel.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2006-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef UMLVIEWIMAGEEXPORTERMODEL_H
12 #define UMLVIEWIMAGEEXPORTERMODEL_H
13
14 #include "umlscene.h"
15 #include "umlviewlist.h"
16
17 #include <QStringList>
18 #include <QRect>
19
20 // forward declarations
21 class KUrl;
22
33 class UMLViewImageExporterModel
34 {
35 public:
36
37 static QStringList supportedImageTypes();
38 static QStringList supportedMimeTypes();
39
40 static QString imageTypeToMimeType(const QString& imageType);
41 static QString mimeTypeToImageType(const QString& mimeType);
42
43 explicit UMLViewImageExporterModel(float resolution = 0.0);
44 virtual ~UMLViewImageExporterModel();
45 #if QT_VERSION >= 0x050000
46 QString exportView(UMLScene* scene, const QString &imageType, const QUrl &url) const;
47 #else
48 QString exportView(UMLScene* scene, const QString &imageType, const KUrl &url) const;
49 #endif
50
51 QStringList exportViews(const UMLViewList &views, const QString &imageType, const QUrl &directory, bool useFolders) const;
52 private:
53
54 QString getDiagramFileName(UMLScene* scene, const QString &imageType, bool useFolders = false) const;
55
56 #if QT_VERSION >= 0x050000
57 bool prepareDirectory(const QUrl &url) const;
58 #else
59 bool prepareDirectory(const KUrl &url) const;
60 #endif
61
62 bool exportViewTo(UMLScene* scene, const QString &imageType, const QString &fileName) const;
63 bool exportViewToDot(UMLScene* scene, const QString &fileName) const;
64 bool exportViewToEps(UMLScene* scene, const QString &fileName) const;
65 bool exportViewToSvg(UMLScene* scene, const QString &fileName) const;
66 bool exportViewToPixmap(UMLScene* scene, const QString &imageType, const QString &fileName) const;
67
68 static QStringList s_supportedImageTypesList;
69 static QStringList s_supportedMimeTypesList;
70 float m_resolution;
71 };
72
73 #endif
DEBUG_REGISTER
#define DEBUG_REGISTER(src)
Definition: debug_utils.h:131
umlview.h
UMLViewImageExporterModel::exportView
QString exportView(UMLScene *scene, const QString &imageType, const KUrl &url) const
Definition: umlviewimageexportermodel.cpp:256
DotGenerator
Definition: dotgenerator.h:25
DotGenerator::createDotFile
bool createDotFile(UMLScene *scene, const QString &fileName, const QString &variant=QLatin1String("default"))
Definition: dotgenerator.cpp:377
umlviewimageexportermodel.h
UMLViewImageExporterModel
Definition: umlviewimageexportermodel.h:34
UMLScene::diagramRect
QRectF diagramRect()
Definition: umlscene.cpp:1396
UMLViewImageExporterModel::exportViewToPixmap
bool exportViewToPixmap(UMLScene *scene, const QString &imageType, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:569
UMLViewImageExporterModel::exportViewToEps
bool exportViewToEps(UMLScene *scene, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:460
UMLViewImageExporterModel::exportViewToDot
bool exportViewToDot(UMLScene *scene, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:438
UMLViewImageExporterModel::supportedImageTypes
static QStringList supportedImageTypes()
Definition: umlviewimageexportermodel.cpp:68
UMLScene::clearSelected
void clearSelected()
Definition: umlscene.cpp:1456
model_utils.h
UMLViewImageExporterModel::s_supportedImageTypesList
static QStringList s_supportedImageTypesList
Definition: umlviewimageexportermodel.h:68
UMLViewImageExporterModel::exportViewToSvg
bool exportViewToSvg(UMLScene *scene, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:516
UMLViewImageExporterModel::exportViewTo
bool exportViewTo(UMLScene *scene, const QString &imageType, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:398
UMLScene::forceUpdateWidgetFontMetrics
void forceUpdateWidgetFontMetrics(QPainter *painter)
Definition: umlscene.cpp:3717
UMLView
Definition: umlview.h:35
umlviewlist.h
UMLViewImageExporterModel::prepareDirectory
bool prepareDirectory(const KUrl &url) const
Definition: umlviewimageexportermodel.cpp:345
uWarning
#define uWarning()
Definition: debug_utils.h:124
UMLViewImageExporterModel::mimeTypeToImageType
static QString mimeTypeToImageType(const QString &mimeType)
Definition: umlviewimageexportermodel.cpp:152
UMLScene::getDiagram
void getDiagram(QPixmap &diagram, const QRectF &rect)
Definition: umlscene.cpp:1876
i18n
#define i18n
Definition: main.cpp:39
UMLViewImageExporterModel::m_resolution
float m_resolution
Definition: umlviewimageexportermodel.h:70
UMLViewImageExporterModel::exportViews
QStringList exportViews(const UMLViewList &views, const QString &imageType, const QUrl &directory, bool useFolders) const
Definition: umlviewimageexportermodel.cpp:214
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:278
UMLViewImageExporterModel::~UMLViewImageExporterModel
virtual ~UMLViewImageExporterModel()
Definition: umlviewimageexportermodel.cpp:188
DEBUG
#define DEBUG(src)
Definition: debug_utils.h:129
DBG_IEM
#define DBG_IEM
Definition: umlviewimageexportermodel.cpp:55
umlscene.h
uml.h
UMLViewImageExporterModel::imageTypeToMimeType
static QString imageTypeToMimeType(const QString &imageType)
Definition: umlviewimageexportermodel.cpp:119
debug_utils.h
UMLScene::name
QString name() const
Definition: umlscene.cpp:410
UMLScene
Definition: umlscene.h:69
UMLViewImageExporterModel::getDiagramFileName
QString getDiagramFileName(UMLScene *scene, const QString &imageType, bool useFolders=false) const
Definition: umlviewimageexportermodel.cpp:317
UMLViewImageExporterModel::UMLViewImageExporterModel
UMLViewImageExporterModel(float resolution=0.0)
Definition: umlviewimageexportermodel.cpp:180
UMLView::umlScene
UMLScene * umlScene() const
Definition: umlview.cpp:56
UMLScene::ID
Uml::ID::Type ID() const
Definition: umlscene.cpp:442
UMLViewList
QList< QPointer< UMLView > > UMLViewList
Definition: umlviewlist.h:26
Model_Utils::treeViewBuildDiagramName
QString treeViewBuildDiagramName(Uml::ID::Type id)
Definition: model_utils.cpp:490
UMLViewImageExporterModel::s_supportedMimeTypesList
static QStringList s_supportedMimeTypesList
Definition: umlviewimageexportermodel.h:69
umldoc.h
UMLViewImageExporterModel::supportedMimeTypes
static QStringList supportedMimeTypes()
Definition: umlviewimageexportermodel.cpp:97
dotgenerator.h