UserMsg Pile   version 0.0.1
UserMsg pile.
usermsgentry.h
Go to the documentation of this file.
1 
10 #ifndef GUARD_USERMSGENTRY_H_INCLUDE
11 #define GUARD_USERMSGENTRY_H_INCLUDE
12 
13 #include <usermsg/usermsg-config.h>
14 
15 #include <QString>
16 #include <QDateTime>
17 
19 class USERMSG_EXPORT UserMsgEntry {
20 
21 public:
22 
24  enum Type {
25  UTERROR = 0,
26  UTWARNING,
27  UTINFO,
28  UTDBG_ERROR,
29  UTDBG_WARNING,
30  UTDBG_INFO
31  };
32 
33 private:
34 
35  QString message_;
36  QDateTime moment_;
37  Type type_;
39 public:
40 
42  UserMsgEntry ();
43 
45  UserMsgEntry (
46  const UserMsgEntry & other);
47 
49  UserMsgEntry (
50  Type ty,
51  const QString & message);
52 
54  virtual ~UserMsgEntry();
55 
56 
58  const QString &
59  message () const {
60  return message_;
61  }
62 
64  void
66  const QString & value) {
67  message_ = value;
68  }
69 
70 
72  const QDateTime &
73  moment () const {
74  return moment_;
75  }
76 
78  void
80  const QDateTime & value) {
81  moment_ = value;
82  }
83 
84 
86  bool
87  isEnabled () const;
88 
90  Type
91  type () const {
92  return type_;
93  }
94 
96  void
98  Type value) {
99  type_= value;
100  }
101 
103  QString
104  typeName () const {
105  return typeName (type_);
106  }
107 
109  QString
110  typeNameCap () const {
111  return typeNameCap (type_);
112  }
113 
114 
115 public:
116 
118  static QString
119  typeName (
120  Type value);
121 
123  static QString
124  typeNameCap (
125  Type value);
126 
128  static bool
129  isEnabled (
130  Type value);
131 
132 protected:
133 
134 private:
135 
136 };
137 
138 #endif // GUARD_USERMSGENTRY_H_INCLUDE
const QString & message() const
Get the message.
Definition: usermsgentry.h:59
QString typeName() const
Get the name of the type in all-lower-case.
Definition: usermsgentry.h:104
void setMessage(const QString &value)
Set the message.
Definition: usermsgentry.h:65
void setType(Type value)
Set the type.
Definition: usermsgentry.h:97
Type type() const
Get the type.
Definition: usermsgentry.h:91
Type
kind of the message
Definition: usermsgentry.h:24
user messages mediator
Definition: usermsgentry.h:19
QString typeNameCap() const
get the name of the type with first letter in words capitalized
Definition: usermsgentry.h:110
const QDateTime & moment() const
Get the moment.
Definition: usermsgentry.h:73
void setMoment(const QDateTime &value)
Set the moment.
Definition: usermsgentry.h:79