File indexing completed on 2024-05-12 05:17:28

0001 /*
0002     SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef UIC9183TICKETLAYOUTMODEL_H
0008 #define UIC9183TICKETLAYOUTMODEL_H
0009 
0010 #include <KItinerary/Uic9183TicketLayout>
0011 
0012 #include <QAbstractTableModel>
0013 
0014 /** Model showing a U_TLAY block of an UIC 918-3 ticket. */
0015 class Uic9183TicketLayoutModel : public QAbstractTableModel
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit Uic9183TicketLayoutModel(QObject *parent = nullptr);
0020     ~Uic9183TicketLayoutModel();
0021 
0022     void setLayout(const KItinerary::Uic9183TicketLayout &layout);
0023 
0024     QStringList supportedTemplates();
0025     void setLayoutTemplate(int tplIndex);
0026 
0027     int columnCount(const QModelIndex &parent) const override;
0028     int rowCount(const QModelIndex &parent) const override;
0029     QVariant data(const QModelIndex &index, int role) const override;
0030     QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
0031 
0032 private:
0033     KItinerary::Uic9183TicketLayout m_layout;
0034     int m_layoutTemplate = -1;
0035 };
0036 
0037 #endif // UIC9183TICKETLAYOUTMODEL_H