Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

io_layer.h

Go to the documentation of this file.
00001 #ifndef OPIE_IO_LAYER_H
00002 #define OPIE_IO_LAYER_H
00003 
00004 #include <qbitarray.h>
00005 #include <qobject.h>
00006 
00007 
00008 #include <qpe/config.h>
00009 
00010 #include "profile.h"
00011 
00017 class IOLayer : public QObject {
00018     Q_OBJECT
00019 public:
00020     enum Error {
00021         NoError = -1,
00022         Refuse = 0,
00023         CouldNotOpen =1,
00024         ClosedUnexpected =2,
00025         ClosedError =3,
00026         Terminate = 4
00027         /* add more errors here */
00028     };
00029     enum Feature {
00030         AutoConnect = 0,
00031         TransferFile = 1,
00032         Close = 2
00033     };
00037     IOLayer();
00038 
00044     IOLayer( const Profile& );
00045 
00049     virtual ~IOLayer();
00050 
00054     virtual QString identifier() const = 0;
00055 
00059     virtual QString name() const = 0;
00060 
00068     virtual int rawIO() const;
00069 
00074     virtual void closeRawIO(int);
00075 
00080     virtual QBitArray supports() const = 0;
00081 
00082     virtual bool isConnected() = 0;
00083 
00084 signals:
00088     virtual void received( const QByteArray& );
00089 
00095     virtual void error( int, const QString& );
00096 
00097 
00098     virtual void closed();
00099 
00100     /* signal emitted for closure of the IOLayer
00101      * for some reasons
00102      */
00103     virtual void closed(IOLayer*);
00104 public slots:
00108     virtual void send( const QByteArray& ) = 0;
00109 
00113     virtual bool open() = 0;
00114 
00118     virtual void close() = 0;
00119 
00123     virtual void reload( const Profile& ) = 0;
00124 
00129     virtual void setSize(int lines, int cols );
00130 };
00131 
00132 #endif

Generated on Sat Nov 5 16:16:50 2005 for OPIE by  doxygen 1.4.2