7#include "xfa/fxfa/cxfa_ffimageedit.h"
11#include "core/fxge/dib/cfx_dibitmap.h"
12#include "third_party/base/check.h"
13#include "v8/include/cppgc/visitor.h"
14#include "xfa/fwl/cfwl_app.h"
15#include "xfa/fwl/cfwl_messagemouse.h"
16#include "xfa/fwl/cfwl_notedriver.h"
17#include "xfa/fwl/cfwl_picturebox.h"
18#include "xfa/fxfa/cxfa_ffdoc.h"
19#include "xfa/fxfa/cxfa_ffdocview.h"
20#include "xfa/fxfa/cxfa_fffield.h"
21#include "xfa/fxfa/cxfa_ffpageview.h"
22#include "xfa/fxfa/cxfa_ffwidget.h"
23#include "xfa/fxfa/parser/cxfa_border.h"
24#include "xfa/fxfa/parser/cxfa_image.h"
25#include "xfa/fxfa/parser/cxfa_para.h"
26#include "xfa/fxfa/parser/cxfa_value.h"
33 m_pNode->SetEditImage(
nullptr);
36void CXFA_FFImageEdit::
Trace(
cppgc::Visitor* visitor)
const {
37 CXFA_FFField::Trace(visitor);
38 visitor->Trace(m_pOldDelegate);
44 CFWL_PictureBox* pPictureBox = cppgc::MakeGarbageCollected<CFWL_PictureBox>(
45 GetFWLApp()->GetHeap()->GetAllocationHandle(), GetFWLApp());
49 CFWL_NoteDriver* pNoteDriver = pPictureBox
->GetFWLApp()->GetNoteDriver();
51 m_pOldDelegate = pPictureBox->GetDelegate();
55 if (!m_pNode->GetEditImage())
71 DrawBorder(pGS, m_pNode->GetUIBorder(), m_UIRect, mtRotate);
73 RetainPtr<CFX_DIBitmap> pDIBitmap = m_pNode->GetEditImage();
77 CFX_RectF rtImage = GetNormalWidget()->GetWidgetRect();
80 CXFA_Para* para = m_pNode->GetParaIfExists();
87 CXFA_Value* value = m_pNode->GetFormValueIfExists();
94 XFA_DrawImage(pGS, rtImage, mtRotate, std::move(pDIBitmap), iAspect,
95 m_pNode->GetEditImageDpi(), iHorzAlign, iVertAlign);
100 const CFX_PointF& point,
105 if (!m_pNode->IsOpenAccess())
114 const CFX_PointF& point) {
116 CFWL_MessageMouse msg(GetNormalWidget(),
124 if (!GetNormalWidget())
127 CFX_RectF rtUIMargin = m_pNode->GetUIMargin();
131 GetNormalWidget()->SetWidgetRect(rtImage);
139 m_pNode->SetEditImage(
nullptr);
140 m_pNode->LoadEditImage(GetDoc());
145 m_pOldDelegate->OnProcessMessage(pMessage);
150 m_pOldDelegate->OnProcessEvent(pEvent);
155 m_pOldDelegate->OnDrawWidget(pGraphics, matrix);
159 return FormFieldType::kXFA_ImageField;
void RegisterEventTarget(CFWL_Widget *pListener, CFWL_Widget *pEventSource)
void Concat(const CFX_Matrix &right)
CFX_RectF(const CFX_RectF &other)=default
void Deflate(float off_left, float off_top, float off_right, float off_bottom)
CXFA_FFField(CXFA_Node *pNode)
CFX_PointF FWLToClient(const CFX_PointF &point)
bool LoadWidget() override
bool AcceptsFocusOnButtonDown(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point, CFWL_MessageMouse::MouseCommand command) override
void SetNormalWidget(CFWL_Widget *widget)
bool PtInActiveRect(const CFX_PointF &point) override
void OnProcessEvent(CFWL_Event *pEvent) override
void RenderCaption(CFGAS_GEGraphics *pGS, const CFX_Matrix &pMatrix)
void SendMessageToFWLWidget(CFWL_Message *pMessage)
bool CommitData() override
void OnDrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
void OnProcessEvent(CFWL_Event *pEvent) override
bool AcceptsFocusOnButtonDown(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point, CFWL_MessageMouse::MouseCommand command) override
void Trace(cppgc::Visitor *visitor) const override
~CXFA_FFImageEdit() override
bool OnLButtonDown(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
bool LoadWidget() override
void RenderWidget(CFGAS_GEGraphics *pGS, const CFX_Matrix &matrix, HighlightOption highlight) override
FormFieldType GetFormFieldType() override
void SetFWLRect() override
bool UpdateFWLData() override
void OnProcessMessage(CFWL_Message *pMessage) override
XFA_AttributeValue GetAspect()
XFA_AttributeValue GetHorizontalAlign()
XFA_AttributeValue GetVerticalAlign()
CXFA_Image * GetImageIfExists() const