diff options
Diffstat (limited to 'fxbarcode/oned/BC_OneDimWriter.h')
-rw-r--r-- | fxbarcode/oned/BC_OneDimWriter.h | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/fxbarcode/oned/BC_OneDimWriter.h b/fxbarcode/oned/BC_OneDimWriter.h index 15ae8e7bc8..f1cbcf23df 100644 --- a/fxbarcode/oned/BC_OneDimWriter.h +++ b/fxbarcode/oned/BC_OneDimWriter.h @@ -22,32 +22,12 @@ class CBC_OneDimWriter : public CBC_Writer { CBC_OneDimWriter(); ~CBC_OneDimWriter() override; - virtual uint8_t* Encode(const CFX_ByteString& contents, - BCFORMAT format, - int32_t& outWidth, - int32_t& outHeight, - int32_t& e); - virtual uint8_t* Encode(const CFX_ByteString& contents, - BCFORMAT format, - int32_t& outWidth, - int32_t& outHeight, - int32_t hints, - int32_t& e); - virtual uint8_t* Encode(const CFX_ByteString& contents, - int32_t& outLength, - int32_t& e); - - virtual void RenderResult(const CFX_WideStringC& contents, + virtual bool RenderResult(const CFX_WideStringC& contents, uint8_t* code, int32_t codeLength, - bool isDevice, - int32_t& e); - virtual void RenderDeviceResult(CFX_RenderDevice* device, - const CFX_Matrix* matrix, - const CFX_WideStringC& contents, - int32_t& e); - virtual bool CheckContentValidity(const CFX_WideStringC& contents); - virtual CFX_WideString FilterContents(const CFX_WideStringC& contents); + bool isDevice); + virtual bool CheckContentValidity(const CFX_WideStringC& contents) = 0; + virtual CFX_WideString FilterContents(const CFX_WideStringC& contents) = 0; virtual CFX_WideString RenderTextContents(const CFX_WideStringC& contents); virtual void SetPrintChecksum(bool checksum); virtual void SetDataLength(int32_t length); @@ -55,21 +35,35 @@ class CBC_OneDimWriter : public CBC_Writer { virtual void SetFontSize(float size); virtual void SetFontStyle(int32_t style); virtual void SetFontColor(FX_ARGB color); + + uint8_t* Encode(const CFX_ByteString& contents, + BCFORMAT format, + int32_t& outWidth, + int32_t& outHeight); + bool RenderDeviceResult(CFX_RenderDevice* device, + const CFX_Matrix* matrix, + const CFX_WideStringC& contents); bool SetFont(CFX_Font* cFont); protected: + virtual uint8_t* EncodeWithHint(const CFX_ByteString& contents, + BCFORMAT format, + int32_t& outWidth, + int32_t& outHeight, + int32_t hints); + virtual uint8_t* EncodeImpl(const CFX_ByteString& contents, + int32_t& outLength) = 0; virtual void CalcTextInfo(const CFX_ByteString& text, FXTEXT_CHARPOS* charPos, CFX_Font* cFont, float geWidth, int32_t fontSize, float& charsLen); - virtual void ShowChars(const CFX_WideStringC& contents, + virtual bool ShowChars(const CFX_WideStringC& contents, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, - int32_t multiple, - int32_t& e); + int32_t multiple); virtual void ShowDeviceChars(CFX_RenderDevice* device, const CFX_Matrix* matrix, const CFX_ByteString str, @@ -80,7 +74,7 @@ class CBC_OneDimWriter : public CBC_Writer { int32_t barWidth); virtual int32_t AppendPattern(uint8_t* target, int32_t pos, - const int32_t* pattern, + const int8_t* pattern, int32_t patternLength, int32_t startColor, int32_t& e); |