KItinerary

vendor0080block.h
1/*
2 SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "kitinerary_export.h"
10#include "uic9183block.h"
11
12class QString;
13
14namespace KItinerary {
15
16/** UIC 918.3 0080BL vendor data block order block. */
17class KITINERARY_EXPORT Vendor0080BLOrderBlock
18{
19 Q_GADGET
20 Q_PROPERTY(QDate validFrom READ validFrom)
21 Q_PROPERTY(QDate validTo READ validTo)
22 Q_PROPERTY(QString serialNumber READ serialNumber)
23public:
25 Vendor0080BLOrderBlock(const Uic9183Block &block, int offset);
26
27 bool isNull() const;
28
29 QDate validFrom() const;
30 QDate validTo() const;
31 QString serialNumber() const;
32
33private:
34 Uic9183Block m_block;
35 int m_offset = 0;
36};
37
38/** UIC 918.3 0080BL vendor data block sub-block. */
39class KITINERARY_EXPORT Vendor0080BLSubBlock
40{
41 Q_GADGET
42 Q_PROPERTY(QString content READ toString)
43public:
45 Vendor0080BLSubBlock(const Uic9183Block &block, int offset);
46
47 bool isNull() const;
48
49 /** Type of the S-block. */
50 const char *id() const;
51 /** Size of the entire S-block. */
52 int size() const;
53 /** Next S-block in the 0080BL block. */
54 Vendor0080BLSubBlock nextBlock() const;
55
56 /** Size of the content of the S-block. */
57 int contentSize() const;
58 /** Content data of the S-block. */
59 const char *content() const;
60
61 /** Content as Unicode string. */
62 QString toString() const;
63
64private:
65 Uic9183Block m_block;
66 int m_offset = 0;
67};
68
69
70/** UIC 918.3 0080BL vendor data block. */
71class KITINERARY_EXPORT Vendor0080BLBlock
72{
73 Q_GADGET
74 Q_PROPERTY(int orderBlockCount READ orderBlockCount)
75
76public:
78
79 bool isValid() const;
80 int orderBlockCount() const;
81
82 /** Order block at index @p i. */
83 Q_INVOKABLE KItinerary::Vendor0080BLOrderBlock orderBlock(int i) const;
84
85 /** First S-block, for iterating. */
86 Vendor0080BLSubBlock firstBlock() const;
87 /** Finds a S-block by type. */
88 Vendor0080BLSubBlock findSubBlock(const char id[3]) const;
89 Q_INVOKABLE QVariant findSubBlock(const QString &str) const;
90
91 static constexpr const char RecordId[] = "0080BL";
92private:
93 static int subblockOffset(const Uic9183Block &block);
94
95 Uic9183Block m_block;
96};
97
98class Vendor0080VUCommonData;
99class Vendor0080VUTicketData;
100
101/** UIC 918.3 0080VU vendor data block (DB local public transport extensions).
102 * @see UIC918.3* Interoperabilität Barcode DB Online-Ticker VDV-KA
103 */
104class KITINERARY_EXPORT Vendor0080VUBlock
105{
106public:
108 bool isValid() const;
109
110 const Vendor0080VUCommonData* commonData() const;
111 const Vendor0080VUTicketData* ticketData(int index) const;
112
113 static constexpr const char RecordId[] = "0080VU";
114private:
115 Uic9183Block m_block;
116};
117
118}
A data block from a UIC 918.3 ticket.
UIC 918.3 0080BL vendor data block.
UIC 918.3 0080BL vendor data block order block.
UIC 918.3 0080BL vendor data block sub-block.
UIC 918.3 0080VU vendor data block (DB local public transport extensions).
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:00:34 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.