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

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

Issue 2480233003: Fold DataProviders into parent classes (Closed)
Patch Set: Review feedback Created 4 years, 1 month 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/core/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_CORE_CFWL_BARCODE_H_ 7 #ifndef XFA_FWL_CORE_CFWL_BARCODE_H_
8 #define XFA_FWL_CORE_CFWL_BARCODE_H_ 8 #define XFA_FWL_CORE_CFWL_BARCODE_H_
9 9
10 #include "xfa/fwl/core/cfwl_edit.h" 10 #include "xfa/fwl/core/cfwl_edit.h"
11 #include "xfa/fwl/core/fwl_error.h" 11 #include "xfa/fwl/core/fwl_error.h"
12 #include "xfa/fwl/core/ifwl_barcode.h" 12 #include "xfa/fwl/core/ifwl_barcode.h"
13 13
14 class CFWL_Widget; 14 class CFWL_Barcode : public CFWL_Edit, public IFWL_BarcodeDP {
15
16 class CFWL_Barcode : public CFWL_Edit {
17 public: 15 public:
18 CFWL_Barcode(const IFWL_App*); 16 CFWL_Barcode(const IFWL_App*);
19 ~CFWL_Barcode() override; 17 ~CFWL_Barcode() override;
20 18
21 void Initialize(); 19 void Initialize();
22 20
23 void SetType(BC_TYPE type); 21 void SetType(BC_TYPE type);
24 bool IsProtectedType(); 22 bool IsProtectedType();
25 23
26 void SetCharEncoding(BC_CHAR_ENCODING encoding); 24 void SetCharEncoding(BC_CHAR_ENCODING encoding);
27 void SetModuleHeight(int32_t height); 25 void SetModuleHeight(int32_t height);
28 void SetModuleWidth(int32_t width); 26 void SetModuleWidth(int32_t width);
29 void SetDataLength(int32_t dataLength); 27 void SetDataLength(int32_t dataLength);
30 void SetCalChecksum(bool calChecksum); 28 void SetCalChecksum(bool calChecksum);
31 void SetPrintChecksum(bool printChecksum); 29 void SetPrintChecksum(bool printChecksum);
32 void SetTextLocation(BC_TEXT_LOC location); 30 void SetTextLocation(BC_TEXT_LOC location);
33 void SetWideNarrowRatio(int32_t ratio); 31 void SetWideNarrowRatio(int32_t ratio);
34 void SetStartChar(FX_CHAR startChar); 32 void SetStartChar(FX_CHAR startChar);
35 void SetEndChar(FX_CHAR endChar); 33 void SetEndChar(FX_CHAR endChar);
36 void SetVersion(int32_t version); 34 void SetVersion(int32_t version);
37 void SetErrorCorrectionLevel(int32_t ecLevel); 35 void SetErrorCorrectionLevel(int32_t ecLevel);
38 void SetTruncated(bool truncated); 36 void SetTruncated(bool truncated);
39 void ResetBarcodeAttributes(); 37 void ResetBarcodeAttributes();
40 38
41 protected: 39 // IFWL_DataProvider
42 class CFWL_BarcodeDP : public IFWL_BarcodeDP { 40 FWL_Error GetCaption(IFWL_Widget* pWidget,
43 public: 41 CFX_WideString& wsCaption) override;
44 CFWL_BarcodeDP();
45 42
46 // IFWL_DataProvider 43 // IFWL_BarcodeDP
47 FWL_Error GetCaption(IFWL_Widget* pWidget, 44 BC_CHAR_ENCODING GetCharEncoding() const override;
48 CFX_WideString& wsCaption) override; 45 int32_t GetModuleHeight() const override;
46 int32_t GetModuleWidth() const override;
47 int32_t GetDataLength() const override;
48 bool GetCalChecksum() const override;
49 bool GetPrintChecksum() const override;
50 BC_TEXT_LOC GetTextLocation() const override;
51 int32_t GetWideNarrowRatio() const override;
52 FX_CHAR GetStartChar() const override;
53 FX_CHAR GetEndChar() const override;
54 int32_t GetVersion() const override;
55 int32_t GetErrorCorrectionLevel() const override;
56 bool GetTruncated() const override;
57 uint32_t GetBarcodeAttributeMask() const override;
49 58
50 // IFWL_BarcodeDP 59 private:
51 BC_CHAR_ENCODING GetCharEncoding() const override; 60 BC_CHAR_ENCODING m_eCharEncoding;
52 int32_t GetModuleHeight() const override; 61 int32_t m_nModuleHeight;
53 int32_t GetModuleWidth() const override; 62 int32_t m_nModuleWidth;
54 int32_t GetDataLength() const override; 63 int32_t m_nDataLength;
55 bool GetCalChecksum() const override; 64 bool m_bCalChecksum;
56 bool GetPrintChecksum() const override; 65 bool m_bPrintChecksum;
57 BC_TEXT_LOC GetTextLocation() const override; 66 BC_TEXT_LOC m_eTextLocation;
58 int32_t GetWideNarrowRatio() const override; 67 int32_t m_nWideNarrowRatio;
59 FX_CHAR GetStartChar() const override; 68 FX_CHAR m_cStartChar;
60 FX_CHAR GetEndChar() const override; 69 FX_CHAR m_cEndChar;
61 int32_t GetVersion() const override; 70 int32_t m_nVersion;
62 int32_t GetErrorCorrectionLevel() const override; 71 int32_t m_nECLevel;
63 bool GetTruncated() const override; 72 bool m_bTruncated;
64 uint32_t GetBarcodeAttributeMask() const override; 73 uint32_t m_dwAttributeMask;
65
66 BC_CHAR_ENCODING m_eCharEncoding;
67 int32_t m_nModuleHeight;
68 int32_t m_nModuleWidth;
69 int32_t m_nDataLength;
70 bool m_bCalChecksum;
71 bool m_bPrintChecksum;
72 BC_TEXT_LOC m_eTextLocation;
73 int32_t m_nWideNarrowRatio;
74 FX_CHAR m_cStartChar;
75 FX_CHAR m_cEndChar;
76 int32_t m_nVersion;
77 int32_t m_nECLevel;
78 bool m_bTruncated;
79 uint32_t m_dwAttributeMask;
80 };
81
82 CFWL_BarcodeDP m_barcodeData;
83 }; 74 };
84 75
85 #endif // XFA_FWL_CORE_CFWL_BARCODE_H_ 76 #endif // XFA_FWL_CORE_CFWL_BARCODE_H_
OLDNEW
« no previous file with comments | « no previous file | xfa/fwl/core/cfwl_barcode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698