Re-structured project

This commit is contained in:
2023-08-26 11:53:44 +02:00
parent c3915336dd
commit 61e2352a3c
25 changed files with 257 additions and 257 deletions

43
src/P700Printer.hpp Normal file
View File

@@ -0,0 +1,43 @@
#include <memory>
#include "interface/IPrinterDriver.hpp"
#include "interface/IPrinterInfo.hpp"
#include "libusbwrap/interface/IUsbDevice.hpp"
#pragma once
namespace ptprnt::printer {
class P700Printer : public ::ptprnt::IPrinterInfo, public ::ptprnt::IPrinterDriver {
public:
P700Printer() = default;
~P700Printer() = default;
// delete copy ctor and assignment
P700Printer(const P700Printer&) = delete;
P700Printer& operator=(P700Printer&) = delete;
// IPrinterInfo
const std::string_view getDriverName() override;
const std::string_view getName() override;
const uint16_t getPid() override;
const uint16_t getVid() override;
const std::string_view getVersion() override;
// IPrinterDriver
bool attachUsbDevice(std::shared_ptr<libusbwrap::IUsbDevice> usbHndl) override;
bool detachUsbDevice() override;
bool printBitmap(const Bitmap& bitmap) override;
bool printText(const std::string& text, uint16_t fontSize) override;
private:
std::shared_ptr<libusbwrap::IUsbDevice> mUsbHndl{nullptr};
PrinterInfo info{.driverName = "P700",
.name = "Brother P-touch P700",
.version = "v1.0",
.vid = 0x04f9,
.pid = 0x2061};
};
} // namespace ptprnt::printer