QtPdCom  1.3.3
Message.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * Copyright (C) 2009-2023 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 QTPDCOM_MESSAGE_H
23 #define QTPDCOM_MESSAGE_H
24 
25 #include "Export.h"
26 
27 #include <QObject>
28 
29 #include <memory>
30 
31 namespace QtPdCom {
32 
33 /****************************************************************************/
34 
38  public QObject
39 {
40  Q_OBJECT
41 
42  friend class MessageModel;
43 
44  public:
47  enum Type {
49  Warning,
52  Critical
54  };
55  Q_ENUM(Type);
56 
57  Message(QObject *parent = nullptr);
58  ~Message();
59 
60  bool isActive() const;
61  double getTime() const;
62  Type getType() const;
63  const QString &getPath() const;
64  int getIndex() const;
65  QString getText(const QString & = QString()) const;
66  QString getDescription(const QString & = QString()) const;
67  QString getTimeString() const;
68 
71  struct Exception {
74  Exception(const QString &msg): msg(msg) {}
75  QString msg;
76  };
77 
78  signals:
79  void stateChanged();
80 
81  private:
82  class Q_DECL_HIDDEN Impl;
83  std::unique_ptr<Impl> impl;
84 };
85 
86 /****************************************************************************/
87 
88 } // namespace
89 
90 Q_DECLARE_METATYPE(const QtPdCom::Message*)
91 
92 #endif
List of Messages.
Definition: MessageModel.h:42
Exception(const QString &msg)
Constructor.
Definition: Message.h:74
Definition: BroadcastModel.h:32
QString msg
Exception message.
Definition: Message.h:75
Process message.
Definition: Message.h:37
Exception type.
Definition: Message.h:71
Error, that influences the process flow.
Definition: Message.h:51
Definition: MessageImpl.h:39
#define QTPDCOM_PUBLIC
Definition: Export.h:30
std::unique_ptr< Impl > impl
Definition: Message.h:83
Non-critical information.
Definition: Message.h:48
Type
Message type.
Definition: Message.h:47