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
cxfa_ffsignature.cpp
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#include "xfa/fxfa/cxfa_ffsignature.h"
8
9#include "third_party/base/check.h"
10#include "xfa/fxfa/cxfa_ffdoc.h"
11#include "xfa/fxfa/cxfa_fffield.h"
12#include "xfa/fxfa/cxfa_ffpageview.h"
13#include "xfa/fxfa/cxfa_ffwidget.h"
14#include "xfa/fxfa/parser/cxfa_border.h"
15
16CXFA_FFSignature::CXFA_FFSignature(CXFA_Node* pNode) : CXFA_FFField(pNode) {}
17
18CXFA_FFSignature::~CXFA_FFSignature() = default;
19
20bool CXFA_FFSignature::LoadWidget() {
21 DCHECK(!IsLoaded());
23}
24
25void CXFA_FFSignature::RenderWidget(CFGAS_GEGraphics* pGS,
26 const CFX_Matrix& matrix,
27 HighlightOption highlight) {
28 if (!HasVisibleStatus())
29 return;
30
31 CFX_Matrix mtRotate = GetRotateMatrix();
32 mtRotate.Concat(matrix);
33
34 CXFA_FFWidget::RenderWidget(pGS, mtRotate, highlight);
35
36 DrawBorder(pGS, m_pNode->GetUIBorder(), m_UIRect, mtRotate);
37 RenderCaption(pGS, mtRotate);
38 DrawHighlight(pGS, mtRotate, highlight, kSquareShape);
39}
40
41bool CXFA_FFSignature::OnMouseEnter() {
42 return false;
43}
44
45bool CXFA_FFSignature::OnMouseExit() {
46 return false;
47}
48
49bool CXFA_FFSignature::AcceptsFocusOnButtonDown(
50 Mask<XFA_FWL_KeyFlag> dwFlags,
51 const CFX_PointF& point,
52 CFWL_MessageMouse::MouseCommand command) {
53 return false;
54}
55
56bool CXFA_FFSignature::OnLButtonDown(Mask<XFA_FWL_KeyFlag> dwFlags,
57 const CFX_PointF& point) {
58 return false;
59}
60
61bool CXFA_FFSignature::OnLButtonUp(Mask<XFA_FWL_KeyFlag> dwFlags,
62 const CFX_PointF& point) {
63 return false;
64}
65
66bool CXFA_FFSignature::OnLButtonDblClk(Mask<XFA_FWL_KeyFlag> dwFlags,
67 const CFX_PointF& point) {
68 return false;
69}
70
71bool CXFA_FFSignature::OnMouseMove(Mask<XFA_FWL_KeyFlag> dwFlags,
72 const CFX_PointF& point) {
73 return false;
74}
75
76bool CXFA_FFSignature::OnMouseWheel(Mask<XFA_FWL_KeyFlag> dwFlags,
77 const CFX_PointF& point,
78 const CFX_Vector& delta) {
79 return false;
80}
81
82bool CXFA_FFSignature::OnRButtonDown(Mask<XFA_FWL_KeyFlag> dwFlags,
83 const CFX_PointF& point) {
84 return false;
85}
86
87bool CXFA_FFSignature::OnRButtonUp(Mask<XFA_FWL_KeyFlag> dwFlags,
88 const CFX_PointF& point) {
89 return false;
90}
91
92bool CXFA_FFSignature::OnRButtonDblClk(Mask<XFA_FWL_KeyFlag> dwFlags,
93 const CFX_PointF& point) {
94 return false;
95}
96
97bool CXFA_FFSignature::OnKeyDown(XFA_FWL_VKEYCODE dwKeyCode,
98 Mask<XFA_FWL_KeyFlag> dwFlags) {
99 return false;
100}
101
102bool CXFA_FFSignature::OnChar(uint32_t nChar, Mask<XFA_FWL_KeyFlag> dwFlags) {
103 return false;
104}
105
106FWL_WidgetHit CXFA_FFSignature::HitTest(const CFX_PointF& point) {
107 auto* pNorm = GetNormalWidget();
108 if (pNorm && pNorm->HitTest(FWLToClient(point)) != FWL_WidgetHit::Unknown)
110 if (!GetRectWithoutRotate().Contains(point))
115}
116
117FormFieldType CXFA_FFSignature::GetFormFieldType() {
118 return FormFieldType::kXFA_Signature;
119}
void Concat(const CFX_Matrix &right)
bool Contains(const PointType &p) const
CXFA_FFField(CXFA_Node *pNode)
CFX_PointF FWLToClient(const CFX_PointF &point)
void DrawHighlight(CFGAS_GEGraphics *pGS, const CFX_Matrix &pMatrix, HighlightOption highlight, ShapeOption shape)
bool LoadWidget() override
void RenderCaption(CFGAS_GEGraphics *pGS, const CFX_Matrix &pMatrix)
CFX_RectF m_CaptionRect
~CXFA_FFSignature() override
bool OnMouseWheel(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point, const CFX_Vector &delta) override
bool OnMouseExit() override
void RenderWidget(CFGAS_GEGraphics *pGS, const CFX_Matrix &matrix, HighlightOption highlight) override
bool OnLButtonDown(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
FWL_WidgetHit HitTest(const CFX_PointF &point) override
bool OnKeyDown(XFA_FWL_VKEYCODE dwKeyCode, Mask< XFA_FWL_KeyFlag > dwFlags) override
bool OnRButtonDblClk(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
bool OnRButtonDown(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
bool OnRButtonUp(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
bool OnChar(uint32_t dwChar, Mask< XFA_FWL_KeyFlag > dwFlags) override
bool OnMouseEnter() override
bool AcceptsFocusOnButtonDown(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point, CFWL_MessageMouse::MouseCommand command) override
FormFieldType GetFormFieldType() override
bool LoadWidget() override
bool OnMouseMove(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
bool OnLButtonDblClk(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
bool OnLButtonUp(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
CFX_Matrix GetRotateMatrix() override
virtual void RenderWidget(CFGAS_GEGraphics *pGS, const CFX_Matrix &matrix, HighlightOption highlight)
bool HasVisibleStatus() const
CFX_RectF GetRectWithoutRotate()
FormFieldType
XFA_FWL_KeyFlag
XFA_FWL_VKEYCODE
FWL_WidgetHit