Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfwl_barcode.h
Go to the documentation of this file.
1// Copyright 2014 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 XFA_FWL_CFWL_BARCODE_H_
8#define XFA_FWL_CFWL_BARCODE_H_
9
10#include <stdint.h>
11
12#include <memory>
13
14#include "fxbarcode/BC_Library.h"
15#include "third_party/abseil-cpp/absl/types/optional.h"
16#include "xfa/fwl/cfwl_edit.h"
17
18class CFX_Barcode;
19
20class CFWL_Barcode final : public CFWL_Edit {
21 public:
23 ~CFWL_Barcode() override;
24
25 // CFWL_Widget
26 FWL_Type GetClassID() const override;
27 void Update() override;
28 void DrawWidget(CFGAS_GEGraphics* pGraphics,
29 const CFX_Matrix& matrix) override;
30 void OnProcessEvent(CFWL_Event* pEvent) override;
31
32 // CFWL_Edit
33 void SetText(const WideString& wsText) override;
34 void SetTextSkipNotify(const WideString& wsText) override;
35
36 void SetType(BC_TYPE type);
37 bool IsProtectedType() const;
38
39 void SetCharEncoding(BC_CHAR_ENCODING encoding);
40 void SetModuleHeight(int32_t height);
41 void SetModuleWidth(int32_t width);
42 void SetDataLength(int32_t dataLength);
43 void SetCalChecksum(bool calChecksum);
44 void SetPrintChecksum(bool printChecksum);
45 void SetTextLocation(BC_TEXT_LOC location);
46 void SetWideNarrowRatio(int8_t ratio);
47 void SetStartChar(char startChar);
48 void SetEndChar(char endChar);
49 void SetErrorCorrectionLevel(int32_t ecLevel);
50
51 private:
52 enum class Status : uint8_t {
53 kNormal,
54 kNeedUpdate,
55 kEncodeSuccess,
56 };
57
58 explicit CFWL_Barcode(CFWL_App* pApp);
59
60 void GenerateBarcodeImageCache();
61 void CreateBarcodeEngine();
62
64 Status m_eStatus = Status::kNormal;
65 absl::optional<BC_TEXT_LOC> m_eTextLocation;
66 absl::optional<BC_CHAR_ENCODING> m_eCharEncoding;
67 absl::optional<bool> m_bCalChecksum;
68 absl::optional<bool> m_bPrintChecksum;
69 absl::optional<char> m_cStartChar;
70 absl::optional<char> m_cEndChar;
71 absl::optional<int8_t> m_nWideNarrowRatio;
72 absl::optional<int32_t> m_nModuleHeight;
73 absl::optional<int32_t> m_nModuleWidth;
74 absl::optional<int32_t> m_nDataLength;
75 absl::optional<int32_t> m_nECLevel;
76 std::unique_ptr<CFX_Barcode> m_pBarcodeEngine;
77};
78
79#endif // XFA_FWL_CFWL_BARCODE_H_
BC_TEXT_LOC
Definition BC_Library.h:12
BC_TYPE
Definition BC_Library.h:25
BC_CHAR_ENCODING
Definition BC_Library.h:20
FWL_Type
Definition cfwl_widget.h:46
#define FWL_STATE_WGT_Focused
Definition cfwl_widget.h:42
void SetDataLength(int32_t dataLength)
FWL_Type GetClassID() const override
void SetType(BC_TYPE type)
void SetCalChecksum(bool calChecksum)
void SetWideNarrowRatio(int8_t ratio)
~CFWL_Barcode() override
void OnProcessEvent(CFWL_Event *pEvent) override
void Update() override
void DrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
void SetPrintChecksum(bool printChecksum)
void SetTextLocation(BC_TEXT_LOC location)
void SetStartChar(char startChar)
void SetText(const WideString &wsText) override
void SetEndChar(char endChar)
void SetModuleHeight(int32_t height)
void SetErrorCorrectionLevel(int32_t ecLevel)
void SetTextSkipNotify(const WideString &wsText) override
void SetModuleWidth(int32_t width)
bool IsProtectedType() const
void SetCharEncoding(BC_CHAR_ENCODING encoding)
virtual void SetText(const WideString &wsText)
void SetLimit(int32_t nLimit)
const CFX_RectF & GetRTClient() const
Definition cfwl_edit.h:105
void DrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
CFWL_Edit(CFWL_App *app, const Properties &properties, CFWL_Widget *pOuter)
Definition cfwl_edit.cpp:50
void Update() override
void OnProcessEvent(CFWL_Event *pEvent) override
virtual void SetTextSkipNotify(const WideString &wsText)
Type GetType() const
Definition cfwl_event.h:39
Properties m_Properties
IFWL_ThemeProvider * GetThemeProvider() const
bool IsLocked() const
void Concat(const CFX_Matrix &right)
#define CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED
Definition heap.h:32