• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_CXFA_TEXTPROVIDER_H_
8 #define XFA_FXFA_CXFA_TEXTPROVIDER_H_
9 
10 #include "core/fxcrt/fx_string.h"
11 #include "xfa/fxfa/cxfa_textlayout.h"
12 #include "xfa/fxfa/cxfa_widgetacc.h"
13 
14 class CXFA_Font;
15 class CXFA_Node;
16 
17 enum XFA_TEXTPROVIDERTYPE {
18   XFA_TEXTPROVIDERTYPE_Text,
19   XFA_TEXTPROVIDERTYPE_Datasets,
20   XFA_TEXTPROVIDERTYPE_Caption,
21   XFA_TEXTPROVIDERTYPE_Rollover,
22   XFA_TEXTPROVIDERTYPE_Down,
23 };
24 
25 class CXFA_TextProvider {
26  public:
CXFA_TextProvider(CXFA_WidgetAcc * pWidgetAcc,XFA_TEXTPROVIDERTYPE eType)27   CXFA_TextProvider(CXFA_WidgetAcc* pWidgetAcc, XFA_TEXTPROVIDERTYPE eType)
28       : m_pWidgetAcc(pWidgetAcc), m_eType(eType) {
29     ASSERT(m_pWidgetAcc);
30   }
~CXFA_TextProvider()31   ~CXFA_TextProvider() {}
32 
33   CXFA_Node* GetTextNode(bool& bRichText);
34   CXFA_Para* GetParaIfExists();
35   CXFA_Font* GetFontIfExists();
36   bool IsCheckButtonAndAutoWidth();
37   bool GetEmbbedObj(bool bURI,
38                     bool bRaw,
39                     const WideString& wsAttr,
40                     WideString& wsValue);
41 
42  private:
43   CXFA_WidgetAcc* m_pWidgetAcc;
44   XFA_TEXTPROVIDERTYPE m_eType;
45 };
46 
47 #endif  // XFA_FXFA_CXFA_TEXTPROVIDER_H_
48