/[svn]/qsampler/trunk/src/qsamplerMessages.h
ViewVC logotype

Contents of /qsampler/trunk/src/qsamplerMessages.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1558 - (show annotations) (download) (as text)
Thu Dec 6 09:35:33 2007 UTC (16 years, 4 months ago) by capela
File MIME type: text/x-c++hdr
File size: 2658 byte(s)
* Qt4 migration: complete QSampler namespace overhaul.

1 // qsamplerMessages.h
2 //
3 /****************************************************************************
4 Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.
5 Copyright (C) 2007, Christian Schoenebeck
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21 *****************************************************************************/
22
23 #ifndef __qsamplerMessages_h
24 #define __qsamplerMessages_h
25
26 #include <QDockWidget>
27
28 class QSocketNotifier;
29 class QTextEdit;
30
31 namespace QSampler {
32
33 //-------------------------------------------------------------------------
34 // QSampler::Messages - Messages log dockable window.
35 //
36
37 class Messages : public QDockWidget
38 {
39 Q_OBJECT
40
41 public:
42
43 // Constructor.
44 Messages(QWidget *pParent);
45 // Destructor.
46 ~Messages();
47
48 // Stdout/stderr capture accessors.
49 bool isCaptureEnabled();
50 void setCaptureEnabled(bool bCapture);
51
52 // Message font accessors.
53 QFont messagesFont();
54 void setMessagesFont(const QFont & font);
55
56 // Maximum number of message lines accessors.
57 int messagesLimit();
58 void setMessagesLimit(int iMessagesLimit);
59
60 // The main utility methods.
61 void appendMessages(const QString& s);
62 void appendMessagesColor(const QString& s, const QString &c);
63 void appendMessagesText(const QString& s);
64
65 // Stdout capture functions.
66 void appendStdoutBuffer(const QString& s);
67 void flushStdoutBuffer();
68
69 // History reset.
70 void clear();
71
72 signals:
73
74 void visibilityChanged(bool bVisible);
75
76 protected slots:
77
78 // overridden method of QWidget
79 void showEvent(QShowEvent* event);
80
81 // Stdout capture slot.
82 void stdoutNotify(int fd);
83
84 private:
85
86 // The maximum number of message lines.
87 int m_iMessagesLines;
88 int m_iMessagesLimit;
89 int m_iMessagesHigh;
90
91 // The textview main widget.
92 QTextEdit *m_pTextView;
93
94 // Stdout capture variables.
95 QSocketNotifier *m_pStdoutNotifier;
96 QString m_sStdoutBuffer;
97 int m_fdStdout[2];
98 };
99
100 } // namespace QSampler
101
102 #endif // __qsamplerMessages_h
103
104
105 // end of qsamplerMessages.h

  ViewVC Help
Powered by ViewVC