File indexing completed on 2024-12-08 04:00:45

0001 /*
0002     SPDX-FileCopyrightText: 2022 Friedrich W. H. Kossebau <kossebau@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #include "tool.hpp"
0008 
0009 // own
0010 #include "widget.hpp"
0011 // core
0012 #include <scanresult.hpp>
0013 
0014 namespace Kodaskanna
0015 {
0016 namespace PlainTextDisplay
0017 {
0018 
0019 Tool::Tool(QObject *parent)
0020     : AbstractDisplayTool(parent)
0021     , m_widget(new Widget)
0022 {
0023     m_widget->setEnabled(false);
0024 }
0025 
0026 Tool::~Tool() = default;
0027 
0028 void Tool::setScanResult(const ScanResult &scanResult)
0029 {
0030     m_widget->setEnabled(scanResult.isSuccess());
0031     m_widget->setText(scanResult.text());
0032 }
0033 
0034 QWidget *Tool::widget()
0035 {
0036     return m_widget;
0037 }
0038 
0039 }
0040 }