iPrinterList.h
1 #pragma once
2 
3 #include <boost/system/error_code.hpp>
4 #include <list>
5 
6 #include "iPrinter.h"
7 
8 namespace dpyPrinter {
9 
10 typedef enum
11 {
12  ADDED = 0,
13  REMOVED = 1,
14 } ListEvent;
15 
21 {
22 public:
28  virtual void listEvent(boost::shared_ptr<IPrinter> printer, dpyPrinter::ListEvent event) = 0;
29 
33  virtual ~ListObserver()
34  {
35  }
36 };
37 
38 }
39 
45 {
46 private:
47  std::vector<dpyPrinter::ListObserver*> mObserversList;
48 protected:
49  virtual ~IPrinterList();
50  boost::system::error_code subscribe(dpyPrinter::ListObserver* observer);
51  boost::system::error_code unsubscribe(dpyPrinter::ListObserver* observer);
52 
53  virtual boost::system::error_code getPrinters(std::list<boost::shared_ptr<IPrinter>>& list) = 0;
54 };
virtual void listEvent(boost::shared_ptr< IPrinter > printer, dpyPrinter::ListEvent event)=0
List Observer class.
Definition: iPrinterList.h:20
REMOVED.
Definition: iPrinterList.h:13
Deepsy Printer namespace that includes the different enums, structs or method signatures that should ...
Definition: printerApi.h:13
Definition: iPrinterList.h:44
ADDED.
Definition: iPrinterList.h:12
ListEvent
Definition: iPrinterList.h:10
virtual ~ListObserver()
Destructor.
Definition: iPrinterList.h:33