-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
79 lines (72 loc) · 2.18 KB
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/******************************************************************************
* @file main.h
*
* @brief
*
* @date 01-12-2010
* @author Rafal Kukla
******************************************************************************
* Copyright (C) 2010 Rafal Kukla ( rkdevel@gmail.com )
* This file is a part of rs232testng project and is released
* under the terms of the license contained in the file LICENSE
******************************************************************************
*/
#ifndef MAIN_H_
#define MAIN_H_
#include "HtmlDisplayStreamItem.h"
#include "TextEditStreamItem.h"
#include <QObject>
class QStreamManager: public QObject
{
Q_OBJECT
private:
StreamItem* InStream;
StreamItem* InModStream;
StreamItem* SourceStream;
StreamItem* OutModStream;
StreamItem* OutStream;
private:
void buildStream()
{
StreamItem* endStream = OutStream;
if (OutModStream) { OutModStream->Connect(endStream); endStream = OutModStream; }
if (SourceStream) { SourceStream->Connect(endStream); endStream = SourceStream; }
if (InModStream) { InModStream->Connect(endStream); endStream = InModStream; }
if (InStream) { InStream->Connect( endStream ); }
}
public:
QStreamManager():
InStream(0),InModStream(0),
SourceStream(0),OutModStream(0),
OutStream(0)
{
buildStream();
}
public slots:
void onInStreamChanged(StreamItem* newStream)
{
InStream = newStream;
buildStream();
}
void onInModStreamChanged(StreamItem* newStream)
{
InModStream = newStream;
buildStream();
}
void onSourceStreamChanged(StreamItem* newStream)
{
SourceStream = newStream;
buildStream();
}
void onOutModStreamChanged(StreamItem* newStream)
{
OutModStream = newStream;
buildStream();
}
void onOutStreamChanged(StreamItem* newStream)
{
OutStream = newStream;
buildStream();
}
};
#endif /* MAIN_H_ */