iJob.h
1 #pragma once
2 
3 #include <map>
4 #include <list>
5 #include <vector>
6 #include <string>
7 #include <rapidjson/document.h>
8 #include <boost/system/error_code.hpp>
9 
10 #include "printConfig.h"
11 
12 class IPrinter;
13 
14 namespace dpyPrinter {
15 
16 typedef enum
17 {
19  QUEUED = 1,
20  PRINT_OK = 2,
25 } JobStatus;
26 
28  std::string printerid;
29  std::string uri;
31  std::list<PrintConfig> printconfig;
32 };
33 
34 }
35 
36 
42 {
43 public:
49  virtual void JobStatusChange(int m_jobid, const dpyPrinter::JobStatus& status) = 0;
53  virtual ~JobObserver()
54  {
55  }
56 };
57 
62 class IJob
63 {
64 protected:
65  int m_jobid;
66  IPrinter* m_printer;
67  std::vector<JobObserver*> mObserversList;
68 
69 public:
70  virtual ~IJob();
71 
72  boost::system::error_code subscribe(JobObserver* observer);
73  boost::system::error_code unsubscribe(JobObserver* observer);
74 
79  int getJobid() const
80  {
81  return m_jobid;
82  }
87  const IPrinter* getPrinter() const
88  {
89  return m_printer;
90  }
91 
96  virtual dpyPrinter::JobInformation getJobInformation() = 0;
97 
98 };
ERROR WHILE PRINTING.
Definition: iJob.h:22
virtual ~JobObserver()
Destructor.
Definition: iJob.h:53
PRINT OK.
Definition: iJob.h:20
Definition: iJob.h:62
Abstract class which implements all the minimum necessary logic which all printer must have...
Definition: iPrinter.h:130
JobStatus
Definition: iJob.h:16
ERROR AFTER PRINTING.
Definition: iJob.h:23
REMOVED.
Definition: iJob.h:24
int getJobid() const
Definition: iJob.h:79
Deepsy Printer namespace that includes the different enums, structs or method signatures that should ...
Definition: printerApi.h:13
QUEUED.
Definition: iJob.h:19
ERROR BEFORE PRINTING.
Definition: iJob.h:21
const IPrinter * getPrinter() const
Definition: iJob.h:87
std::string printerid
printer id
Definition: iJob.h:28
Job Observer class.
Definition: iJob.h:41
JobStatus status
job status
Definition: iJob.h:30
std::string uri
uri of the image
Definition: iJob.h:29
UNKNOWN.
Definition: iJob.h:18
Definition: iJob.h:27