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_FXFA_CXFA_FFIMAGEEDIT_H_ 8 #define XFA_FXFA_CXFA_FFIMAGEEDIT_H_ 9 10 #include "v8/include/cppgc/member.h" 11 #include "v8/include/cppgc/prefinalizer.h" 12 #include "xfa/fxfa/cxfa_fffield.h" 13 14 class CXFA_FFImageEdit final : public CXFA_FFField { 15 CPPGC_USING_PRE_FINALIZER(CXFA_FFImageEdit, PreFinalize); 16 17 public: 18 CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED; 19 ~CXFA_FFImageEdit() override; 20 21 void PreFinalize(); 22 23 // CXFA_FFField: 24 void Trace(cppgc::Visitor* visitor) const override; 25 void RenderWidget(CFGAS_GEGraphics* pGS, 26 const CFX_Matrix& matrix, 27 HighlightOption highlight) override; 28 bool LoadWidget() override; 29 bool AcceptsFocusOnButtonDown( 30 Mask<XFA_FWL_KeyFlag> dwFlags, 31 const CFX_PointF& point, 32 CFWL_MessageMouse::MouseCommand command) override; 33 bool OnLButtonDown(Mask<XFA_FWL_KeyFlag> dwFlags, 34 const CFX_PointF& point) override; 35 void OnProcessMessage(CFWL_Message* pMessage) override; 36 void OnProcessEvent(CFWL_Event* pEvent) override; 37 void OnDrawWidget(CFGAS_GEGraphics* pGraphics, 38 const CFX_Matrix& matrix) override; 39 FormFieldType GetFormFieldType() override; 40 41 private: 42 explicit CXFA_FFImageEdit(CXFA_Node* pNode); 43 44 void SetFWLRect() override; 45 bool UpdateFWLData() override; 46 bool CommitData() override; 47 48 cppgc::Member<IFWL_WidgetDelegate> m_pOldDelegate; 49 }; 50 51 #endif // XFA_FXFA_CXFA_FFIMAGEEDIT_H_ 52