File indexing completed on 2025-03-09 04:54:44

0001 /*
0002   SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #include "viewerpurposemenuwidget.h"
0007 
0008 #include <MessageViewer/MailWebEngineView>
0009 
0010 using namespace MessageViewer;
0011 
0012 ViewerPurposeMenuWidget::ViewerPurposeMenuWidget(QWidget *parentWidget, QObject *parent)
0013     : PimCommon::PurposeMenuWidget(parentWidget, parent)
0014 {
0015 }
0016 
0017 ViewerPurposeMenuWidget::~ViewerPurposeMenuWidget() = default;
0018 
0019 QByteArray ViewerPurposeMenuWidget::text()
0020 {
0021     if (mViewer) {
0022         return mViewer->selectedText().toUtf8();
0023     }
0024     return {};
0025 }
0026 
0027 void ViewerPurposeMenuWidget::setViewer(MailWebEngineView *viewer)
0028 {
0029     mViewer = viewer;
0030 }
0031 
0032 #include "moc_viewerpurposemenuwidget.cpp"