summaryrefslogtreecommitdiff
path: root/fxbarcode/oned/BC_OneDimWriter.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-04-20 15:58:56 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-21 00:54:04 +0000
commit1badb85e5c3a4b4cd42ca1a2b223d6b3bc67cc4a (patch)
tree55bf63857592387531797b0f08e0a6effc0f40c9 /fxbarcode/oned/BC_OneDimWriter.h
parentaeee187c927c07f47a9e5886a417dcc58badefb6 (diff)
downloadpdfium-1badb85e5c3a4b4cd42ca1a2b223d6b3bc67cc4a.tar.xz
Change more fxbarcode to use return values.
Change-Id: Idcc05fb8c5a1448f552b4db5ae131ad82aef4d59 Reviewed-on: https://pdfium-review.googlesource.com/4258 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fxbarcode/oned/BC_OneDimWriter.h')
-rw-r--r--fxbarcode/oned/BC_OneDimWriter.h50
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);