umbrello  2.31.90
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 
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);
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
Definition: umlscene.h:70
Definition: umlviewimageexportermodel.h:34
QString getDiagramFileName(UMLScene *scene, const QString &imageType, bool useFolders=false) const
Definition: umlviewimageexportermodel.cpp:317
float m_resolution
Definition: umlviewimageexportermodel.h:70
virtual ~UMLViewImageExporterModel()
Definition: umlviewimageexportermodel.cpp:188
QString exportView(UMLScene *scene, const QString &imageType, const KUrl &url) const
Definition: umlviewimageexportermodel.cpp:256
static QStringList supportedImageTypes()
Definition: umlviewimageexportermodel.cpp:68
bool exportViewToPixmap(UMLScene *scene, const QString &imageType, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:569
bool exportViewToDot(UMLScene *scene, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:438
UMLViewImageExporterModel(float resolution=0.0)
Definition: umlviewimageexportermodel.cpp:180
bool exportViewToSvg(UMLScene *scene, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:516
static QStringList s_supportedImageTypesList
Definition: umlviewimageexportermodel.h:68
static QStringList s_supportedMimeTypesList
Definition: umlviewimageexportermodel.h:69
QStringList exportViews(const UMLViewList &views, const QString &imageType, const QUrl &directory, bool useFolders) const
Definition: umlviewimageexportermodel.cpp:214
static QString mimeTypeToImageType(const QString &mimeType)
Definition: umlviewimageexportermodel.cpp:152
bool prepareDirectory(const KUrl &url) const
Definition: umlviewimageexportermodel.cpp:345
static QString imageTypeToMimeType(const QString &imageType)
Definition: umlviewimageexportermodel.cpp:119
static QStringList supportedMimeTypes()
Definition: umlviewimageexportermodel.cpp:97
bool exportViewTo(UMLScene *scene, const QString &imageType, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:398
bool exportViewToEps(UMLScene *scene, const QString &fileName) const
Definition: umlviewimageexportermodel.cpp:460
QList< QPointer< UMLView > > UMLViewList
Definition: umlviewlist.h:26