2020-09-06 16:47:38 +01:00
|
|
|
/*
|
2024-01-01 00:12:17 +00:00
|
|
|
* Copyright (C) 2020-2024 Gavin MacGregor
|
2020-09-06 16:47:38 +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 X26DOCKWIDGET_H
|
|
|
|
|
#define X26DOCKWIDGET_H
|
|
|
|
|
|
2021-06-23 16:18:12 +01:00
|
|
|
#include <QAbstractListModel>
|
2020-09-06 16:47:38 +01:00
|
|
|
#include <QCheckBox>
|
|
|
|
|
#include <QComboBox>
|
|
|
|
|
#include <QDockWidget>
|
|
|
|
|
#include <QGroupBox>
|
2021-07-01 21:31:29 +01:00
|
|
|
#include <QLabel>
|
2021-09-09 18:57:55 +01:00
|
|
|
#include <QMenu>
|
2020-09-06 16:47:38 +01:00
|
|
|
#include <QPushButton>
|
|
|
|
|
#include <QRadioButton>
|
|
|
|
|
#include <QSpinBox>
|
2020-10-18 20:59:04 +01:00
|
|
|
#include <QStackedLayout>
|
2020-09-06 16:47:38 +01:00
|
|
|
#include <QTableView>
|
|
|
|
|
|
|
|
|
|
#include "mainwidget.h"
|
2021-06-23 16:18:12 +01:00
|
|
|
#include "render.h"
|
2024-04-22 22:15:10 +01:00
|
|
|
#include "x26menus.h"
|
2020-09-06 16:47:38 +01:00
|
|
|
#include "x26model.h"
|
|
|
|
|
|
2021-06-23 16:18:12 +01:00
|
|
|
class CharacterListModel : public QAbstractListModel
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CharacterListModel(QObject *parent = 0);
|
|
|
|
|
|
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
2023-08-27 14:25:16 +01:00
|
|
|
void setCharacterSet(int characterSet);
|
2021-06-23 16:18:12 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
TeletextFontBitmap m_fontBitmap;
|
|
|
|
|
int m_characterSet;
|
|
|
|
|
};
|
|
|
|
|
|
2020-09-06 16:47:38 +01:00
|
|
|
class X26DockWidget : public QDockWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
X26DockWidget(TeletextWidget *parent);
|
|
|
|
|
|
|
|
|
|
public slots:
|
2023-08-27 14:25:16 +01:00
|
|
|
void insertTriplet(int modeExt, bool after);
|
2024-05-22 16:30:02 +01:00
|
|
|
void insertTriplet(int modeExt, int row = -1);
|
2022-03-06 12:00:53 +00:00
|
|
|
void insertTripletCopy();
|
2020-09-06 16:47:38 +01:00
|
|
|
void deleteTriplet();
|
|
|
|
|
void customMenuRequested(QPoint pos);
|
|
|
|
|
void loadX26List();
|
|
|
|
|
void unloadX26List();
|
2023-08-27 14:25:16 +01:00
|
|
|
void rowSelected(const QModelIndex ¤t, const QModelIndex &previous);
|
|
|
|
|
void updateAllRawTripletSpinBoxes(const QModelIndex &index);
|
|
|
|
|
void updateRawTripletDataSpinBox(const QModelIndex &index);
|
|
|
|
|
void updateAllCookedTripletWidgets(const QModelIndex & index);
|
|
|
|
|
void rawTripletAddressSpinBoxChanged(int value);
|
|
|
|
|
void rawTripletModeSpinBoxChanged(int value);
|
|
|
|
|
void rawTripletDataSpinBoxChanged(int value);
|
|
|
|
|
void cookedRowSpinBoxChanged(const int value);
|
|
|
|
|
void cookedColumnSpinBoxChanged(const int value);
|
|
|
|
|
void cookedModeMenuSelected(const int value);
|
|
|
|
|
void updateModelFromCookedWidget(const int value, const int role);
|
|
|
|
|
void selectX26ListRow(int row);
|
2020-09-06 16:47:38 +01:00
|
|
|
|
2021-02-12 19:19:33 +00:00
|
|
|
protected:
|
|
|
|
|
void keyPressEvent(QKeyEvent *event) override;
|
2021-06-23 16:18:12 +01:00
|
|
|
CharacterListModel m_characterListModel;
|
2021-02-12 19:19:33 +00:00
|
|
|
|
2020-09-06 16:47:38 +01:00
|
|
|
private:
|
|
|
|
|
QTableView *m_x26View;
|
|
|
|
|
X26Model *m_x26Model;
|
2020-10-18 20:59:04 +01:00
|
|
|
QSpinBox *m_cookedRowSpinBox, *m_cookedColumnSpinBox;
|
2022-03-06 12:00:53 +00:00
|
|
|
QMenu *m_cookedModeMenu, *m_insertBeforeMenu, *m_insertAfterMenu;
|
2021-09-09 18:57:55 +01:00
|
|
|
QPushButton *m_cookedModePushButton;
|
2020-09-06 16:47:38 +01:00
|
|
|
QSpinBox *m_rawTripletAddressSpinBox, *m_rawTripletModeSpinBox, *m_rawTripletDataSpinBox;
|
2020-10-18 20:59:04 +01:00
|
|
|
QStackedLayout *m_rawOrCookedStackedLayout;
|
|
|
|
|
QComboBox *m_colourComboBox;
|
|
|
|
|
QRadioButton *m_fullRowColourThisRowOnlyRadioButton, *m_fullRowColourDownToBottomRadioButton;
|
2021-01-24 22:08:06 +00:00
|
|
|
QComboBox *m_characterCodeComboBox;
|
2020-10-18 20:59:04 +01:00
|
|
|
QComboBox *m_flashModeComboBox, *m_flashRateComboBox;
|
|
|
|
|
QComboBox *m_textSizeComboBox;
|
|
|
|
|
QCheckBox *m_displayAttributeBoxingCheckBox, *m_displayAttributeConcealCheckBox, *m_displayAttributeInvertCheckBox, *m_displayAttributeUnderlineCheckBox;
|
2021-04-06 18:24:42 +01:00
|
|
|
QComboBox *m_objectSourceComboBox, *m_objectRequiredAtLevelsComboBox;
|
2021-07-01 21:31:29 +01:00
|
|
|
QLabel *m_invokeLocalObjectDesignationCodeLabel, *m_invokeLocalObjectTripletNumberLabel;
|
2020-10-18 20:59:04 +01:00
|
|
|
QSpinBox *m_invokeLocalObjectDesignationCodeSpinBox, *m_invokeLocalObjectTripletNumberSpinBox;
|
|
|
|
|
QSpinBox *m_invokePOPSubPageSpinBox, *m_invokePOPPacketNumberSpinBox;
|
|
|
|
|
QComboBox *m_invokePOPTripletNumberComboBox, *m_invokePOPPointerBitsComboBox;
|
|
|
|
|
QStackedLayout *m_invokeObjectSourceStackedLayout, *m_tripletParameterStackedLayout;
|
2021-04-06 18:54:51 +01:00
|
|
|
QComboBox *m_DRCSModeRequiredAtLevelsComboBox;
|
2020-10-18 20:59:04 +01:00
|
|
|
QRadioButton *m_DRCSModeGlobalRadioButton, *m_DRCSModeNormalRadioButton;
|
|
|
|
|
QSpinBox *m_DRCSModeSubPageSpinBox;
|
|
|
|
|
QRadioButton *m_DRCSCharacterGlobalRadioButton, *m_DRCSCharacterNormalRadioButton;
|
|
|
|
|
QSpinBox *m_DRCSCharacterCodeSpinBox;
|
|
|
|
|
QCheckBox *m_fontStyleProportionalCheckBox, *m_fontStyleBoldCheckBox, *m_fontStyleItalicCheckBox;
|
|
|
|
|
QSpinBox *m_fontStyleRowsSpinBox;
|
2021-01-24 22:08:06 +00:00
|
|
|
QSpinBox *m_reservedPDCSpinBox;
|
2020-10-18 20:59:04 +01:00
|
|
|
QComboBox *m_terminationMarkerPageTypeComboBox;
|
|
|
|
|
QCheckBox *m_terminationMarkerMoreFollowsCheckBox;
|
2022-03-06 12:00:53 +00:00
|
|
|
QPushButton *m_insertBeforePushButton, *m_insertAfterPushButton, *m_insertCopyPushButton, *m_deletePushButton;
|
2020-09-06 16:47:38 +01:00
|
|
|
|
2024-04-22 22:15:10 +01:00
|
|
|
ModeTripletNames m_modeTripletNames;
|
|
|
|
|
|
2020-09-06 16:47:38 +01:00
|
|
|
TeletextWidget *m_parentMainWidget;
|
2022-10-04 21:22:02 +01:00
|
|
|
|
|
|
|
|
void disableTripletWidgets();
|
|
|
|
|
|
2020-09-06 16:47:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|