summaryrefslogtreecommitdiff
path: root/noncore
authorwazlaf <wazlaf>2002-09-25 20:56:38 (UTC)
committer wazlaf <wazlaf>2002-09-25 20:56:38 (UTC)
commitbdbd20a9a0415e2284e21923ed03d4ca3f6615e8 (patch) (unidiff)
treec0598ed6c79f113948813594c5ea68c873abbe75 /noncore
parent71a6630a57ecea0214a490b3490fae19ae290bf7 (diff)
downloadopie-bdbd20a9a0415e2284e21923ed03d4ca3f6615e8.zip
opie-bdbd20a9a0415e2284e21923ed03d4ca3f6615e8.tar.gz
opie-bdbd20a9a0415e2284e21923ed03d4ca3f6615e8.tar.bz2
preliminary skeleton
Diffstat (limited to 'noncore') (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 @@
1#include "file_layer.h"
2
3FileTransferLayer::FileTransferLayer(IOLayer *layer) {
4}
5
6FileTransferLayer::~FileTransferLayer() {
7}
8
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 @@
1#ifndef OPIE_FILE_LAYER_H
2#define OPIE_FILE_LAYER_H
3
4#include "io_layer.h"
5
6class QFile;
7/**
8 * this is the layer for sending files
9 */
10class FileTransferLayer : public QObject {
11 Q_OBJECT
12public:
13 /**
14 *the io layer to be used
15 */
16 FileTransferLayer( IOLayer* );
17 virtual ~FileTransferLayer();
18
19public slots:
20 /**
21 * send a file over the layer
22 */
23 virtual void sendFile( const QString& file ) = 0;
24
25 /**
26 * convience method
27 */
28 virtual void sendFile( const QFile& ) = 0;
29
30signals:
31 /**
32 * sent the file
33 */
34 void sent();
35
36 /**
37 * an error occured
38 */
39
40 void error( int, const QString& );
41
42 /*
43 * 100 == done
44 *
45 */
46 void progress( const QString& file, int progress );
47
48};
49
50#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 @@
1#include "io_layer.h"
2
3IOLayer::IOLayer() {
4}
5
6IOLayer::IOLayer(const Config &config) {
7}
8
9IOLayer::~IOLayer() {
10}
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
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 @@
1#include "io_serial.h"
2
3IOSerial::IOSerial(const Config &config) : IOLayer(config) {
4}
5
6
7void IOSerial::error(int number, const QString &error) {
8}
9
10void IOSerial::received(const QByteArray &array) {
11}
12
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 @@
1#ifndef OPIE_IO_SERIAL
2#define OPIE_IO_SERIAL
3
4#include "io_layer.h"
5
6class IOSerial : public IOLayer {
7 Q_OBJECT
8public:
9 IOSerial(const Config &);
10public slots:
11 void received(const QByteArray &);
12 void error(int, const QString &);
13};
14
15
16#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 @@
1#include <qpe/qpeapplication.h>
2
3int main(int argc, char **argv) {
4 return 0;
5}
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 @@
1TEMPLATE = app
2CONFIG = qt warn_on release
3DESTDIR = $(OPIEDIR)/bin
4HEADERS = io_layer.h io_serial.h file_layer.h
5SOURCES = io_layer.cpp io_serial.cpp file_layer.cpp
6INTERFACES =
7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe -lopie
10TARGET = sysinfo
11