Commit b48975fb authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to share text from viewer

parent 700f2362
...@@ -138,6 +138,7 @@ set(libmessageviewer_viewer_SRCS ...@@ -138,6 +138,7 @@ set(libmessageviewer_viewer_SRCS
viewer/urlhandlermanager.cpp viewer/urlhandlermanager.cpp
viewer/mimeparttree/mimeparttreeview.cpp viewer/mimeparttree/mimeparttreeview.cpp
viewer/mimeparttree/mimetreemodel.cpp viewer/mimeparttree/mimetreemodel.cpp
viewer/viewerpurposemenuwidget.cpp
) )
set(libmessageviewer_widgets_SRCS set(libmessageviewer_widgets_SRCS
......
/*
SPDX-FileCopyrightText: 2020 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "viewerpurposemenuwidget.h"
#include <MessageViewer/MailWebEngineView>
using namespace MessageViewer;
MailfilterPurposeMenuWidget::MailfilterPurposeMenuWidget(QWidget *parentWidget, QObject *parent)
: PimCommon::PurposeMenuWidget(parentWidget, parent)
{
}
MailfilterPurposeMenuWidget::~MailfilterPurposeMenuWidget()
{
}
QByteArray MailfilterPurposeMenuWidget::text()
{
if (mViewer) {
return mViewer->selectedText().toUtf8();
}
return {};
}
void MailfilterPurposeMenuWidget::setViewer(MailWebEngineView *viewer)
{
mViewer = viewer;
}
/*
SPDX-FileCopyrightText: 2020 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef VIEWERPURPOSEMENUWIDGET_H
#define VIEWERPURPOSEMENUWIDGET_H
#include <PimCommon/PurposeMenuWidget>
#include "messageviewer_export.h"
namespace MessageViewer {
class MailWebEngineView;
class MESSAGEVIEWER_EXPORT MailfilterPurposeMenuWidget : public PimCommon::PurposeMenuWidget
{
Q_OBJECT
public:
explicit MailfilterPurposeMenuWidget(QWidget *parentWidget, QObject *parent = nullptr);
~MailfilterPurposeMenuWidget() override;
Q_REQUIRED_RESULT QByteArray text() override;
void setViewer(MailWebEngineView *viewer);
private:
MailWebEngineView *mViewer = nullptr;
};
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment