source: ogBrowser-Git/src/ogurlhandler.h @ 816ccac

jenkinsmain
Last change on this file since 816ccac was 07ea3f8, checked in by Vadim Troshchinskiy Shmelev <vtroshchinskiy@…>, 18 months ago

Modernize browser for Qt6, fix command execution

  • Property mode set to 100644
File size: 1.2 KB
Line 
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
14class OGBrowserUrlHandlerCommand : public QWebEngineUrlSchemeHandler {
15    Q_OBJECT
16public:
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
33signals:
34    void command(const QString &command, bool confirm, bool returnOutput);
35
36
37private:
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.