QtPdCom  1.3.3
MessageItem.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * Copyright (C) 2022 Florian Pose <fp@igh.de>
4  *
5  * This file is part of the QtPdCom library.
6  *
7  * The QtPdCom library is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * The QtPdCom library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15  * License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with the QtPdCom Library. If not, see <http://www.gnu.org/licenses/>.
19  *
20  ****************************************************************************/
21 
22 #ifndef PD_MESSAGE_ITEM
23 #define PD_MESSAGE_ITEM
24 
25 #include "MessageModelImpl.h"
26 
27 #include <QObject>
28 
29 /****************************************************************************/
30 
31 namespace QtPdCom {
32 
33 bool seqNoLessThan(uint32_t, uint32_t);
34 
35 /****************************************************************************/
36 
38 {
39  MessageItem() = delete;
40  MessageItem(Message *, MessageModel::Impl *, quint64);
41 
42  Message::Type getType() const;
43  QString getText(const QString &) const;
44  QString getDescription(const QString &) const;
45  QString getTimeString() const;
46  QString getResetTimeString() const;
47  bool isActive() const;
48 
49  static bool seqNoLessThan(const MessageItem *, const MessageItem *);
50  static bool setTimeLessThan(const MessageItem *, const MessageItem *);
51  static bool levelNoLessThan(const MessageItem *, const MessageItem *);
52  static bool lessThan(const MessageItem *, const MessageItem *);
53 
54  Message * const message;
56 
57  quint32 seqNo;
58 
59  quint64 const setTime;
60  quint64 resetTime;
61 };
62 
63 /****************************************************************************/
64 
65 }
66 
67 #endif
68 
69 /****************************************************************************/
static bool setTimeLessThan(const MessageItem *, const MessageItem *)
Definition: MessageItem.cpp:107
QString getTimeString() const
Definition: MessageItem.cpp:73
static bool seqNoLessThan(const MessageItem *, const MessageItem *)
Definition: MessageItem.cpp:99
quint64 resetTime
Definition: MessageItem.h:60
Message *const message
Definition: MessageItem.h:54
Definition: BroadcastModel.h:32
Definition: MessageItem.h:37
Process message.
Definition: Message.h:37
quint64 const setTime
Definition: MessageItem.h:59
bool seqNoLessThan(uint32_t a, uint32_t b)
Definition: MessageItem.cpp:29
QString getResetTimeString() const
Definition: MessageItem.cpp:80
QString getText(const QString &) const
Definition: MessageItem.cpp:57
static bool levelNoLessThan(const MessageItem *, const MessageItem *)
Definition: MessageItem.cpp:117
static bool lessThan(const MessageItem *, const MessageItem *)
Definition: MessageItem.cpp:146
bool isActive() const
Definition: MessageItem.cpp:92
MessageModel::Impl *const modelImpl
Definition: MessageItem.h:55
Definition: MessageModelImpl.h:41
Message::Type getType() const
Definition: MessageItem.cpp:50
QString getDescription(const QString &) const
Definition: MessageItem.cpp:65
quint32 seqNo
Definition: MessageItem.h:57
Type
Message type.
Definition: Message.h:47