Files
QTeletextMaker/pagebase.h

56 lines
1.8 KiB
C
Raw Normal View History

2020-09-11 12:06:06 +01:00
/*
2022-12-31 21:19:15 +00:00
* Copyright (C) 2020-2023 Gavin MacGregor
2020-09-11 12:06:06 +01:00
*
* This file is part of QTeletextMaker.
*
* QTeletextMaker is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* QTeletextMaker is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with QTeletextMaker. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef PAGEBASE_H
#define PAGEBASE_H
#include <QByteArray>
// If we inherit from QObject then we can't copy construct, so "make a new subpage that's a copy of this one" wouldn't work
class PageBase //: public QObject
{
//Q_OBJECT
public:
enum ControlBitsEnum { C4ErasePage, C5Newsflash, C6Subtitle, C7SuppressHeader, C8Update, C9InterruptedSequence, C10InhibitDisplay, C11SerialMagazine, C12NOS, C13NOS, C14NOS };
2020-09-11 12:06:06 +01:00
PageBase();
2020-12-15 19:44:39 +00:00
virtual ~PageBase();
2020-09-16 20:49:52 +01:00
2020-12-06 17:57:05 +00:00
virtual bool isEmpty() const;
2020-12-15 19:44:39 +00:00
virtual QByteArray packet(int) const;
virtual QByteArray packet(int, int) const;
2021-06-22 13:22:35 +01:00
virtual bool packetExists(int i) const { return m_displayPackets[i] != nullptr; }
virtual bool packetExists(int i, int j) const { return m_designationPackets[i-26][j] != nullptr; }
virtual bool setPacket(int, QByteArray);
virtual bool setPacket(int, int, QByteArray);
2020-12-15 19:44:39 +00:00
// bool deletePacket(int);
// bool deletePacket(int, int);
virtual bool controlBit(int bitNumber) const { return m_controlBits[bitNumber]; }
virtual bool setControlBit(int, bool);
2020-09-11 12:06:06 +01:00
private:
bool m_controlBits[11];
2020-12-15 19:44:39 +00:00
QByteArray *m_displayPackets[26], *m_designationPackets[4][16];
2020-09-11 12:06:06 +01:00
};
#endif