CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Libs
Core
ctkErrorLogAbstractMessageHandler.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Library: CTK
4
5
Copyright (c) Kitware Inc.
6
7
Licensed under the Apache License, Version 2.0 (the "License");
8
you may not use this file except in compliance with the License.
9
You may obtain a copy of the License at
10
11
http://www.apache.org/licenses/LICENSE-2.0.txt
12
13
Unless required by applicable law or agreed to in writing, software
14
distributed under the License is distributed on an "AS IS" BASIS,
15
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
See the License for the specific language governing permissions and
17
limitations under the License.
18
19
=========================================================================*/
20
21
#ifndef CTKERRORLOGABSTRACTMESSAGEHANDLER_H
22
#define CTKERRORLOGABSTRACTMESSAGEHANDLER_H
23
24
// Qt includes
25
#include <QObject>
26
#include <QDateTime>
27
28
// CTK includes
29
#include "ctkCoreExport.h"
30
#include "
ctkErrorLogLevel.h
"
31
#include "
ctkErrorLogTerminalOutput.h
"
32
33
//------------------------------------------------------------------------------
34
class
ctkErrorLogAbstractMessageHandlerPrivate;
35
struct
ctkErrorLogContext
;
36
37
//------------------------------------------------------------------------------
39
class
CTK_CORE_EXPORT
ctkErrorLogAbstractMessageHandler
:
public
QObject
40
{
41
Q_OBJECT
42
public
:
43
typedef
QObject
Superclass
;
45
ctkErrorLogAbstractMessageHandler
();
46
virtual
~
ctkErrorLogAbstractMessageHandler
();
47
48
virtual
QString handlerName()
const
= 0;
49
50
QString handlerPrettyName()
const
;
51
52
bool
enabled()
const
;
53
void
setEnabled(
bool
value);
54
55
void
handleMessage(
const
QString& threadId,
ctkErrorLogLevel::LogLevel
logLevel,
56
const
QString& origin,
const
ctkErrorLogContext
& logContext,
57
const
QString &text);
58
59
ctkErrorLogTerminalOutput
* terminalOutput(
ctkErrorLogTerminalOutput::TerminalOutput
terminalOutputType)
const
;
60
void
setTerminalOutput(
ctkErrorLogTerminalOutput::TerminalOutput
terminalOutputType,
61
ctkErrorLogTerminalOutput
* terminalOutput);
62
63
Q_SIGNALS:
64
void
messageHandled(
const
QDateTime& currentDateTime,
const
QString& threadId,
65
ctkErrorLogLevel::LogLevel
logLevel,
const
QString& origin,
66
const
ctkErrorLogContext
& logContext,
const
QString& text);
67
68
protected
:
69
void
setHandlerPrettyName(
const
QString& newHandlerPrettyName);
70
71
virtual
void
setEnabledInternal(
bool
value) = 0;
72
73
protected
:
74
QScopedPointer<ctkErrorLogAbstractMessageHandlerPrivate>
d_ptr
;
75
76
private
:
77
Q_DECLARE_PRIVATE(
ctkErrorLogAbstractMessageHandler
)
78
Q_DISABLE_COPY(
ctkErrorLogAbstractMessageHandler
)
79
};
80
81
82
#endif // CTKERRORLOGABSTRACTMESSAGEHANDLER_H
ctkErrorLogAbstractMessageHandler::d_ptr
QScopedPointer< ctkErrorLogAbstractMessageHandlerPrivate > d_ptr
Definition:
ctkErrorLogAbstractMessageHandler.h:74
ctkErrorLogAbstractMessageHandler
Definition:
ctkErrorLogAbstractMessageHandler.h:39
ctkErrorLogTerminalOutput.h
ctkErrorLogLevel::LogLevel
LogLevel
Definition:
ctkErrorLogLevel.h:39
ctkErrorLogLevel.h
ctkErrorLogContext
Definition:
ctkErrorLogContext.h:32
ctkErrorLogTerminalOutput::TerminalOutput
TerminalOutput
Definition:
ctkErrorLogTerminalOutput.h:45
ctkErrorLogTerminalOutput
Definition:
ctkErrorLogTerminalOutput.h:36
ctkErrorLogAbstractMessageHandler::Superclass
QObject Superclass
Definition:
ctkErrorLogAbstractMessageHandler.h:43
Generated on Sat Dec 1 2018 15:39:49 for CTK by
1.8.14