1*3ac0a46fSAndroid Build Coastguard Worker // Copyright 2016 The PDFium Authors 2*3ac0a46fSAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be 3*3ac0a46fSAndroid Build Coastguard Worker // found in the LICENSE file. 4*3ac0a46fSAndroid Build Coastguard Worker 5*3ac0a46fSAndroid Build Coastguard Worker // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6*3ac0a46fSAndroid Build Coastguard Worker /* 7*3ac0a46fSAndroid Build Coastguard Worker * Copyright 2011 ZXing authors 8*3ac0a46fSAndroid Build Coastguard Worker * 9*3ac0a46fSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 10*3ac0a46fSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 11*3ac0a46fSAndroid Build Coastguard Worker * You may obtain a copy of the License at 12*3ac0a46fSAndroid Build Coastguard Worker * 13*3ac0a46fSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 14*3ac0a46fSAndroid Build Coastguard Worker * 15*3ac0a46fSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 16*3ac0a46fSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 17*3ac0a46fSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18*3ac0a46fSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 19*3ac0a46fSAndroid Build Coastguard Worker * limitations under the License. 20*3ac0a46fSAndroid Build Coastguard Worker */ 21*3ac0a46fSAndroid Build Coastguard Worker 22*3ac0a46fSAndroid Build Coastguard Worker #include "fxbarcode/cbc_codebase.h" 23*3ac0a46fSAndroid Build Coastguard Worker 24*3ac0a46fSAndroid Build Coastguard Worker #include <utility> 25*3ac0a46fSAndroid Build Coastguard Worker 26*3ac0a46fSAndroid Build Coastguard Worker #include "fxbarcode/BC_Writer.h" 27*3ac0a46fSAndroid Build Coastguard Worker CBC_CodeBase(std::unique_ptr<CBC_Writer> pWriter)28*3ac0a46fSAndroid Build Coastguard WorkerCBC_CodeBase::CBC_CodeBase(std::unique_ptr<CBC_Writer> pWriter) 29*3ac0a46fSAndroid Build Coastguard Worker : m_pBCWriter(std::move(pWriter)) {} 30*3ac0a46fSAndroid Build Coastguard Worker 31*3ac0a46fSAndroid Build Coastguard Worker CBC_CodeBase::~CBC_CodeBase() = default; 32*3ac0a46fSAndroid Build Coastguard Worker SetTextLocation(BC_TEXT_LOC location)33*3ac0a46fSAndroid Build Coastguard Workervoid CBC_CodeBase::SetTextLocation(BC_TEXT_LOC location) { 34*3ac0a46fSAndroid Build Coastguard Worker m_pBCWriter->SetTextLocation(location); 35*3ac0a46fSAndroid Build Coastguard Worker } 36*3ac0a46fSAndroid Build Coastguard Worker SetWideNarrowRatio(int8_t ratio)37*3ac0a46fSAndroid Build Coastguard Workerbool CBC_CodeBase::SetWideNarrowRatio(int8_t ratio) { 38*3ac0a46fSAndroid Build Coastguard Worker return m_pBCWriter->SetWideNarrowRatio(ratio); 39*3ac0a46fSAndroid Build Coastguard Worker } 40*3ac0a46fSAndroid Build Coastguard Worker SetStartChar(char start)41*3ac0a46fSAndroid Build Coastguard Workerbool CBC_CodeBase::SetStartChar(char start) { 42*3ac0a46fSAndroid Build Coastguard Worker return m_pBCWriter->SetStartChar(start); 43*3ac0a46fSAndroid Build Coastguard Worker } 44*3ac0a46fSAndroid Build Coastguard Worker SetEndChar(char end)45*3ac0a46fSAndroid Build Coastguard Workerbool CBC_CodeBase::SetEndChar(char end) { 46*3ac0a46fSAndroid Build Coastguard Worker return m_pBCWriter->SetEndChar(end); 47*3ac0a46fSAndroid Build Coastguard Worker } 48*3ac0a46fSAndroid Build Coastguard Worker SetErrorCorrectionLevel(int32_t level)49*3ac0a46fSAndroid Build Coastguard Workerbool CBC_CodeBase::SetErrorCorrectionLevel(int32_t level) { 50*3ac0a46fSAndroid Build Coastguard Worker return m_pBCWriter->SetErrorCorrectionLevel(level); 51*3ac0a46fSAndroid Build Coastguard Worker } 52*3ac0a46fSAndroid Build Coastguard Worker SetCharEncoding(BC_CHAR_ENCODING encoding)53*3ac0a46fSAndroid Build Coastguard Workervoid CBC_CodeBase::SetCharEncoding(BC_CHAR_ENCODING encoding) { 54*3ac0a46fSAndroid Build Coastguard Worker m_pBCWriter->SetCharEncoding(encoding); 55*3ac0a46fSAndroid Build Coastguard Worker } 56*3ac0a46fSAndroid Build Coastguard Worker SetModuleHeight(int32_t moduleHeight)57*3ac0a46fSAndroid Build Coastguard Workerbool CBC_CodeBase::SetModuleHeight(int32_t moduleHeight) { 58*3ac0a46fSAndroid Build Coastguard Worker return m_pBCWriter->SetModuleHeight(moduleHeight); 59*3ac0a46fSAndroid Build Coastguard Worker } 60*3ac0a46fSAndroid Build Coastguard Worker SetModuleWidth(int32_t moduleWidth)61*3ac0a46fSAndroid Build Coastguard Workerbool CBC_CodeBase::SetModuleWidth(int32_t moduleWidth) { 62*3ac0a46fSAndroid Build Coastguard Worker return m_pBCWriter->SetModuleWidth(moduleWidth); 63*3ac0a46fSAndroid Build Coastguard Worker } 64*3ac0a46fSAndroid Build Coastguard Worker SetHeight(int32_t height)65*3ac0a46fSAndroid Build Coastguard Workervoid CBC_CodeBase::SetHeight(int32_t height) { 66*3ac0a46fSAndroid Build Coastguard Worker return m_pBCWriter->SetHeight(height); 67*3ac0a46fSAndroid Build Coastguard Worker } 68*3ac0a46fSAndroid Build Coastguard Worker SetWidth(int32_t width)69*3ac0a46fSAndroid Build Coastguard Workervoid CBC_CodeBase::SetWidth(int32_t width) { 70*3ac0a46fSAndroid Build Coastguard Worker return m_pBCWriter->SetWidth(width); 71*3ac0a46fSAndroid Build Coastguard Worker } 72