QtMvvm  1.1.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
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 
115  QTMVVM_REVISION_1 static void getColor(const QJSValue &onResult = {},
116  const QString &title = {},
117  const QColor &color = {},
118  bool argb = false);
119 
122  QTMVVM_REVISION_1 static QtMvvm::ProgressControl *showProgress(const QString &title = {},
123  const QString &label = {},
124  int maximum = 100,
125  int minimum = 0,
126  bool allowCancel = true,
127  int value = 0,
128  const QString &cancelText = {});
131  QTMVVM_REVISION_1 static QtMvvm::ProgressControl *showIndeterminateProgress(const QString &title = {},
132  const QString &label = {},
133  bool allowCancel = true,
134  const QString &cancelText = {});
137  QTMVVM_REVISION_1 static QtMvvm::ProgressControl *showBusy(const QString &title = {},
138  const QString &label = {},
139  bool allowCancel = true,
140  const QString &cancelText = {});
141 
142 #ifndef DOXYGEN_RUN
143 #undef static
144 #endif
145 
146 private:
147  QJSEngine *_engine;
148 };
149 
150 }
151 
152 #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.
static QTMVVM_REVISION_1 void getColor(const QJSValue &onResult={}, const QString &title={}, const QColor &color={}, bool argb=false)
A QML version of the QtMvvm::getColor method.
The QML import for the QtMvvmCore QML module.
Definition: qqmlcoreapp.h:9
A Helper class to control a generic progress dialog.
Definition: message.h:264
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 QTMVVM_REVISION_1 QtMvvm::ProgressControl * showProgress(const QString &title={}, const QString &label={}, int maximum=100, int minimum=0, bool allowCancel=true, int value=0, const QString &cancelText={})
A QML version of the QtMvvm::showProgress method.
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 QTMVVM_REVISION_1 QtMvvm::ProgressControl * showIndeterminateProgress(const QString &title={}, const QString &label={}, bool allowCancel=true, const QString &cancelText={})
A QML version of the QtMvvm::showIndeterminateProgress 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.
static QTMVVM_REVISION_1 QtMvvm::ProgressControl * showBusy(const QString &title={}, const QString &label={}, bool allowCancel=true, const QString &cancelText={})
A QML version of the QtMvvm::showBusy method.