summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/io_layer.h
authorwazlaf <wazlaf>2002-09-25 20:56:38 (UTC)
committer wazlaf <wazlaf>2002-09-25 20:56:38 (UTC)
commitbdbd20a9a0415e2284e21923ed03d4ca3f6615e8 (patch) (unidiff)
treec0598ed6c79f113948813594c5ea68c873abbe75 /noncore/apps/opie-console/io_layer.h
parent71a6630a57ecea0214a490b3490fae19ae290bf7 (diff)
downloadopie-bdbd20a9a0415e2284e21923ed03d4ca3f6615e8.zip
opie-bdbd20a9a0415e2284e21923ed03d4ca3f6615e8.tar.gz
opie-bdbd20a9a0415e2284e21923ed03d4ca3f6615e8.tar.bz2
preliminary skeleton
Diffstat (limited to 'noncore/apps/opie-console/io_layer.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_layer.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/io_layer.h b/noncore/apps/opie-console/io_layer.h
new file mode 100644
index 0000000..c8f41d7
--- a/dev/null
+++ b/noncore/apps/opie-console/io_layer.h
@@ -0,0 +1,86 @@
1#ifndef OPIE_IO_LAYER_H
2#define OPIE_IO_LAYER_H
3
4#include <qobject.h>
5
6
7/**
8 * This is the base class for IO Layers
9 * It will used to sent and recv data( QByteArray )
10 * it
11 */
12class Config;
13class IOLayer : public QObject {
14 Q_OBJECT
15public:
16 enum Error {
17 NoError = -1,
18 Refuse = 0,
19 CouldNotOpen =1,
20 ClosedUnexpected =2,
21 ClosedError =3,
22 Terminate = 4
23 /* add more errors here */
24 };
25 /**
26 * a small c'tor
27 */
28 IOLayer();
29
30 /**
31 * create an IOLayer instance from a config file
32 * can be used by session managemnt/profiles
33 */
34 IOLayer( const Config& );
35
36 /**
37 * destructor
38 */
39 virtual ~IOLayer();
40signals:
41 /**
42 * received input as QCString
43 */
44 virtual void received( const QByteArray& ) = 0;
45
46 /**
47 * an error occured
48 * int for the error number
49 * and QString for a text
50 */
51 virtual void error( int, const QString& ) = 0;
52
53public slots:
54 /**
55 * send a QCString to the device
56 */
57 virtual void send( const QByteArray& ) = 0;
58
59 /**
60 * bool open
61 */
62 virtual bool open() = 0;
63
64 /**
65 * close the io
66 */
67 virtual void close() = 0;
68
69 /**
70 * closes and reloads the settings
71 */
72 virtual void reload( const Config& ) = 0;
73
74 /**
75 * a small internal identifier
76 */
77 virtual QString identifier()const = 0;
78
79 /**
80 * a short name
81 */
82 virtual QString name()const = 0;
83
84};
85
86#endif