Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: xfa/fwl/lightwidget/cfwl_barcode.h

Issue 2209153002: Use virtual function to retrieve interface pointer (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comment Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | xfa/fwl/lightwidget/cfwl_barcode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_ 7 #ifndef XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_
8 #define XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_ 8 #define XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_
9 9
10 #include "xfa/fwl/basewidget/ifwl_barcode.h" 10 #include "xfa/fwl/basewidget/ifwl_barcode.h"
11 #include "xfa/fwl/core/fwl_error.h" 11 #include "xfa/fwl/core/fwl_error.h"
12 #include "xfa/fwl/lightwidget/cfwl_edit.h" 12 #include "xfa/fwl/lightwidget/cfwl_edit.h"
13 13
14 class CFWL_Widget; 14 class CFWL_Widget;
15 class CFWL_WidgetProperties; 15 class CFWL_WidgetProperties;
16 16
17 class CFWL_Barcode : public CFWL_Edit { 17 class CFWL_Barcode : public CFWL_Edit {
18 public: 18 public:
19 static CFWL_Barcode* Create(); 19 static CFWL_Barcode* Create();
20
21 IFWL_Barcode* GetWidget() override;
22 const IFWL_Barcode* GetWidget() const override;
23
20 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); 24 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
21 void SetType(BC_TYPE type); 25 void SetType(BC_TYPE type);
22 FX_BOOL IsProtectedType(); 26 FX_BOOL IsProtectedType();
23 27
24 void SetCharEncoding(BC_CHAR_ENCODING encoding) { 28 void SetCharEncoding(BC_CHAR_ENCODING encoding) {
25 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CHARENCODING; 29 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CHARENCODING;
26 m_barcodeData.m_eCharEncoding = encoding; 30 m_barcodeData.m_eCharEncoding = encoding;
27 } 31 }
28 void SetModuleHeight(int32_t height) { 32 void SetModuleHeight(int32_t height) {
29 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEHEIGHT; 33 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEHEIGHT;
30 m_barcodeData.m_nModuleHeight = height; 34 m_barcodeData.m_nModuleHeight = height;
31 } 35 }
32 void SetModuleWidth(int32_t width) { 36 void SetModuleWidth(int32_t width) {
33 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEWIDTH; 37 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEWIDTH;
34 m_barcodeData.m_nModuleWidth = width; 38 m_barcodeData.m_nModuleWidth = width;
35 } 39 }
36 void SetDataLength(int32_t dataLength) { 40 void SetDataLength(int32_t dataLength) {
37 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_DATALENGTH; 41 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_DATALENGTH;
38 m_barcodeData.m_nDataLength = dataLength; 42 m_barcodeData.m_nDataLength = dataLength;
39 static_cast<IFWL_Barcode*>(m_pIface)->SetLimit(dataLength); 43 GetWidget()->SetLimit(dataLength);
40 } 44 }
41 void SetCalChecksum(int32_t calChecksum) { 45 void SetCalChecksum(int32_t calChecksum) {
42 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CALCHECKSUM; 46 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CALCHECKSUM;
43 m_barcodeData.m_nCalChecksum = calChecksum; 47 m_barcodeData.m_nCalChecksum = calChecksum;
44 } 48 }
45 void SetPrintChecksum(FX_BOOL printChecksum) { 49 void SetPrintChecksum(FX_BOOL printChecksum) {
46 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_PRINTCHECKSUM; 50 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_PRINTCHECKSUM;
47 m_barcodeData.m_bPrintChecksum = printChecksum; 51 m_barcodeData.m_bPrintChecksum = printChecksum;
48 } 52 }
49 void SetTextLocation(BC_TEXT_LOC location) { 53 void SetTextLocation(BC_TEXT_LOC location) {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 int32_t m_nVersion; 121 int32_t m_nVersion;
118 int32_t m_nECLevel; 122 int32_t m_nECLevel;
119 FX_BOOL m_bTruncated; 123 FX_BOOL m_bTruncated;
120 uint32_t m_dwAttributeMask; 124 uint32_t m_dwAttributeMask;
121 }; 125 };
122 126
123 CFWL_BarcodeDP m_barcodeData; 127 CFWL_BarcodeDP m_barcodeData;
124 }; 128 };
125 129
126 #endif // XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_ 130 #endif // XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_
OLDNEW
« no previous file with comments | « no previous file | xfa/fwl/lightwidget/cfwl_barcode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698