libbbb
1.2.1
Groups common code used in some applications and libraries.
libbbb
Classes
Files
File List
src
antenna
autothread
backjob
bytebuffer
core
doevents
dynstack
jobinterf
lists
markup
memtrack
refcount
rexscript
templates
timer
usermsg
usrmsg.cc
usrmsg.h
usrmsgmng.cc
usrmsgmng.h
varmap
File Members
•
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
usrmsgmng.h
Go to the documentation of this file.
1
/* ========================================================================= */
2
/* ------------------------------------------------------------------------- */
/*
12
13
14
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
Please read COPYING and README files in root folder
16
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17
*/
18
/* ------------------------------------------------------------------------- */
19
/* ========================================================================= */
20
#ifndef __USRMSGMNG_INC__
21
#define __USRMSGMNG_INC__
22
//
23
//
24
//
25
//
26
/* INCLUDES ------------------------------------------------------------ */
27
28
#include <libbbb/libbbb.h>
29
30
#include <QString>
31
#include <QFile>
32
33
/* INCLUDES ============================================================ */
34
//
35
//
36
//
37
//
38
/* DEFINITIONS --------------------------------------------------------- */
39
40
/* DEFINITIONS ========================================================= */
41
//
42
//
43
//
44
//
45
/* CLASS --------------------------------------------------------------- */
46
50
class
51
BBBSHARED_EXPORT
52
UsrMsgMng
:
public
QObject {
53
Q_OBJECT
54
55
//
56
//
57
//
58
//
59
/* DEFINITIONS ----------------------------------------------------- */
60
61
/* DEFINITIONS ===================================================== */
62
//
63
//
64
//
65
//
66
/* DATA ------------------------------------------------------------ */
67
68
private
:
69
70
74
bool
b_log_;
75
76
80
bool
b_stdout_;
81
82
86
bool
b_broadcast_;
87
88
94
QFile log_;
95
96
100
static
UsrMsgMng
* uniq_;
101
102
103
/* DATA ============================================================ */
104
//
105
//
106
//
107
//
108
/* FUNCTIONS ------------------------------------------------------- */
109
110
111
115
UsrMsgMng
(
116
QObject * parent = NULL
117
);
118
119
123
virtual
~
UsrMsgMng
(
void
);
124
125
126
public
:
127
128
132
static
void
init (
void
)
133
{
134
if
( uniq_ == NULL )
135
uniq_ =
new
UsrMsgMng
();
136
}
137
138
142
static
void
end (
void
)
143
{
144
if
( uniq_ != NULL )
145
{
146
delete
uniq_;
147
uniq_ = NULL;
148
}
149
}
150
151
155
static
UsrMsgMng
* unique (
void
)
156
{
return
uniq_; }
157
158
164
static
void
loadSettings (
void
);
165
166
172
static
void
saveSettings (
void
);
173
174
175
176
180
bool
logEnabled (
void
)
181
{
return
b_log_; }
182
183
187
void
enableLog (
void
)
188
{ b_log_ =
true
; }
189
190
194
void
disableLog (
void
)
195
{ b_log_ =
false
; }
196
197
201
bool
stdoutEnabled (
void
)
202
{
return
b_stdout_; }
203
204
208
void
enableStdout (
void
)
209
{ b_stdout_ =
true
; }
210
211
215
void
disableStdout (
void
)
216
{ b_stdout_ =
false
; }
217
218
222
bool
broadcastEnabled (
void
)
223
{
return
b_stdout_; }
224
225
229
void
enableBroadcast (
void
)
230
{ b_broadcast_ =
true
; }
231
232
236
void
disableBroadcast (
void
)
237
{ b_broadcast_ =
false
; }
238
239
243
QString logFile (
void
)
244
{
return
log_.fileName(); }
245
246
254
bool
setLogFile (
const
QString & s );
255
256
257
258
signals:
259
260
264
void
say (
const
QString & s );
265
266
267
public
slots:
268
269
273
void
show (
const
QString & s );
274
275
276
/* FUNCTIONS ======================================================= */
277
//
278
//
279
//
280
//
281
282
};
/* class UsrMsgMng */
283
284
/* CLASS =============================================================== */
285
//
286
//
287
//
288
//
289
290
#endif // __USRMSGMNG_INC__
291
/* ------------------------------------------------------------------------- */
292
/* ========================================================================= */
src
usermsg
usrmsgmng.h
Generated on Thu Aug 8 2013 20:10:33 for libbbb by
1.8.3.1