1 // Copyright 2018 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef FXBARCODE_CBC_EANCODE_H_ 8 #define FXBARCODE_CBC_EANCODE_H_ 9 10 #include <memory> 11 12 #include "core/fxcrt/widestring.h" 13 #include "fxbarcode/cbc_onecode.h" 14 15 class CBC_OneDimEANWriter; 16 17 class CBC_EANCode : public CBC_OneCode { 18 public: 19 explicit CBC_EANCode(std::unique_ptr<CBC_OneDimEANWriter> pWriter); 20 ~CBC_EANCode() override; 21 22 virtual size_t GetMaxLength() const = 0; 23 24 // CBC_EANCode: 25 bool Encode(WideStringView contents) override; 26 bool RenderDevice(CFX_RenderDevice* device, 27 const CFX_Matrix& matrix) override; 28 29 protected: 30 CBC_OneDimEANWriter* GetOneDimEANWriter(); 31 WideString Preprocess(WideStringView contents); 32 33 WideString m_renderContents; 34 }; 35 36 #endif // FXBARCODE_CBC_EANCODE_H_ 37