Piles
home
docs
piles
GitHub
UserMsg Pile
version 0.0.1
UserMsg pile.
Main Page
Related Pages
Classes
Files
File List
File Members
usermsgman.h
Go to the documentation of this file.
1
10
#ifndef GUARD_USERMSGMAN_H_INCLUDE
11
#define GUARD_USERMSGMAN_H_INCLUDE
12
13
#include <usermsg/usermsg-config.h>
14
#include <
usermsg/usermsg.h
>
15
16
#include <QObject>
17
#include <QAtomicInt>
18
#include <QFile>
19
20
class
UserMsgStg
;
21
class
UserMsg
;
22
class
LogMsg
;
23
24
class
QTextStream;
25
27
class
USERMSG_EXPORT
UserMsgMan
:
public
QObject {
28
Q_OBJECT
29
30
friend
class
LogMsg
;
31
32
public
:
33
35
typedef
void (*KbShowMessage) (
const
UserMsg
& um);
36
37
private
:
38
39
bool
40
enabled_;
42
UserMsgStg
*
43
settings_;
45
QVector<UserMsg>
46
message_list_;
48
QAtomicInt
49
lock_;
51
KbShowMessage
52
kb_show_;
54
QFile *
55
log_file_;
57
QTextStream *
58
logger_;
60
static
UserMsgMan
*
61
singleton_;
63
private
:
64
66
UserMsgMan
();
67
69
virtual
~
UserMsgMan
();
70
71
public
:
72
74
static
UserMsgMan
*
75
singleton ();
76
78
static
bool
79
init (
80
bool
start_disabled =
false
);
81
83
static
void
84
end ();
85
87
static
bool
88
isInitialized();
89
90
92
static
const
UserMsgStg
&
93
settings ();
94
96
static
void
97
setSettings (
98
const
UserMsgStg
& value);
99
100
102
static
KbShowMessage
103
callbackShow ();
104
106
static
void
107
setCallbackShow (
108
KbShowMessage value);
109
110
112
static
const
QString &
113
logFile ();
114
116
static
void
117
setLogFile (
118
const
QString & value);
119
121
static
void
122
autosetLogFile (
123
const
QString & base_name);
124
125
127
static
void
128
disable ();
129
131
static
void
132
enable (
133
bool
collapse_messages =
false
);
134
136
static
bool
137
isEnabled();
138
139
141
static
bool
142
isVisible (
143
UserMsgEntry::Type
value);
144
146
static
void
147
setVisible (
148
UserMsgEntry::Type
ty,
149
bool
b_visible);
150
152
static
void
153
setAllVisible (
154
bool
include_debug);
155
157
static
void
158
show (
159
const
UserMsg
& um);
160
161
protected
:
162
164
static
void
165
autostart ();
166
167
169
void
170
_addMessageToQueue (
171
const
UserMsg
& um);
172
174
void
175
_showMessage (
176
const
UserMsg
& um);
177
179
void
180
_showQueue (
181
bool
collapse_messages);
182
184
void
185
_openLogFile ();
186
188
void
189
_logMessage (
190
const
UserMsg
& um);
191
192
signals:
193
195
void
196
signalShow(
197
UserMsg
um);
198
199
200
};
// class UserMsgMan
201
202
#endif // GUARD_USERMSGMAN_H_INCLUDE
usermsg.h
Declarations for UserMsg class.
UserMsgStg
User messages mediator settings.
Definition:
usermsgstg.h:19
UserMsg
user messages mediator
Definition:
usermsg.h:21
UserMsgEntry::Type
Type
kind of the message
Definition:
usermsgentry.h:24
UserMsgMan
brief description
Definition:
usermsgman.h:27
LogMsg
Log messages.
Definition:
logmsg.h:21