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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1558 - (hide 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 capela 91 // qsamplerMessages.h
2     //
3     /****************************************************************************
4 schoenebeck 1461 Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.
5 capela 1464 Copyright (C) 2007, Christian Schoenebeck
6 capela 91
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 capela 920 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 capela 91
21     *****************************************************************************/
22    
23     #ifndef __qsamplerMessages_h
24     #define __qsamplerMessages_h
25    
26 schoenebeck 1461 #include <QDockWidget>
27 capela 91
28     class QSocketNotifier;
29     class QTextEdit;
30    
31 capela 1558 namespace QSampler {
32 capela 91
33     //-------------------------------------------------------------------------
34 capela 1558 // QSampler::Messages - Messages log dockable window.
35 capela 91 //
36    
37 capela 1558 class Messages : public QDockWidget
38 capela 91 {
39 capela 1465 Q_OBJECT
40 capela 91
41     public:
42    
43 capela 1465 // Constructor.
44 capela 1558 Messages(QWidget *pParent);
45 capela 1465 // Destructor.
46 capela 1558 ~Messages();
47 capela 91
48 capela 1465 // Stdout/stderr capture accessors.
49     bool isCaptureEnabled();
50     void setCaptureEnabled(bool bCapture);
51 capela 91
52 capela 1465 // Message font accessors.
53     QFont messagesFont();
54     void setMessagesFont(const QFont & font);
55 capela 91
56 capela 1465 // Maximum number of message lines accessors.
57     int messagesLimit();
58     void setMessagesLimit(int iMessagesLimit);
59 schoenebeck 1461
60 capela 1465 // 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 capela 91
65 capela 1465 // Stdout capture functions.
66     void appendStdoutBuffer(const QString& s);
67     void flushStdoutBuffer();
68 capela 91
69 capela 1465 // History reset.
70     void clear();
71 schoenebeck 1470
72     signals:
73    
74     void visibilityChanged(bool bVisible);
75    
76 capela 91 protected slots:
77    
78 schoenebeck 1470 // overridden method of QWidget
79     void showEvent(QShowEvent* event);
80    
81 capela 1465 // Stdout capture slot.
82     void stdoutNotify(int fd);
83 capela 91
84     private:
85    
86 capela 1465 // The maximum number of message lines.
87     int m_iMessagesLines;
88     int m_iMessagesLimit;
89     int m_iMessagesHigh;
90 capela 327
91 capela 1465 // The textview main widget.
92     QTextEdit *m_pTextView;
93 schoenebeck 1461
94 capela 1465 // Stdout capture variables.
95     QSocketNotifier *m_pStdoutNotifier;
96     QString m_sStdoutBuffer;
97     int m_fdStdout[2];
98 capela 91 };
99    
100 capela 1558 } // namespace QSampler
101 capela 91
102     #endif // __qsamplerMessages_h
103    
104    
105     // end of qsamplerMessages.h

  ViewVC Help
Powered by ViewVC