File indexing completed on 2024-06-02 06:03:10

0001 /*
0002     This file is part of the Okteta Kasten module, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef KASTEN_BYTEARRAYTEXTSTREAMENCODERPREVIEW_HPP
0010 #define KASTEN_BYTEARRAYTEXTSTREAMENCODERPREVIEW_HPP
0011 
0012 // Kasten ui
0013 #include <Kasten/AbstractSelectionView>
0014 
0015 class QTextEdit;
0016 
0017 namespace Kasten {
0018 
0019 class AbstractByteArrayStreamEncoder;
0020 class AbstractModelSelection;
0021 class AbstractModel;
0022 
0023 class ByteArrayTextStreamEncoderPreview : public AbstractSelectionView
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     explicit ByteArrayTextStreamEncoderPreview(AbstractByteArrayStreamEncoder* encoder);
0029     ~ByteArrayTextStreamEncoderPreview() override;
0030 
0031 public: // AbstractSelectionView API
0032     QWidget* widget() const override;
0033     void setData(AbstractModel* model, const AbstractModelSelection* selection) override;
0034 
0035 public Q_SLOTS:
0036     void update();
0037 
0038 private Q_SLOTS:
0039     void setFixedFontByGlobalSettings();
0040 
0041 private:
0042     AbstractByteArrayStreamEncoder* const mEncoder;
0043 
0044     AbstractModel* mModel = nullptr;
0045     const AbstractModelSelection* mSelection = nullptr;
0046 
0047     QTextEdit* mWidget;
0048 };
0049 
0050 }
0051 
0052 #endif