UPrinterInterface.h
00001 #ifndef UPrinterInterface_H_
00002 #define UPrinterInterface_H_
00003
00004 #include <glibmm/ustring.h>
00005 #include <time.h>
00006 #include <gdkmm.h>
00007 #include <glibmm/main.h>
00008 #include <glibmm/convert.h>
00009 #include "UEventBox.h"
00010 #include "global_macros.h"
00011 #include "plugins.h"
00012
00013 #define ML280_OK 0x18
00014 #define ML280_BUSY 0x08 // NOT READY
00015 #define ML280_OUT_PAPER 0x20
00016
00017 namespace UniWidgets
00018 {
00025 class UPrinterInterface : public UEventBox
00026 {
00027 public:
00028
00029 UPrinterInterface();
00030 explicit UPrinterInterface(GtkmmBaseType::BaseObjectType* gobject);
00031 ~UPrinterInterface();
00032
00034 enum Status
00035 {
00036 P_UNKNOWN = -1,
00037 P_OK = ML280_OK,
00038 P_BUSY = ML280_BUSY,
00039 P_OUTPAPER = ML280_OUT_PAPER
00040 };
00042 Status getStatus();
00044 virtual bool print_string(const Glib::ustring& text);
00046 bool printer_check();
00047 private:
00048 void constructor();
00049 protected:
00050 virtual void on_connect() throw();
00051 Status printer_status;
00052
00053 ADD_PROPERTY( property_sensor_printer_error, UniSetTypes::ObjectId )
00054 ADD_PROPERTY( node, UniSetTypes::ObjectId )
00055 ADD_PROPERTY( property_printer_dev, Glib::ustring )
00056 ADD_PROPERTY( property_printer_locale, Glib::ustring )
00057 ADD_PROPERTY( property_text_locale, Glib::ustring )
00058 ADD_PROPERTY( property_printer_check_time, long )
00059 };
00060
00061 }
00062 #endif