LibEngsas
elogobjectprivate.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2013 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  MA 02110-1301 USA.
18 */
19 
20 #ifndef ELOGOBJECTPRIVATE_H
21 #define ELOGOBJECTPRIVATE_H
22 
23 #include <eobject.h>
24 
25 class EWidget;
26 
27 #include <QColor>
28 #include <QMutex>
29 #include <QFile>
30 
31 class QTextEdit;
32 
37 class ELogObjectPrivate : public EObject
38 {
39  Q_OBJECT
40  public:
41  ELogObjectPrivate(QObject *parent = NULL);
43 
44  void init(QString filePath);
45  void setup(EObject *object);
46  void setup(EWidget *object);
47 
48  private slots:
52 #if QT_VERSION >= 0x050000
53  void addMessage(QtMsgType type, const QMessageLogContext &content, const QString msg);
54 #else
55  void addMessage(QtMsgType type, const QString msg);
56 #endif
57  void setInformation(QString msg);
58  void setWarning(QString msg);
59  void setError(QString msg);
60 
61  private:
62  void appendMessage(QString msg, QColor color);
63  void setupLogWidget();
64 
65  QMutex mutex;
66  QTextEdit *logEdit;
67  QFile logFile;
68 };
69 
70 #endif // ELOGOBJECTPRIVATE_H
Mostly the same as EWidget but for QObject as base class.
Definition: eobject.h:42
void appendMessage(QString msg, QColor color)
Definition: elogobjectprivate.cpp:132
void setup(EObject *object)
Definition: elogobjectprivate.cpp:59
void setWarning(QString msg)
Definition: elogobjectprivate.cpp:122
void addMessage(QtMsgType type, const QString msg)
Definition: elogobjectprivate.cpp:82
void init(QString filePath)
Definition: elogobjectprivate.cpp:47
~ELogObjectPrivate()
Definition: elogobjectprivate.cpp:39
QTextEdit * logEdit
Definition: elogobjectprivate.h:66
EWidget is a base class for common widgets.
Definition: ewidget.h:48
void setupLogWidget()
Definition: elogobjectprivate.cpp:145
void setInformation(QString msg)
Definition: elogobjectprivate.cpp:117
void setError(QString msg)
Definition: elogobjectprivate.cpp:127
Logging Object used internal by ELogObject.
Definition: elogobjectprivate.h:37
ELogObjectPrivate(QObject *parent=NULL)
Definition: elogobjectprivate.cpp:33
QFile logFile
Definition: elogobjectprivate.h:67
QMutex mutex
Definition: elogobjectprivate.h:65