blob: c8f41d7d9e95e361ee361d2ac56cde1a0fec43a0 (
plain)
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
80
81
82
83
84
85
86
|
#ifndef OPIE_IO_LAYER_H
#define OPIE_IO_LAYER_H
#include <qobject.h>
/**
* This is the base class for IO Layers
* It will used to sent and recv data( QByteArray )
* it
*/
class Config;
class IOLayer : public QObject {
Q_OBJECT
public:
enum Error {
NoError = -1,
Refuse = 0,
CouldNotOpen =1,
ClosedUnexpected =2,
ClosedError =3,
Terminate = 4
/* add more errors here */
};
/**
* a small c'tor
*/
IOLayer();
/**
* create an IOLayer instance from a config file
* can be used by session managemnt/profiles
*/
IOLayer( const Config& );
/**
* destructor
*/
virtual ~IOLayer();
signals:
/**
* received input as QCString
*/
virtual void received( const QByteArray& ) = 0;
/**
* an error occured
* int for the error number
* and QString for a text
*/
virtual void error( int, const QString& ) = 0;
public slots:
/**
* send a QCString to the device
*/
virtual void send( const QByteArray& ) = 0;
/**
* bool open
*/
virtual bool open() = 0;
/**
* close the io
*/
virtual void close() = 0;
/**
* closes and reloads the settings
*/
virtual void reload( const Config& ) = 0;
/**
* a small internal identifier
*/
virtual QString identifier()const = 0;
/**
* a short name
*/
virtual QString name()const = 0;
};
#endif
|