itom
Loading...
Searching...
No Matches
pythonLogWidget.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2024, Institut für Technische Optik (ITO),
5 University of Stuttgart, Germany
6
7 This file is part of itom and its software development toolkit (SDK).
8
9 itom is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Library General Public Licence as published by
11 the Free Software Foundation; either version 2 of the Licence, or (at
12 your option) any later version.
13
14 In addition, as a special exception, the Institut für Technische
15 Optik (ITO) gives you certain additional rights.
16 These rights are described in the ITO LGPL Exception version 1.0,
17 which can be found in the file LGPL_EXCEPTION.txt in this package.
18
19 itom is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22 General Public Licence for more details.
23
24 You should have received a copy of the GNU Library General Public License
25 along with itom. If not, see <http://www.gnu.org/licenses/>.
26*********************************************************************** */
27
28#ifndef PYTHONLOGWIDGET_H
29#define PYTHONLOGWIDGET_H
30
31#ifdef __APPLE__
32extern "C++" {
33#endif
34
35#include "../common/commonGlobal.h"
36
37#include "common/abstractApiWidget.h"
38
39#include "../common/typeDefs.h"
40
41#include "commonWidgets.h"
42
43#include <qscopedpointer.h>
44
46
47class ITOMWIDGETS_EXPORT PythonLogWidget : public ito::AbstractApiWidget
48{
49 Q_OBJECT
50
51 Q_PROPERTY(int maxMessages READ getMaxMessages WRITE setMaxMessages NOTIFY maxMessagesChanged)
52 Q_PROPERTY(bool outputStream READ getOutputStream WRITE setOutputStream)
53 Q_PROPERTY(bool errorStream READ getErrorStream WRITE setErrorStream)
54 Q_PROPERTY(int verticalSizeHint READ getVerticalSizeHint WRITE setVerticalSizeHint)
55 Q_PROPERTY(bool autoScroll READ getAutoScroll WRITE setAutoScroll)
56 Q_PROPERTY(bool removeAnsiEscapeSequences READ getRemoveAnsiEscapeSequences WRITE setRemoveAnsiEscapeSequences)
57
58 WIDGET_ITOM_API
59
60 public Q_SLOTS:
61 void setMaxMessages(const int newMaxMessages);
62 ito::RetVal setOutputStream(bool enabled);
63 ito::RetVal setErrorStream(bool enabled);
64 void setVerticalSizeHint(int value);
65 void clear();
66 void setAutoScroll(bool autoScroll);
67 void setRemoveAnsiEscapeSequences(bool removeAnsiEscapeSequences);
68 void messageReceived(QString message, ito::tStreamMessageType messageType);
69 void showContextMenu(const QPoint &pt);
70
71
72 Q_SIGNALS:
73 void maxMessagesChanged(const int newMaxMessages);
74
75 public:
76 explicit PythonLogWidget(QWidget* parent = NULL);
78
79 int getMaxMessages() const;
80 bool getOutputStream() const;
81 bool getErrorStream() const;
82 int getVerticalSizeHint() const;
83 bool getAutoScroll() const;
84 bool getRemoveAnsiEscapeSequences() const;
85
86 protected:
87 virtual ito::RetVal init();
88 QSize sizeHint() const;
89
90 QScopedPointer<PythonLogWidgetPrivate> d_ptr;
91
92 private:
93 Q_DECLARE_PRIVATE(PythonLogWidget);
94 Q_DISABLE_COPY(PythonLogWidget);
95};
96
97#ifdef __APPLE__
98}
99#endif
100
101#endif // PYTHONLOGWIDGET_H
Definition pythonLogWidget.h:48
Definition pythonLogWidget.cpp:48
Definition abstractApiWidget.h:58
Class for managing status values (like errors or warning)
Definition retVal.h:54
tStreamMessageType
Definition typeDefs.h:77