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_FFWIDGETACC_H_ 8 #define XFA_FXFA_APP_XFA_FFWIDGETACC_H_ 9 10 #include "core/fxcrt/fx_string.h" 11 #include "xfa/fxfa/app/cxfa_textlayout.h" 12 #include "xfa/fxfa/fxfa_widget.h" 13 #include "xfa/fxfa/parser/cxfa_font.h" 14 #include "xfa/fxfa/parser/cxfa_para.h" 15 16 class CXFA_FFDoc; 17 class CXFA_Node; 18 19 enum XFA_TEXTPROVIDERTYPE { 20 XFA_TEXTPROVIDERTYPE_Text, 21 XFA_TEXTPROVIDERTYPE_Datasets, 22 XFA_TEXTPROVIDERTYPE_Caption, 23 XFA_TEXTPROVIDERTYPE_Rollover, 24 XFA_TEXTPROVIDERTYPE_Down, 25 }; 26 27 class CXFA_TextProvider { 28 public: 29 CXFA_TextProvider(CXFA_WidgetAcc* pWidgetAcc, 30 XFA_TEXTPROVIDERTYPE eType, 31 CXFA_Node* pTextNode = nullptr) m_pWidgetAcc(pWidgetAcc)32 : m_pWidgetAcc(pWidgetAcc), m_eType(eType), m_pTextNode(pTextNode) { 33 ASSERT(m_pWidgetAcc); 34 } ~CXFA_TextProvider()35 ~CXFA_TextProvider() {} 36 37 CXFA_Node* GetTextNode(bool& bRichText); 38 CXFA_Para GetParaNode(); 39 CXFA_Font GetFontNode(); 40 bool IsCheckButtonAndAutoWidth(); GetDocNode()41 CXFA_FFDoc* GetDocNode() { return m_pWidgetAcc->GetDoc(); } 42 bool GetEmbbedObj(bool bURI, 43 bool bRaw, 44 const CFX_WideString& wsAttr, 45 CFX_WideString& wsValue); 46 47 protected: 48 CXFA_WidgetAcc* m_pWidgetAcc; 49 XFA_TEXTPROVIDERTYPE m_eType; 50 CXFA_Node* m_pTextNode; 51 }; 52 53 #endif // XFA_FXFA_APP_XFA_FFWIDGETACC_H_ 54