1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
/*
SPDX-FileCopyrightText: 2019 Kai Uwe Broulik <kde@privat.broulik.de>
SPDX-License-Identifier: MIT
*/
#pragma once
#include "abstractbrowserplugin.h"
#include <QPointer>
#include <QScopedPointer>
#include <QString>
#include <QUrl>
namespace Purpose
{
class Menu;
}
class PurposePlugin : public AbstractBrowserPlugin
{
Q_OBJECT
public:
explicit PurposePlugin(QObject *parent);
~PurposePlugin() override;
bool onUnload() override;
using AbstractBrowserPlugin::handleData;
QJsonObject handleData(int serial, const QString &event, const QJsonObject &data) override;
bool eventFilter(QObject *watched, QEvent *event) override;
private:
void showShareMenu(const QJsonObject &data, const QString &mimeType = QString());
void sendPendingReply(bool success, const QJsonObject &data);
QScopedPointer<Purpose::Menu> m_menu;
int m_pendingReplySerial = -1;
};
|