summaryrefslogtreecommitdiff
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
parent71a6630a57ecea0214a490b3490fae19ae290bf7 (diff)
downloadopie-bdbd20a9a0415e2284e21923ed03d4ca3f6615e8.zip
opie-bdbd20a9a0415e2284e21923ed03d4ca3f6615e8.tar.gz
opie-bdbd20a9a0415e2284e21923ed03d4ca3f6615e8.tar.bz2
preliminary skeleton
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/file_layer.cpp8
-rw-r--r--noncore/apps/opie-console/file_layer.h50
-rw-r--r--noncore/apps/opie-console/io_layer.cpp10
-rw-r--r--noncore/apps/opie-console/io_layer.h86
-rw-r--r--noncore/apps/opie-console/io_serial.cpp12
-rw-r--r--noncore/apps/opie-console/io_serial.h16
-rw-r--r--noncore/apps/opie-console/main.cpp5
-rw-r--r--noncore/apps/opie-console/opie-console.pro11
8 files changed, 198 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/file_layer.cpp b/noncore/apps/opie-console/file_layer.cpp
new file mode 100644
index 0000000..3be5f10
--- a/dev/null
+++ b/noncore/apps/opie-console/file_layer.cpp
@@ -0,0 +1,8 @@
+#include "file_layer.h"
+
+FileTransferLayer::FileTransferLayer(IOLayer *layer) {
+}
+
+FileTransferLayer::~FileTransferLayer() {
+}
+
diff --git a/noncore/apps/opie-console/file_layer.h b/noncore/apps/opie-console/file_layer.h
new file mode 100644
index 0000000..75fd94b
--- a/dev/null
+++ b/noncore/apps/opie-console/file_layer.h
@@ -0,0 +1,50 @@
+#ifndef OPIE_FILE_LAYER_H
+#define OPIE_FILE_LAYER_H
+
+#include "io_layer.h"
+
+class QFile;
+/**
+ * this is the layer for sending files
+ */
+class FileTransferLayer : public QObject {
+ Q_OBJECT
+public:
+ /**
+ *the io layer to be used
+ */
+ FileTransferLayer( IOLayer* );
+ virtual ~FileTransferLayer();
+
+public slots:
+ /**
+ * send a file over the layer
+ */
+ virtual void sendFile( const QString& file ) = 0;
+
+ /**
+ * convience method
+ */
+ virtual void sendFile( const QFile& ) = 0;
+
+signals:
+ /**
+ * sent the file
+ */
+ void sent();
+
+ /**
+ * an error occured
+ */
+
+ void error( int, const QString& );
+
+ /*
+ * 100 == done
+ *
+ */
+ void progress( const QString& file, int progress );
+
+};
+
+#endif
diff --git a/noncore/apps/opie-console/io_layer.cpp b/noncore/apps/opie-console/io_layer.cpp
new file mode 100644
index 0000000..8da5886
--- a/dev/null
+++ b/noncore/apps/opie-console/io_layer.cpp
@@ -0,0 +1,10 @@
+#include "io_layer.h"
+
+IOLayer::IOLayer() {
+}
+
+IOLayer::IOLayer(const Config &config) {
+}
+
+IOLayer::~IOLayer() {
+}
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
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
new file mode 100644
index 0000000..42c86b5
--- a/dev/null
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -0,0 +1,12 @@
+#include "io_serial.h"
+
+IOSerial::IOSerial(const Config &config) : IOLayer(config) {
+}
+
+
+void IOSerial::error(int number, const QString &error) {
+}
+
+void IOSerial::received(const QByteArray &array) {
+}
+
diff --git a/noncore/apps/opie-console/io_serial.h b/noncore/apps/opie-console/io_serial.h
new file mode 100644
index 0000000..c6a2efd
--- a/dev/null
+++ b/noncore/apps/opie-console/io_serial.h
@@ -0,0 +1,16 @@
+#ifndef OPIE_IO_SERIAL
+#define OPIE_IO_SERIAL
+
+#include "io_layer.h"
+
+class IOSerial : public IOLayer {
+ Q_OBJECT
+public:
+ IOSerial(const Config &);
+public slots:
+ void received(const QByteArray &);
+ void error(int, const QString &);
+};
+
+
+#endif /* OPIE_IO_SERIAL */
diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp
new file mode 100644
index 0000000..7594174
--- a/dev/null
+++ b/noncore/apps/opie-console/main.cpp
@@ -0,0 +1,5 @@
+#include <qpe/qpeapplication.h>
+
+int main(int argc, char **argv) {
+ return 0;
+}
diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro
new file mode 100644
index 0000000..4ce11a9
--- a/dev/null
+++ b/noncore/apps/opie-console/opie-console.pro
@@ -0,0 +1,11 @@
+TEMPLATE = app
+CONFIG = qt warn_on release
+DESTDIR = $(OPIEDIR)/bin
+HEADERS = io_layer.h io_serial.h file_layer.h
+SOURCES = io_layer.cpp io_serial.cpp file_layer.cpp
+INTERFACES =
+INCLUDEPATH += $(OPIEDIR)/include
+DEPENDPATH += $(OPIEDIR)/include
+LIBS += -lqpe -lopie
+TARGET = sysinfo
+