| 1 | /* |
| 2 | * File: PrintRunner.h |
| 3 | * |
| 4 | * Author: Jacob Dekel |
| 5 | * Created on: May 10, 2014 |
| 6 | * |
| 7 | * Copyright (c) 2009-2014 Jacob Dekel |
| 8 | * $Id$ |
| 9 | * |
| 10 | * This object monitors printer events |
| 11 | * |
| 12 | * This program is free software: you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by |
| 14 | * the Free Software Foundation, either version 3 of the License, or |
| 15 | * (at your option) any later version. |
| 16 | * |
| 17 | * This program is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | * GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License |
| 23 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 24 | * |
| 25 | */ |
| 26 | #ifndef PRINTRUNNER_H |
| 27 | #define PRINTRUNNER_Hcxx . . $ `HercPrinter/PrintRunner.h:27:9`! |
| 28 | |
| 29 | #include "Runner.h"cxx . . $ `<file>/HercStudio/Runner.h`/ |
| 30 | #include "HerculesStudio.h"cxx . . $ `<file>/HercStudio/HerculesStudio.h`/ |
| 31 | |
| 32 | #include <QTcpSocket> |
| 33 | |
| 34 | mk_shared_constptrcxx . . $ PrinterItemConstPtr#(PrinterItem) |
| 35 | |
| 36 | class PrinterSocketcxx . . $ PrinterSocket# : public QTcpSocketcxx . . $ QTcpSocket# |
| 37 | { |
| 38 | public: |
| 39 | PrinterSocketcxx . . $ PrinterSocket#PrinterSocket(49f6e7a06ebc5aa8).(); |
| 40 | QByteArraycxx . . $ QByteArray# readLinecxx . . $ PrinterSocket#readLine(b3c286cec66e09f4).(); |
| 41 | qint64cxx . . $ qint64# bytesAvailablecxx . . $ PrinterSocket#bytesAvailable(98833e9ab7de59a4).() const; |
| 42 | private: |
| 43 | QByteArraycxx . . $ QByteArray# returnLinecxx . . $ PrinterSocket#returnLine(531409eeffcde449).(const char *end); |
| 44 | char *nextPoscxx . . $ PrinterSocket#nextPos(41208ce6ca65dd58).(); |
| 45 | char mBuffcxx . . $ PrinterSocket#mBuff.[2048]; |
| 46 | char *mBuffPoscxx . . $ PrinterSocket#mBuffPos.; |
| 47 | }; |
| 48 | |
| 49 | class PrintRunnercxx . . $ PrintRunner# : public Runnercxx . . $ Runner# |
| 50 | { |
| 51 | Q_OBJECTcxx . . $ PrintRunner#QPrivateSignal# |
| 52 | public: |
| 53 | PrintRunnercxx . . $ PrintRunner#PrintRunner(1bfb4126af2d922f).(SynchronizedQueuecxx . . $ SynchronizedQueue#& queue, PrinterItemConstPtrcxx . . $ PrinterItemConstPtr#& printerItem, int maxQueueSize); |
| 54 | |
| 55 | virtual void runcxx . . $ PrintRunner#run(49f6e7a06ebc5aa8).(); |
| 56 | void stopcxx . . $ PrintRunner#stop(49f6e7a06ebc5aa8).(); |
| 57 | |
| 58 | private: |
| 59 | SynchronizedQueuecxx . . $ SynchronizedQueue#& mQueuecxx . . $ PrintRunner#mQueue.; |
| 60 | PrinterItemConstPtrcxx . . $ PrinterItemConstPtr# mPrinterItemcxx . . $ PrintRunner#mPrinterItem.; |
| 61 | static const int MAX_LINEcxx . . $ PrintRunner#MAX_LINE. = 2048; |
| 62 | int mMaxQueueSizecxx . . $ PrintRunner#mMaxQueueSize.; |
| 63 | QSharedPointercxx . . $ QSharedPointer#<PrinterSocketcxx . . $ PrinterSocket#> mSocketcxx . . $ PrintRunner#mSocket.; |
| 64 | bool mRunningcxx . . $ PrintRunner#mRunning.; |
| 65 | char mBuffcxx . . $ PrintRunner#mBuff.[MAX_LINEcxx . . $ PrintRunner#MAX_LINE.]; |
| 66 | int mCurrBufLencxx . . $ PrintRunner#mCurrBufLen.; |
| 67 | |
| 68 | void waitForConnectedcxx . . $ PrintRunner#waitForConnected(49f6e7a06ebc5aa8).(); |
| 69 | void readFromSocketcxx . . $ PrintRunner#readFromSocket(49f6e7a06ebc5aa8).(); |
| 70 | |
| 71 | |
| 72 | private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 73 | void socketStateChangedcxx . . $ PrintRunner#socketStateChanged(369bba9c19fba560).(QAbstractSocketcxx . . $ QAbstractSocket#::SocketStatecxx . . $ QAbstractSocket#SocketState# state); |
| 74 | |
| 75 | signalscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:89:14`!: |
| 76 | void waitingcxx . . $ PrintRunner#waiting(49f6e7a06ebc5aa8).(); |
| 77 | void stoppedWaitingcxx . . $ PrintRunner#stoppedWaiting(49f6e7a06ebc5aa8).(); |
| 78 | void connectedcxx . . $ PrintRunner#connected(49f6e7a06ebc5aa8).(); |
| 79 | void disconnectedcxx . . $ PrintRunner#disconnected(49f6e7a06ebc5aa8).(); |
| 80 | }; |
| 81 | |
| 82 | #endif // PRINTRUNNER_H |