Debian Codegraph @

src/lw/tests/MOCK_LWLMPrintEnvironment.h

raw
1 // -*- C++ -*-
2 // $Id: MOCK_LWLMPrintEnvironment.h 15961 2011-09-02 14:44:07Z pineichen $
3
4 // DYMO LabelWriter Drivers
5 // Copyright (C) 2008 Sanford L.P.
6
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
21 #ifndef hc8e31bb3_01a5_4422_84b8_64c017e18521
22 #define hc8e31bb3_01a5_4422_84b8_64c017e18521
23
24 #include <stdlib.h>
25 #include "../PrinterDriver.h"
26 #include "MOCK_PrintEnvironment.h"
27
28 using namespace DymoPrinterDriver;
29
30
31 /**
32 Special environment to enulate responces from the LabelWriter
33 Used to test language monitor
34 */
35 class MockLWLMPrintEnvironment: public MockPrintEnvironment
36 {
37 public:
38 typedef enum
39 {
40 mtTOF, // return TOF
41 mtPaperOut, // return paper out
42 mtNotTOF, // not TOF but ether not ERROR
43 mtFailed, // unable to read status
44 mtRollChanged
45
46 }mode_t;
47
48 MockLWLMPrintEnvironment();
49 virtual ~MockLWLMPrintEnvironment() {}
50 virtual void WriteData(const buffer_t& Data);
51 virtual void ReadData(buffer_t& Data);
52 virtual job_status_t GetJobStatus();
53 virtual void SetJobStatus(job_status_t JobStatus);
54
55 //////////////////////////////////////////////////////
56 // functions to control what is returned by requests
57
58 // return Mode alwayes
59 void SetMode(mode_t Mode);
60
61 // push mode that will be returned next call to ReadData()
62 void PushMode(mode_t Mode, size_t Count = 1);
63
64 private:
65 std::vector<mode_t> Mode_;
66 };
67
68 #endif
69
70 /*
71 * End of "$Id: MOCK_LWLMPrintEnvironment.h 15961 2011-09-02 14:44:07Z pineichen $".
72 */
73
74
75
76
77