QtMvvm  1.0.0
A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel
qqmlmvvmmessage.h
1 #ifndef QTMVVM_QQMLMVVMMESSAGE_H
2 #define QTMVVM_QQMLMVVMMESSAGE_H
3 
4 #include <QtCore/QObject>
5 
6 #include <QtQml/QQmlParserStatus>
7 #include <QtQml/QJSValue>
8 #include <QtQml/QJSEngine>
9 
10 #include <QtMvvmCore/Messages>
11 
12 #ifdef DOXYGEN_RUN
14 
22 class Message : public QtObject
23 #else
24 namespace QtMvvm {
25 
26 class QQmlMvvmMessage : public QObject
27 #endif
28 {
29  Q_OBJECT
30 
31 public:
33  explicit QQmlMvvmMessage(QJSEngine *engine, QObject *parent = nullptr);
34 
35 #ifdef DOXYGEN_RUN
36 public:
37 #else
38 public Q_SLOTS:
39 #define static
40 #endif
41  static void information(const QString &title,
44  const QString &text,
45  const QJSValue &onResult = {},
46  const QString &okText = {});
49  static void question(const QString &title,
50  const QString &text,
51  const QJSValue &onResult = {},
52  const QString &yesText = {},
53  const QString &noText = {});
56  static void warning(const QString &title,
57  const QString &text,
58  const QJSValue &onResult = {},
59  const QString &okText = {});
62  static void critical(const QString &title,
63  const QString &text,
64  const QJSValue &onResult = {},
65  const QString &okText = {});
66 
69  static void about(const QString &description,
70  const QUrl &websiteUrl = QUrl(),
71  const QString &licenseName = QString(),
72  const QUrl &licenseUrl = QUrl(),
73  const QString &companyName = QString(),
74  bool addQtVersion = true,
75  const QStringList &extraTopInfos = QStringList(),
76  const QString &extraBottomInfos = QString());
77 
80  static void getInput(const QString &title,
81  const QString &text,
82  const QString &inputType,
83  const QJSValue &onResult = {},
84  const QVariant &defaultValue = {},
85  const QVariantMap &viewProperties = {},
86  const QString &okText = {},
87  const QString &cancelText = {});
88 
91  static void getExistingDirectory(const QJSValue &onResult = {},
92  const QString &title = {},
93  const QUrl &dir = {});
96  static void getOpenFile(const QJSValue &onResult = {},
97  const QString &title = {},
98  const QStringList &supportedMimeTypes = {},
99  const QUrl &dir = {});
102  static void getOpenFiles(const QJSValue &onResult,
103  const QString &title = {},
104  const QStringList &supportedMimeTypes = {},
105  const QUrl &dir = {});
108  static void getSaveFile(const QJSValue &onResult,
109  const QString &title = {},
110  const QStringList &supportedMimeTypes = {},
111  const QUrl &dir = {});
112 
113 #ifndef DOXYGEN_RUN
114 #undef static
115 #endif
116 
117 private:
118  QJSEngine *_engine;
119 };
120 
121 }
122 
123 #endif // QTMVVM_QQMLMVVMMESSAGE_H
static void getSaveFile(const QJSValue &onResult, const QString &title={}, const QStringList &supportedMimeTypes={}, const QUrl &dir={})
A QML version of the QtMvvm::getSaveFile method.
static void critical(const QString &title, const QString &text, const QJSValue &onResult={}, const QString &okText={})
A QML version of the QtMvvm::critical method.
static void warning(const QString &title, const QString &text, const QJSValue &onResult={}, const QString &okText={})
A QML version of the QtMvvm::warning method.
The QML import for the QtMvvmCore QML module.
static void getOpenFile(const QJSValue &onResult={}, const QString &title={}, const QStringList &supportedMimeTypes={}, const QUrl &dir={})
A QML version of the QtMvvm::getOpenFile method.
static void getOpenFiles(const QJSValue &onResult, const QString &title={}, const QStringList &supportedMimeTypes={}, const QUrl &dir={})
A QML version of the QtMvvm::getOpenFiles method.
A QML signelton to access the QtMvvm namespace methods for showing simple dialogs.
static void question(const QString &title, const QString &text, const QJSValue &onResult={}, const QString &yesText={}, const QString &noText={})
A QML version of the QtMvvm::question method.
static void getInput(const QString &title, const QString &text, const QString &inputType, const QJSValue &onResult={}, const QVariant &defaultValue={}, const QVariantMap &viewProperties={}, const QString &okText={}, const QString &cancelText={})
A QML version of the QtMvvm::getInput method.
static void getExistingDirectory(const QJSValue &onResult={}, const QString &title={}, const QUrl &dir={})
A QML version of the QtMvvm::getExistingDirectory method.
static void about(const QString &description, const QUrl &websiteUrl=QUrl(), const QString &licenseName=QString(), const QUrl &licenseUrl=QUrl(), const QString &companyName=QString(), bool addQtVersion=true, const QStringList &extraTopInfos=QStringList(), const QString &extraBottomInfos=QString())
A QML version of the QtMvvm::about method.
static void information(const QString &title, const QString &text, const QJSValue &onResult={}, const QString &okText={})
A QML version of the QtMvvm::information method.
The primary namespace of the QtMvvm library.
Definition: binding.h:10