File indexing completed on 2025-01-19 05:20:18
0001 /* 0002 This file is part of the Okteta Kasten module, made within the KDE community. 0003 0004 SPDX-FileCopyrightText: 2009 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_BYTEARRAYSEQUENCEGENERATOR_HPP 0010 #define KASTEN_BYTEARRAYSEQUENCEGENERATOR_HPP 0011 0012 // Kasten core 0013 #include <Kasten/AbstractModelDataGenerator> 0014 // Qt 0015 #include <QObject> 0016 #include <QString> 0017 0018 namespace Kasten { 0019 0020 class ByteArraySequenceGeneratorSettings 0021 { 0022 public: 0023 ByteArraySequenceGeneratorSettings(); 0024 ByteArraySequenceGeneratorSettings(const ByteArraySequenceGeneratorSettings&) = default; 0025 0026 ~ByteArraySequenceGeneratorSettings() = default; 0027 0028 ByteArraySequenceGeneratorSettings& operator=(const ByteArraySequenceGeneratorSettings&) = default; 0029 0030 public: 0031 QByteArray pattern; 0032 int count = 1; 0033 }; 0034 0035 class ByteArraySequenceGenerator : public AbstractModelDataGenerator 0036 { 0037 Q_OBJECT 0038 0039 public: 0040 ByteArraySequenceGenerator(); 0041 0042 ~ByteArraySequenceGenerator() override; 0043 0044 public: // AbstractModelDataGenerator API 0045 QMimeData* generateData() override; 0046 0047 public: 0048 ByteArraySequenceGeneratorSettings settings() const; 0049 void setSettings(const ByteArraySequenceGeneratorSettings& settings); 0050 0051 private: 0052 ByteArraySequenceGeneratorSettings mSettings; 0053 }; 0054 0055 inline ByteArraySequenceGeneratorSettings ByteArraySequenceGenerator::settings() const { return mSettings; } 0056 inline void ByteArraySequenceGenerator::setSettings(const ByteArraySequenceGeneratorSettings& settings) 0057 { 0058 mSettings = settings; 0059 // Q_EMIT settingsChanged(); 0060 } 0061 0062 } 0063 0064 #endif