FOSSredder 0.5.0
Loading...
Searching...
No Matches
AppActions.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <QObject>
9#include <QStringList>
10
11class QAction;
12
13namespace ui {
14
18class Actions : public QObject {
19 Q_OBJECT
20 Q_PROPERTY(QAction* newFileAction READ newFileAction CONSTANT)
21 Q_PROPERTY(QAction* openFileAction READ openFileAction CONSTANT)
22 Q_PROPERTY(QAction* saveFileAction READ saveFileAction CONSTANT)
23 Q_PROPERTY(QAction* saveFileAsAction READ saveFileAsAction CONSTANT)
24 Q_PROPERTY(QAction* quitAction READ quitAction CONSTANT)
25 Q_PROPERTY(QAction* aboutAction READ aboutAction CONSTANT)
26
27public:
32 explicit Actions(QObject* parent = nullptr);
33
37 QAction* newFileAction() const;
41 QAction* openFileAction() const;
45 QAction* saveFileAction() const;
49 QAction* saveFileAsAction() const;
53 QAction* quitAction() const;
57 QAction* aboutAction() const;
58
60 Q_INVOKABLE void newFile();
61
63 Q_INVOKABLE void openFile();
64
66 Q_INVOKABLE void saveFile();
67
69 Q_INVOKABLE void saveFileAs();
70
72 Q_INVOKABLE void browseImportPdf();
73
75 Q_INVOKABLE void browseExportFile();
76
78 Q_INVOKABLE void browseExportDirectory();
79
80signals:
85 void importBrowseRequested(const QString& filter);
86
91 void importFileSelected(const QString& path);
92
97 void importFilesSelected(const QStringList& paths);
98
103 void importFileDropped(const QString& path);
104
110 void importFilesDropped(const QStringList& paths);
111
116 void exportBrowseRequested(const QString& filter);
117
122 void exportDirectoryBrowseRequested(const QString& title);
123
128 void exportFileSelected(const QString& path);
129
134 void exportDirectorySelected(const QString& path);
135
136private:
137 QAction* newFileAction_ = nullptr;
138 QAction* openFileAction_ = nullptr;
139 QAction* saveFileAction_ = nullptr;
140 QAction* saveFileAsAction_ = nullptr;
141 QAction* quitAction_ = nullptr;
142 QAction* aboutAction_ = nullptr;
143};
144
145} // namespace ui
void exportFileSelected(const QString &path)
Emitted after an export path was chosen by the user.
QAction * newFileAction
Definition AppActions.h:20
void importFileSelected(const QString &path)
Emitted after a single import file was selected by the user.
QAction * quitAction
Definition AppActions.h:24
Actions(QObject *parent=nullptr)
Construct the actions container.
void importBrowseRequested(const QString &filter)
Emitted when QML requests an import file dialog.
void exportDirectorySelected(const QString &path)
Emitted after an export directory was chosen by the user.
void importFileDropped(const QString &path)
Emitted when a file was dropped onto an import target in QML.
Q_INVOKABLE void newFile()
Requests creation of a new workspace file.
void importFilesSelected(const QStringList &paths)
Emitted after multiple import files were selected by the user.
Q_INVOKABLE void openFile()
Requests opening an existing workspace file.
Q_INVOKABLE void browseImportPdf()
Requests an import PDF file picker.
QAction * openFileAction
Definition AppActions.h:21
QAction * saveFileAsAction
Definition AppActions.h:23
Q_INVOKABLE void browseExportFile()
Requests an export file picker.
void importFilesDropped(const QStringList &paths)
Emitted when multiple files were dropped onto an import target in QML.
Q_INVOKABLE void saveFile()
Requests saving the current workspace file.
QAction * saveFileAction
Definition AppActions.h:22
QAction * aboutAction
Definition AppActions.h:25
void exportBrowseRequested(const QString &filter)
Emitted when QML requests an export file dialog.
Q_INVOKABLE void saveFileAs()
Requests saving the current workspace file under a new path.
void exportDirectoryBrowseRequested(const QString &title)
Emitted when QML requests an export directory dialog.
Q_INVOKABLE void browseExportDirectory()
Requests an export directory picker.