source:
ogBrowser-Git/src/ogurlhandler.h
@
816ccac
Last change on this file since 816ccac was 07ea3f8, checked in by , 21 months ago | |
---|---|
|
|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[07ea3f8] | 1 | #pragma once |
2 | ||
3 | #include <QWebEngineUrlSchemeHandler> | |
4 | #include <QObject> | |
5 | ||
6 | #define COMMAND "command" | |
7 | #define COMMAND_CONFIRM "command+confirm" | |
8 | #define COMMAND_WITH_CONFIRMATION "commandwithconfirmation" // Backwards compatibility | |
9 | #define COMMAND_OUTPUT "command+output" | |
10 | #define COMMAND_CONFIRM_OUTPUT "command+confirm+output" | |
11 | #define COMMAND_OUTPUT_CONFIRM "command+output+confirm" | |
12 | #define ENVIRONMENT "OGLOGFILE,ogactiveadmin,DEFAULTSPEED" | |
13 | ||
14 | class OGBrowserUrlHandlerCommand : public QWebEngineUrlSchemeHandler { | |
15 | Q_OBJECT | |
16 | public: | |
17 | ||
18 | OGBrowserUrlHandlerCommand(QObject *parent = nullptr) : QWebEngineUrlSchemeHandler(parent) { | |
19 | ||
20 | }; | |
21 | ||
22 | virtual ~OGBrowserUrlHandlerCommand() { | |
23 | ||
24 | }; | |
25 | ||
26 | virtual void requestStarted(QWebEngineUrlRequestJob *job); | |
27 | bool askConfirmation() const { return m_ask_confirmation; } | |
28 | bool returnOuput() const { return m_return_output; } | |
29 | ||
30 | void setAskConfirmation(const bool ask) { m_ask_confirmation = ask; } | |
31 | void setReturnOutput(const bool retOutput) { m_return_output = retOutput; } | |
32 | ||
33 | signals: | |
34 | void command(const QString &command, bool confirm, bool returnOutput); | |
35 | ||
36 | ||
37 | private: | |
38 | ||
39 | bool m_ask_confirmation = false; | |
40 | bool m_return_output = false; | |
41 | ||
42 | }; | |
43 | ||
44 |
Note: See TracBrowser
for help on using the repository browser.