00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef QLABIBM4694_H
00037 #define QLABIBM4694_H
00038
00039 #include <qlabcashboxinterfacedefinition.h>
00040
00041 #include <qobject.h>
00042 #include <qvariant.h>
00043 #include <qmap.h>
00044 #include <qdatetime.h>
00045
00046
00047
00048 #include "pos/pos.h"
00049 #include "pos/device.h"
00050 #include "pos/display.h"
00051 #include "pos/msr.h"
00052 #include "pos/nvram.h"
00053 #include "pos/power.h"
00054 #include "pos/rs232c.h"
00055 #include "pos/scale.h"
00056 #include "pos/scanner.h"
00057 #include "pos/keyboard.h"
00058 #include "pos/drawer.h"
00059 #include "pos/printer.h"
00060 #include "pos/errno.h"
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 typedef struct TableEntry
00072 {
00073 int Value;
00074 char *Name;
00075 } TableEntry ;
00076
00077 #define MakeEntry(x) { x , # x }
00078 #define MakeExtEntry(x, y) { x ## y , # y }
00079 #define MakeSubtypeEntry( device, type, subtype ) \
00080 { ( PosDEVICE_ ## device << 8 ) | Pos ## type ## _SUBTYPE_ ## subtype , \
00081 # subtype }
00082
00083
00084
00085
00086 class Q_EXPORT QlabIbm4694 : public QlabCashboxInterfaceDefinition
00087 {
00088 Q_OBJECT
00089
00090
00091 public :
00092 QlabIbm4694( QlabCashboxInterfaceDefinition * parent = 0, char * name = 0 ) ;
00093 ~QlabIbm4694() ;
00094
00095 void setup() ;
00096 void exec() ;
00097
00098 public slots :
00099 QStringList features() ;
00100
00101 ActivePrintDevice activePrinter() const ;
00102 void setActivePrinter( ActivePrintDevice prn ) ;
00103
00104
00105 void closeAll() ;
00106 void closeDevice( int dev ) ;
00107 void releaseAll() ;
00108 void lockDevice( int dev ) ;
00109 void unlockDevice( int dev ) ;
00110
00111 long keyboardSupervisorStatus() ;
00112
00113
00114 void clearScreen( int dev ) ;
00115 void displayFullScreen( int dev, const QString & msg, int cursor = 0 ) ;
00116 void displayString( int dev, const QString & msg, int cursor = 0 ) ;
00117 void displayItemRight( int dev, const QString & msg, int lineno = 1 ) ;
00118
00119
00120 bool selectRollPaper() ;
00121 bool selectFullPage() ;
00122 void printLine( const QString & li ) ;
00123 void printText( const QString & txt ) ;
00124 long printerStatus() ;
00125 void writeToCRstation( const QString & line ) ;
00126 void writeToCRandSJstations( const QString & buffer ) ;
00127 void writeToDIstation( const QString & buffer ) ;
00128 QString evalPrintLine( const QString & line, bool withdash = FALSE ) ;
00129
00130
00131 void openCashDrawer() ;
00132 long drawerStatus() ;
00133 void waitForDrawerClosed() ;
00134
00135
00136 void soundTone( int frequency = PosMEDIUM, int duration = 10, int volume = PosLOW ) ;
00137 void soundError() ;
00138 void soundWarning() ;
00139 void soundReject() ;
00140
00141 protected slots :
00142 void openDevice( POSQMSG * pMsg ) ;
00143 int openAndAcquire( int device, PosArgPtr args, int nargs ) ;
00144 void setCheckoutNumpadStyle( int devdes ) ;
00145 QString readScannerData() ;
00146 virtual QString readMicr( long size ) ;
00147
00148 private :
00149 void initDevices() ;
00150 void deviceStatus( POSQMSG *pMsg ) ;
00151 void processPrinterStatus( POSQMSG *pMsg ) ;
00152 void processPrinterData( POSQMSG *pMsg ) ;
00153 void processPrinterError( POSQMSG *pMsg ) ;
00154 void processScannerData() ;
00155 QString processMsrData() ;
00156 void processTillOpened( long *till_open_tm ) ;
00157 void processTillClosed( long *till_open_tm ) ;
00158 void processChaseComplete() ;
00159 void processCharacterMessage( POSQMSG *qmsg ) ;
00160
00161 POSQMSG qmsg ;
00163
00168 QString p4610RegisterDocument ;
00173 QString p4610ReleaseDocument ;
00178 QString p4610ReadMicrInfo ;
00183 QString p4610FlipCheck ;
00184
00185
00186 } ;
00187
00188
00189 #endif // QLABIBM4694_H
00190