umbrello  2.32.2
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  SPDX-License-Identifier: GPL-2.0-or-later
3  SPDX-FileCopyrightText: 2006-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4 */
5 
6 #ifndef UMLVIEWIMAGEEXPORTERMODEL_H
7 #define UMLVIEWIMAGEEXPORTERMODEL_H
8 
9 #include "umlscene.h"
10 #include "umlviewlist.h"
11 
12 #include <QStringList>
13 #include <QRect>
14 
15 // forward declarations
16 class KUrl;
17 
29 {
30 public:
31 
32  static QStringList supportedImageTypes();
33  static QStringList supportedMimeTypes();
34 
35  static QString imageTypeToMimeType(const QString& imageType);
36  static QString mimeTypeToImageType(const QString& mimeType);
37 
38  explicit UMLViewImageExporterModel(float resolution = 0.0);
40 #if QT_VERSION >= 0x050000
41  QString exportView(UMLScene* scene, const QString &imageType, const QUrl &url) const;
42 #else
43  QString exportView(UMLScene* scene, const QString &imageType, const KUrl &url) const;
44 #endif
45 
46  QStringList exportViews(const UMLViewList &views, const QString &imageType, const QUrl &directory, bool useFolders) const;
47 private:
48 
49  QString getDiagramFileName(UMLScene* scene, const QString &imageType, bool useFolders = false) const;
50 
51 #if QT_VERSION >= 0x050000
52  bool prepareDirectory(const QUrl &url) const;
53 #else
54  bool prepareDirectory(const KUrl &url) const;
55 #endif
56 
57  bool exportViewTo(UMLScene* scene, const QString &imageType, const QString &fileName) const;
58  bool exportViewToDot(UMLScene* scene, const QString &fileName) const;
59  bool exportViewToEps(UMLScene* scene, const QString &fileName) const;
60  bool exportViewToSvg(UMLScene* scene, const QString &fileName) const;
61  bool exportViewToPixmap(UMLScene* scene, const QString &imageType, const QString &fileName) const;
62 
63  static QStringList s_supportedImageTypesList;
64  static QStringList s_supportedMimeTypesList;
65  float m_resolution;
66 };
67 
68 #endif
DEBUG_REGISTER
#define DEBUG_REGISTER(src)
Definition: debug_utils.h:117
umlview.h
UMLViewImageExporterModel::exportView
QString exportView(UMLScene *scene, const QString &imageType, const KUrl &url) const
Definition: umlviewimageexportermodel.cpp:251
DotGenerator
Definition: dotgenerator.h:19
DotGenerator::createDotFile
bool createDotFile(UMLScene *scene, const QString &fileName, const QString &variant=QLatin1String("default"))
Definition: dotgenerator.cpp:372
umlviewimageexportermodel.h
UMLViewImageExporterModel
Definition: umlviewimageexportermodel.h:28
UMLScene::diagramRect
QRectF diagramRect()
Definition: umlscene.cpp:1392
UMLViewImageExporterModel::exportViewToPixmap
bool exportViewToPixmap(UMLScene *scene, const QString &imageType, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:564
UMLViewImageExporterModel::exportViewToEps
bool exportViewToEps(UMLScene *scene, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:455
UMLViewImageExporterModel::exportViewToDot
bool exportViewToDot(UMLScene *scene, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:433
UMLViewImageExporterModel::supportedImageTypes
static QStringList supportedImageTypes()
Definition: umlviewimageexportermodel.cpp:63
UMLScene::clearSelected
void clearSelected()
Definition: umlscene.cpp:1459
model_utils.h
UMLViewImageExporterModel::s_supportedImageTypesList
static QStringList s_supportedImageTypesList
Definition: umlviewimageexportermodel.h:63
UMLViewImageExporterModel::exportViewToSvg
bool exportViewToSvg(UMLScene *scene, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:511
UMLViewImageExporterModel::exportViewTo
bool exportViewTo(UMLScene *scene, const QString &imageType, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:393
UMLScene::forceUpdateWidgetFontMetrics
void forceUpdateWidgetFontMetrics(QPainter *painter)
Definition: umlscene.cpp:3727
UMLView
Definition: umlview.h:29
it
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of it
Definition: GPL-2.0-only.txt:64
umlviewlist.h
UMLViewImageExporterModel::prepareDirectory
bool prepareDirectory(const KUrl &url) const
Definition: umlviewimageexportermodel.cpp:340
uWarning
#define uWarning()
Definition: debug_utils.h:110
UMLViewImageExporterModel::mimeTypeToImageType
static QString mimeTypeToImageType(const QString &mimeType)
Definition: umlviewimageexportermodel.cpp:147
UMLScene::getDiagram
void getDiagram(QPixmap &diagram, const QRectF &rect)
Definition: umlscene.cpp:1886
i18n
#define i18n
Definition: main.cpp:34
UMLViewImageExporterModel::m_resolution
float m_resolution
Definition: umlviewimageexportermodel.h:65
UMLViewImageExporterModel::exportViews
QStringList exportViews(const UMLViewList &views, const QString &imageType, const QUrl &directory, bool useFolders) const
Definition: umlviewimageexportermodel.cpp:209
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:275
UMLViewImageExporterModel::~UMLViewImageExporterModel
virtual ~UMLViewImageExporterModel()
Definition: umlviewimageexportermodel.cpp:183
DEBUG
#define DEBUG(src)
Definition: debug_utils.h:115
DBG_IEM
#define DBG_IEM
Definition: umlviewimageexportermodel.cpp:50
umlscene.h
uml.h
UMLViewImageExporterModel::imageTypeToMimeType
static QString imageTypeToMimeType(const QString &imageType)
Definition: umlviewimageexportermodel.cpp:114
debug_utils.h
UMLScene::name
QString name() const
Definition: umlscene.cpp:406
UMLScene
Definition: umlscene.h:64
UMLViewImageExporterModel::getDiagramFileName
QString getDiagramFileName(UMLScene *scene, const QString &imageType, bool useFolders=false) const
Definition: umlviewimageexportermodel.cpp:312
UMLViewImageExporterModel::UMLViewImageExporterModel
UMLViewImageExporterModel(float resolution=0.0)
Definition: umlviewimageexportermodel.cpp:175
UMLView::umlScene
UMLScene * umlScene() const
Definition: umlview.cpp:51
UMLScene::ID
Uml::ID::Type ID() const
Definition: umlscene.cpp:438
UMLViewList
QList< QPointer< UMLView > > UMLViewList
Definition: umlviewlist.h:14
Model_Utils::treeViewBuildDiagramName
QString treeViewBuildDiagramName(Uml::ID::Type id)
Definition: model_utils.cpp:490
UMLViewImageExporterModel::s_supportedMimeTypesList
static QStringList s_supportedMimeTypesList
Definition: umlviewimageexportermodel.h:64
umldoc.h
UMLViewImageExporterModel::supportedMimeTypes
static QStringList supportedMimeTypes()
Definition: umlviewimageexportermodel.cpp:92
dotgenerator.h