Sketching some basic interfaces

This commit is contained in:
2022-11-01 20:02:47 +01:00
parent bd9a39e185
commit 2913a272d1
13 changed files with 295 additions and 9 deletions

44
inc/IPrinter.hpp Normal file
View File

@@ -0,0 +1,44 @@
#include "PrinterTypes.hpp"
#include <memory>
#include "Bitmap.hpp"
#pragma once
namespace ptprnt::printer {
class IPrinter
{
public:
virtual ~IPrinter() {};
/**
* @brief Get Information struct about the printer
*
* @return driver::info
*/
virtual printer::info getInfo() = 0;
/**
* @brief Prints text immediatly
*
* @param text Text to print
* @param fontSize Size of the text to print
* @return true Printing succeeded
* @return false Printing failed
*/
virtual bool printText(std::string_view text, uint32_t fontSize) = 0;
/**
* @brief Prints supplied bitmap immediatly
*
* @param bm Bitmap to print
* @return true Printing succeeded
* @return false Printing failed
*/
virtual bool printBitmap(std::shared_ptr<bitmap::Bitmap> bm) = 0;
};
}