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) (side-by-side diff)
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 @@
+#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