1 // Copyright 2014 PDFium Authors. All rights reserved. 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_APP_XFA_FFPUSHBUTTON_H_ 8 #define XFA_FXFA_APP_XFA_FFPUSHBUTTON_H_ 9 10 #include "xfa/fxfa/app/xfa_fffield.h" 11 12 #define XFA_FWL_PSBSTYLEEXT_HiliteNone (0L << 0) 13 #define XFA_FWL_PSBSTYLEEXT_HiliteInverted (1L << 0) 14 #define XFA_FWL_PSBSTYLEEXT_HilitePush (2L << 0) 15 #define XFA_FWL_PSBSTYLEEXT_HiliteOutLine (4L << 0) 16 17 class CXFA_TextProvider; 18 19 class CXFA_FFPushButton : public CXFA_FFField { 20 public: 21 explicit CXFA_FFPushButton(CXFA_WidgetAcc* pDataAcc); 22 ~CXFA_FFPushButton() override; 23 24 // CXFA_FFField 25 void RenderWidget(CFX_Graphics* pGS, 26 CFX_Matrix* pMatrix, 27 uint32_t dwStatus) override; 28 bool LoadWidget() override; 29 void UnloadWidget() override; 30 bool PerformLayout() override; 31 void UpdateWidgetProperty() override; 32 void OnProcessMessage(CFWL_Message* pMessage) override; 33 void OnProcessEvent(CFWL_Event* pEvent) override; 34 void OnDrawWidget(CFX_Graphics* pGraphics, 35 const CFX_Matrix* pMatrix = nullptr) override; 36 37 protected: 38 void LoadHighlightCaption(); 39 void LayoutHighlightCaption(); 40 void RenderHighlightCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = nullptr); 41 FX_FLOAT GetLineWidth(); 42 FX_ARGB GetLineColor(); 43 FX_ARGB GetFillColor(); 44 45 CXFA_TextLayout* m_pRolloverTextLayout; 46 CXFA_TextLayout* m_pDownTextLayout; 47 CXFA_TextProvider* m_pDownProvider; 48 CXFA_TextProvider* m_pRollProvider; 49 IFWL_WidgetDelegate* m_pOldDelegate; 50 }; 51 52 #endif // XFA_FXFA_APP_XFA_FFPUSHBUTTON_H_ 53