Foxit PDF SDK
fs_xfa.h
Go to the documentation of this file.
1 
16 #ifndef FS_XFA_H_
17 #define FS_XFA_H_
18 
19 #include "common/fs_common.h"
20 #include "common/fs_image.h"
21 
27 namespace foxit {
28 namespace common {
29  class Bitmap;
30 }
31 
32 namespace pdf{
33 class Signature;
34 class PDFDoc;
35 }
36 
40 namespace addon {
44 namespace xfa {
45 class XFADoc;
46 class XFAPage;
47 class XFAWidget;
48 
50 class WidgetChoiceOption FS_FINAL : public Object {
51  public:
55  , selected(false){}
56 
66  , selected(selected){}
67 
74  : option_label(option.option_label)
75  , selected(option.selected){}
76 
85  option_label = option.option_label;
86  selected = option.selected;
87  return *this;
88  }
89 
99  void Set( const wchar_t* option_label, bool selected) {
100  this->option_label = option_label;
101  this->selected = selected;
102  }
103 
106 
108  bool selected;
109 };
110 
113 
120  public:
126  typedef enum _AppInfo {
139  } AppInfo;
140 
146  typedef enum _BeepType {
157  } BeepType;
158 
164  typedef enum _StringID {
382  } StringID;
383 
389  typedef enum _MsgBoxIconType {
398  } MsgBoxIconType;
399 
405  typedef enum _MsgBoxButtonType {
415 
421  typedef enum _MsgBoxButtonID {
430  } MsgBoxButtonID;
431 
432 
438  virtual void Release() = 0;
439 
449  virtual WString GetAppInfo(AppInfo app_info) = 0;
450 
459  virtual void Beep(BeepType type) = 0;
460 
474  virtual MsgBoxButtonID MsgBox(const wchar_t* message, const wchar_t* title, MsgBoxIconType icon_type,
475  MsgBoxButtonType button_type) = 0;
476 
489  virtual WString Response(const wchar_t* question, const wchar_t* title, const wchar_t* default_answer,
490  bool is_mask) = 0;
491 
499  virtual common::file::ReaderCallback* DownLoadUrl(const wchar_t* url) = 0;
500 
515  virtual WString PostRequestURL(const wchar_t* url, const wchar_t* data, const wchar_t* content_type,
516  const wchar_t* encode, const wchar_t* header) = 0;
517 
528  virtual bool PutRequestURL(const wchar_t* url, const wchar_t* data, const wchar_t* encode) = 0;
529 
547  virtual WString LoadString(StringID string_id) = 0;
548 
559  virtual WStringArray ShowFileDialog(const wchar_t* string_title, const wchar_t* string_filter,
560  bool is_openfile_dialog) = 0;
561 
562  protected:
563  ~AppProviderCallback() {}
564 };
565 
572  public:
578  typedef enum _InvalidateFlag {
583  } InvalidateFlag;
584 
590  typedef enum _PrintOption {
598  e_PrintOptionAsImage = 0x00000008,
603  } PrintOption;
604 
610  typedef enum _SubmitFormat {
621  } SubmitFormat;
622 
628  typedef enum _TextEncoding {
653  } TextEncoding;
654 
660  typedef enum _PageViewEventType {
668 
674  typedef enum _WidgetEventType {
679  } WidgetEventType;
680 
681 
687  virtual void Release() = 0;
688 
701  virtual void InvalidateRect(int page_index, const RectF& rect, InvalidateFlag flag) = 0;
702 
713  virtual void DisplayCaret(int page_index, bool is_visible, const RectF& rect) = 0;
714 
729  virtual bool GetPopupPos(int page_index, float min_popup, float max_popup,
730  const RectF& rect_widget, RectF& inout_rect_popup) = 0;
731 
740  virtual bool PopupMenu(int page_index, const PointF& rect_popup) = 0;
741 
749  virtual int GetCurrentPage(const XFADoc& doc) = 0;
750 
759  virtual void SetCurrentPage(const XFADoc& doc, int current_page_index) = 0;
760 
768  virtual void SetChangeMark(const XFADoc& doc) = 0;
769 
777  virtual WString GetTitle(const XFADoc& doc) = 0;
778 
788  virtual void SetFocus(XFAWidget& xfa_widget, bool is_relayout) = 0;
789 
800  virtual void ExportData(const XFADoc& doc, const WString& file_path) = 0;
801 
812  virtual void ImportData(const XFADoc& doc, const WString& file_path) = 0;
813 
822  virtual void GotoURL(const XFADoc& doc, const WString& url) = 0;
823 
836  virtual void Print(const XFADoc& doc, int start_page_index, int end_page_index, uint32 options) = 0;
837 
845  virtual ARGB GetHighlightColor(const XFADoc& doc) = 0;
846 
860  virtual bool SubmitData(const XFADoc& doc, const WString& target, SubmitFormat format, TextEncoding text_encoding,
861  const WString& content) = 0;
862 
873  virtual void PageViewEvent(int page_index, PageViewEventType page_view_event_type) = 0;
874 
885  virtual void WidgetEvent(const XFAWidget& xfa_widget,WidgetEventType widget_event_type) = 0;
886 
887  protected:
888  ~DocProviderCallback() {}
889 };
890 
900 class XFADoc FS_FINAL : public Base{
901  public:
907  typedef enum _EventType {
917  } EventType;
918 
924  typedef enum _Type {
928  e_Static = 1,
930  e_XDP = 2
931  } Type;
932 
938  typedef enum _ExportDataType {
945  } ExportDataType;
946 
947 
961  XFADoc(const pdf::PDFDoc& document, DocProviderCallback* xfa_doc_provider_handler);
962 
975  XFADoc(const foxit::pdf::PDFDoc& document);
976 
982  XFADoc(const XFADoc& other);
990  XFADoc& operator = (const XFADoc& other);
991 
999  bool operator == (const XFADoc& other) const;
1000 
1008  bool operator != (const XFADoc& other) const;
1009 
1017  bool IsEmpty() const;
1018 
1020  ~XFADoc();
1021 
1040 
1052 
1059  Type GetType() const;
1060 
1066  int GetPageCount() const;
1067 
1076  XFAPage GetPage(int page_index);
1077 
1087  bool ExportData(const char* output_file_path, ExportDataType export_type);
1088 
1098  bool ExportData(const wchar_t* output_file_path, ExportDataType export_type);
1099 
1110 
1121  void SetPDFPath(const char* pdf_file_path);
1122 
1133  void SetPDFPath(const wchar_t* pdf_file_path);
1134 
1143  bool ImportData(const char* file_path);
1144 
1153  bool ImportData(const wchar_t* file_path);
1154 
1164 
1170  void ResetForm();
1171 
1179  void FlattenTo(const char* output_file_path);
1180 
1188  void FlattenTo(const wchar_t* output_file_path);
1189 
1198 
1207  void ProcessEvent(EventType event_type);
1208 
1216  void SetFocus(XFAWidget xfa_widget);
1217 
1223  void KillFocus();
1224 
1238  XFAWidget GetWidgetByFullName(const WString& full_name);
1239 
1240  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1241  explicit XFADoc(FS_HANDLE handle = NULL);
1242 };
1243 
1250 class XFAPage FS_FINAL : public Base{
1251  public:
1257  XFAPage(const XFAPage& other);
1265  XFAPage& operator = (const XFAPage& other);
1266 
1274  bool operator == (const XFAPage& other) const;
1282  bool operator != (const XFAPage& other) const;
1283 
1285  ~XFAPage();
1286 
1294  bool IsEmpty() const;
1295 
1309  Matrix GetDisplayMatrix(int left, int top, int width, int height, common::Rotation rotate);
1310 
1316  float GetWidth() const;
1317 
1323  float GetHeight() const;
1324 
1335  XFAWidget GetWidgetAtDevicePoint(const Matrix& matrix, const PointF& device_point, float tolerance);
1336 
1342  int GetIndex() const;
1343 
1349  int GetWidgetCount() const;
1350 
1359  XFAWidget GetWidget(int widget_index) const;
1360 
1370  XFAWidget GetWidgetByFullName(const WString& full_name);
1371 
1379 
1387 
1397  XFAWidget GetNextWidget(const XFAWidget& widget);
1398 
1408  XFAWidget GetPrevWidget(const XFAWidget& widget);
1409 
1410  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1411  explicit XFAPage(FS_HANDLE handle = NULL);
1412 };
1413 
1420 class XFAWidget FS_FINAL : public Base{
1421  public:
1427  typedef enum _HitTestArea {
1436  } HitTestArea;
1437 
1443  typedef enum _WidgetType {
1478  } WidgetType;
1479 
1486  typedef enum _PresenceProperty {
1497  } PresenceProperty;
1498 
1504  typedef enum _WidgetNameType {
1511  } WidgetNameType;
1512 
1518  typedef enum _WidgetHAlignType {
1531  } WidgetHAlignType;
1532 
1538  typedef enum _WidgetVAlignType {
1545  } WidgetVAlignType;
1546 
1552  typedef enum _WidgetEdgePosition {
1562 
1563 
1569  XFAWidget(const XFAWidget& other);
1577  XFAWidget& operator = (const XFAWidget& other);
1578 
1586  bool operator == (const XFAWidget& other) const;
1594  bool operator != (const XFAWidget& other) const;
1595 
1603  bool IsEmpty() const;
1604 
1606  ~XFAWidget();
1607 
1613  XFAPage GetXFAPage();
1614 
1620  int GetIndex() const;
1621 
1627  void ResetData();
1628 
1637  RectF GetRect();
1638 
1644  WString GetValue();
1645 
1656  void SetValue(const wchar_t* value);
1657 
1664 
1675  void SetDefaultValue(const wchar_t* value);
1676 
1686 
1696 
1707  bool SetOptions(const addon::xfa::WidgetChoiceOptionArray& option_array);
1708 
1717  bool IsChecked() const;
1718 
1730  void SetCheckState(bool is_checked);
1731 
1737  bool IsListBox();
1738 
1746  bool IsSupportMultiline();
1747 
1756  bool IsSupportMultiSelect();
1757 
1766 
1772  bool OnMouseEnter();
1773 
1779  bool OnMouseExit();
1780 
1791  bool OnLButtonDown(const PointF& point, uint32 flags);
1792 
1803  bool OnLButtonUp(const PointF& point, uint32 flags);
1804 
1815  bool OnLButtonDoubleClick(const PointF& point, uint32 flags);
1816 
1827  bool OnMouseMove(const PointF& point, uint32 flags);
1828 
1839  bool OnRButtonDown(const PointF& point, uint32 flags);
1840 
1851  bool OnRButtonUp(const PointF& point, uint32 flags);
1852 
1865  bool OnKeyDown(uint32 key_code, uint32 flags);
1866 
1879  bool OnKeyUp(uint32 key_code, uint32 flags);
1880 
1891  bool OnChar(int input_char, uint32 flags);
1892 
1901  HitTestArea OnHitTest(const PointF& point);
1902 
1909  WidgetType GetType();
1910 
1918 
1926 
1935  bool HasEdge(WidgetEdgePosition edge_pos);
1936 
1946 
1952  WString GetToolTip();
1953 
1964 
1984  void SetImage(const foxit::common::Image& image);
1985 
1993  bool IsAllowRichText();
1994 
2000  bool IsReadOnly();
2001 
2009  bool IsRequired();
2010 
2023  bool ValidateValue(const wchar_t* value, WString& format);
2024 
2031 
2038 
2039  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2040  explicit XFAWidget(FS_HANDLE handle = NULL);
2041 };
2042 
2046 class WidgetMenu FS_FINAL : public Base {
2047  public:
2053  explicit WidgetMenu(const XFAWidget& xfa_widget);
2054 
2060  WidgetMenu(const WidgetMenu& other);
2068  WidgetMenu& operator = (const WidgetMenu& other);
2069 
2077  bool operator == (const WidgetMenu& other) const;
2085  bool operator != (const WidgetMenu& other) const;
2086 
2088  ~WidgetMenu();
2089 
2097  bool IsEmpty() const;
2098 
2104  bool CanCopy();
2105 
2111  bool CanCut();
2112 
2118  bool CanPaste();
2119 
2125  bool CanSelectAll();
2126 
2132  bool CanDelete();
2133 
2140  bool CanDeSelect();
2141 
2147  WString Copy();
2148 
2154  WString Cut();
2155 
2163  bool Paste(const wchar_t* text);
2164 
2170  bool SelectAll();
2171 
2177  bool Delete();
2178 
2184  bool DeSelect();
2185 
2192  bool CanUndo();
2193 
2200  bool CanRedo();
2201 
2207  bool Undo();
2208 
2214  bool Redo();
2215 
2221  bool Bold();
2222 
2228  bool Italic();
2229 
2235  bool Underline();
2236 
2242  bool Superscript();
2243 
2249  bool Subscript();
2250 
2256  bool ClearStyle();
2257 
2258  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
2259  explicit WidgetMenu(FS_HANDLE handle = NULL);
2260 };
2261 
2262 } // namespace XFA
2263 } // namespace addon
2264 } // namespace foxit
2265 #endif // namespace foxit
2266 
virtual void DisplayCaret(int page_index, bool is_visible, const RectF &rect)=0
A callback function used to display or hide caret.
Sample message: "Unable to set the value for property 'numPages'".
Definition: fs_xfa.h:202
int GetIndex() const
Get the index of XFA Widget in related XFA page.
Message box icon: Question.
Definition: fs_xfa.h:395
Message box button ID: Cancel.
Definition: fs_xfa.h:425
virtual void Beep(BeepType type)=0
A callback function used to beep for specified beep type.
Sample message: "Script failed(language is %s;context is %s) script=%s".
Definition: fs_xfa.h:370
If set, print page in reverse order; otherwise, in normal order.
Definition: fs_xfa.h:600
bool IsReadOnly()
Check whether the widget is read only.
XFA widget type: date time edit.
Definition: fs_xfa.h:1453
Sample message: "The element [%s] has violated its allowable number of occurrences".
Definition: fs_xfa.h:314
PresenceProperty
Enumeration for presence attribute of XFA widget.
Definition: fs_xfa.h:1486
void SetValue(const wchar_t *value)
Set the value string.
Sample message: "Bad suffix on number".
Definition: fs_xfa.h:222
Sample message: "SOM expression returned list when single result was expected".
Definition: fs_xfa.h:308
virtual void ExportData(const XFADoc &doc, const WString &file_path)=0
A callback function used to export data to file.
String ID for case: Use string in local language for "Tuesday".
Definition: fs_xfa.h:322
Sample message: "Condition is null".
Definition: fs_xfa.h:250
void SetDocProviderCallback(foxit::addon::xfa::DocProviderCallback *doc_provider_callback)
Set XFA document provider callback.
Sample message: "Unsupported method %s.".
Definition: fs_xfa.h:189
XFA widget type: rectangle.
Definition: fs_xfa.h:1469
virtual void ImportData(const XFADoc &doc, const WString &file_path)=0
A callback function used to import data from file.
This kind of event is triggered just after the rendered form has been sent to the printer,...
Definition: fs_xfa.h:914
The submit data is packaged in URL-encoded format as described in Uniform Resource Locator(URL).
Definition: fs_xfa.h:616
XFA widget type: barcode.
Definition: fs_xfa.h:1445
XFA widget type: unknown.
Definition: fs_xfa.h:1473
bool OnLButtonUp(const PointF &point, uint32 flags)
Call this function when left mouse button is up.
XFA widget type: arc.
Definition: fs_xfa.h:1451
virtual int GetCurrentPage(const XFADoc &doc)=0
A callback function used to get index of current page.
WidgetNameType
Enumeration for the type of XFA widget name.
Definition: fs_xfa.h:1504
File writing interface.
Definition: fx_stream.h:470
Sample message: "An attempt was made to reference property '%s' of a non-object in SOM expression %s"...
Definition: fs_xfa.h:292
bool operator==(const XFAWidget &other) const
Equal operator.
Sample message: "The value you entered for %s is invalid. To ignore validations for %s,...
Definition: fs_xfa.h:364
void Set(const wchar_t *option_label, bool selected)
Set value.
Definition: fs_xfa.h:99
Definition: fs_image.h:36
XFAWidget GetPrevWidget(const XFAWidget &widget)
Get the previous XFA widget of a specified XFA widget in current tab order.
WidgetMenu & operator=(const WidgetMenu &other)
Assign operator.
bool ImportData(const char *file_path)
Import data from an XML or XDP file.
Sample message: "Illegal continue".
Definition: fs_xfa.h:254
WidgetHAlignType
Enumeration for the type of text horizontal alignment of XFA widget.
Definition: fs_xfa.h:1518
Text encoding: GB18030.
Definition: fs_xfa.h:638
HitTestArea OnHitTest(const PointF &point)
Call this function to do hit test for a specified point.
XFA widget type: signature.
Definition: fs_xfa.h:1457
void SetCheckState(bool is_checked)
Set the checked state of the current XFA widget.
virtual void InvalidateRect(int page_index, const RectF &rect, InvalidateFlag flag)=0
A callback function used to invalidate rectangle according the flag.
bool Italic()
(Only useful for rich text) Make the rich text italic.
Sample message: "Index value is out of bounds".
Definition: fs_xfa.h:298
Sample message: "Unable to set the value for property 'length'".
Definition: fs_xfa.h:218
Sample message: "Invalidate token '%s'".
Definition: fs_xfa.h:232
XFAWidget GetWidgetByFullName(const WString &full_name)
Get the XFA widget which matches the specified full name in current XFA page.
PageViewEventType
Enumeration for the event type of page view.
Definition: fs_xfa.h:660
String ID for case: Use string in local language for "July".
Definition: fs_xfa.h:344
WidgetVAlignType GetVAlign()
Get text vertical alignment.
String ID for case: If to modify field. Sample message: "Do you want to modify this field?...
Definition: fs_xfa.h:170
WidgetEventType
Enumeration for the type of XFA widget event.
Definition: fs_xfa.h:674
Message box button ID: OK.
Definition: fs_xfa.h:423
CFX_Object Object
Object type.
Definition: fs_basictypes.h:221
Sample message: "Unable to set the value for property 'variation'".
Definition: fs_xfa.h:208
Sample message: "Cannot find function '%s'".
Definition: fs_xfa.h:280
WidgetType
Enumeration for the type of XFA widget.
Definition: fs_xfa.h:1443
Sample message: "Validate failed".
Definition: fs_xfa.h:166
The submit data is translated and packaged into an URL-Encoded format.
Definition: fs_xfa.h:620
XFA widget type: line.
Definition: fs_xfa.h:1463
bool HasEdge(WidgetEdgePosition edge_pos)
Check if the edge for specified position exists.
Sample message: "Not have a default property".
Definition: fs_xfa.h:198
WidgetVAlignType
Enumeration for the type of text vertical alignment of XFA widget.
Definition: fs_xfa.h:1538
bool Redo()
Redo the operation of related XFA widget. (No effect for rich text)
Sample message: "Unable to set the value for property 'ready'".
Definition: fs_xfa.h:212
XFAPage GetXFAPage()
Get the related XFA page, to which current XFA widget belongs.
Definition: fs_xfa.h:1250
InvalidateFlag
Enumeration for XFA invalidate flag.
Definition: fs_xfa.h:578
foxit::common::Bitmap GetBitmap()
Get the bitmap of current XFA widget.
Presence property: Inactive. Do not participate in interaction, layout, or rendering.
Definition: fs_xfa.h:1494
bool CanDelete()
Check if the text of related XFA widget can be deleted.
WString option_label
The displayed string value for the option.
Definition: fs_xfa.h:105
Sample message: "Out of the range of '%s' array".
Definition: fs_xfa.h:284
Sample message: "Unable to set the value for property 'validationsEnabled'".
Definition: fs_xfa.h:206
Definition: fs_basictypes.h:228
common::Progressive StartLoad(common::PauseCallback *pause=0)
Start to load content for current XFA document.
String ID for case: Use string in local language for "December".
Definition: fs_xfa.h:354
bool OnLButtonDown(const PointF &point, uint32 flags)
Call this function when left mouse button is down.
void SetImage(const foxit::common::Image &image)
Set the image for current XFA widget.
Matrix GetDisplayMatrix(int left, int top, int width, int height, common::Rotation rotate)
Get the display matrix, from PDF coordinate system to targeted device coordinate system.
Message box icon: Error.
Definition: fs_xfa.h:391
Egde position: top.
Definition: fs_xfa.h:1554
String ID for case: Use string in local language for "Thursday".
Definition: fs_xfa.h:326
Definition: fx_coordinates.h:30
Sample message: "Unable to set the value for property 'platform'".
Definition: fs_xfa.h:204
Message box button ID: Yes.
Definition: fs_xfa.h:429
bool CanCut()
Check if the text of related XFA widget can be cut.
bool IsEmpty() const
Check whether current object is empty or not.
String ID for case: Use string in local language for "October".
Definition: fs_xfa.h:350
virtual void SetFocus(XFAWidget &xfa_widget, bool is_relayout)=0
A callback function used to set focus widget.
Message box button: Yes, No and Cancel.
Definition: fs_xfa.h:413
Align the radix indicator.
Definition: fs_xfa.h:1528
Definition: fs_xfa.h:1420
Event type: after a page view is removed.
Definition: fs_xfa.h:664
bool Subscript()
(Only useful for rich text) Make the rich text as subscript.
Align the text to the left edge of the available region.
Definition: fs_xfa.h:1526
WString GetJavaScript()
Get the JavaScript of validation for current XFA widget.
File reading interface.
Definition: fx_stream.h:587
virtual WString Response(const wchar_t *question, const wchar_t *title, const wchar_t *default_answer, bool is_mask)=0
A callback function used to response.
PresenceProperty GetPresence()
Get the presence property of the XFA widget.
XFA widget type: image edit.
Definition: fs_xfa.h:1461
bool Underline()
(Only useful for rich text) Underline the rich text.
AppInfo
Enumeration for XFA application information type.
Definition: fs_xfa.h:126
Sample message: "Error:Argument mismatch in property or function argument.".
Definition: fs_xfa.h:381
Presence property: Visible. Participate in interaction, layout, and rendering.
Definition: fs_xfa.h:1490
MsgBoxIconType
Enumeration for icon type of XFA message box.
Definition: fs_xfa.h:389
bool OnMouseExit()
Call this function when mouse exits.
XFAPage(const XFAPage &other)
Constructor, with another XFA page object.
void SetPDFPath(const char *pdf_file_path)
Set the path of related PDF document.
Beep type: warning.
Definition: fs_xfa.h:150
Text encoding: GB2312.
Definition: fs_xfa.h:640
WidgetChoiceOption()
Constructor.
Definition: fs_xfa.h:53
WIDE STRING CLASS.
Definition: fx_string.h:1461
float GetHeight() const
Get the height of the XFA page.
XFAWidget GetWidgetAtDevicePoint(const Matrix &matrix, const PointF &device_point, float tolerance)
Get the XFA widget at a specified point, in device coordinate system.
bool IsEmpty() const
Check whether current object is empty or not.
int GetPageCount() const
Get XFA page count.
XFAPage & operator=(const XFAPage &other)
Assign operator.
Egde position: bottom.
Definition: fs_xfa.h:1558
bool OnKeyDown(uint32 key_code, uint32 flags)
Call this function when key on the keyboard is down.
WString GetToolTip()
Get tooltip string.
Name type: full name.
Definition: fs_xfa.h:1510
bool IsRequired()
Check whether the widget requires a value at the time it is exported by a submit-form action.
String ID for case: Use string in local language for "November".
Definition: fs_xfa.h:352
Hit test area: Title Bar.
Definition: fs_xfa.h:1433
bool OnChar(int input_char, uint32 flags)
Call this function when a character code is being input.
bool SetOptions(const addon::xfa::WidgetChoiceOptionArray &option_array)
Set options of a choice list or an Exclusion Group (for radio button only).
Sample message: "Cannot find property '%s'".
Definition: fs_xfa.h:264
bool ExportData(const char *output_file_path, ExportDataType export_type)
Export data to a file.
XFAWidget & operator=(const XFAWidget &other)
Assign operator.
Sample message: "Unable to set the value for property 'language'".
Definition: fs_xfa.h:200
Definition: fs_pdfdoc.h:772
XFA widget type: text edit.
Definition: fs_xfa.h:1471
bool operator !=(const WidgetMenu &other) const
Not equal operator.
XFA widget type: numeric edit.
Definition: fs_xfa.h:1455
bool Delete()
Delete all the text of related XFA widget.
Sample message: "'%s' redefinition".
Definition: fs_xfa.h:230
Event type: after an XFA widget is added.
Definition: fs_xfa.h:676
Sample message: "'%s' argument is expected to be a container".
Definition: fs_xfa.h:290
Name type: field name. Name in this type will be retrieved from XFA widget's name entry and this may ...
Definition: fs_xfa.h:1506
EventType
Enumeration for XFA event type.
Definition: fs_xfa.h:907
Sample message: "Argument mismatch in property or function argument".
Definition: fs_xfa.h:302
Sample message: "Unsupported character '%c'".
Definition: fs_xfa.h:220
Align the text so that it is centered between the top and bottom of the available region.
Definition: fs_xfa.h:1544
String ID for case: Use string in local language for "September".
Definition: fs_xfa.h:348
addon::xfa::WidgetChoiceOptionArray GetOptions() const
Get options of a choice list or an Exclusion Group (for radio button only).
bool OnMouseMove(const PointF &point, uint32 flags)
Call this function when mouse moves.
Header file for image and bitmap related definitions and classes.
PrintOption
Enumeration for XFA print options.
Definition: fs_xfa.h:590
This kind of event is triggered just before the rendering for printing begins.
Definition: fs_xfa.h:916
bool SelectAll()
Select all the text of related XFA widget.
bool CanSelectAll()
Check if the text of related XFA widget can be selected all.
virtual WString GetTitle(const XFADoc &doc)=0
A callback function used to get title of current XFA document.
virtual void Release()=0
A callback function used to release current callback object itself.
Message box icon: Status.
Definition: fs_xfa.h:397
Invalidate all pages.
Definition: fs_xfa.h:580
String ID for case: Use string in local language for "Monday".
Definition: fs_xfa.h:320
XFAWidget(const XFAWidget &other)
Constructor, with another XFA widget object.
bool CanCopy()
Check if the text of related XFA widget can be copied.
The submit data is packaged in XFD format, as described in XFDF.
Definition: fs_xfa.h:618
Align the text to the right edge of the available region.
Definition: fs_xfa.h:1530
WString GetName(WidgetNameType type)
Get Widget name.
Sample message: "The value you entered for %s is invalid.".
Definition: fs_xfa.h:366
WString Copy()
Copy the text of related XFA widget.
void ResetForm()
Reset form.
Sample message: "'%s' is not an array".
Definition: fs_xfa.h:282
XFA widget type: password edit.
Definition: fs_xfa.h:1465
bool OnLButtonDoubleClick(const PointF &point, uint32 flags)
Call this function when left mouse button is double-clicked .
Text encoding: UTF-16.
Definition: fs_xfa.h:650
No text encoding.
Definition: fs_xfa.h:630
StringID
Enumeration for string ID used to specify a case.
Definition: fs_xfa.h:164
WidgetMenu(const XFAWidget &xfa_widget)
Constructor, from XFA widget object.
Sample message: "Unknown error is caught!".
Definition: fs_xfa.h:181
The submit data is packaged in PDF format as described in the PDF Reference.
Definition: fs_xfa.h:614
bool IsSupportMultiline()
Check whether the widget supports multiple lines.
bool OnRButtonDown(const PointF &point, uint32 flags)
Call this function when right mouse is down.
Sample message: "Expected 'endif' instead of '%s'".
Definition: fs_xfa.h:246
String ID for case: Application's name. Sample message: "Foxit Phantom".
Definition: fs_xfa.h:174
Presence property: Hidden. Participate in interaction but not layout or rendering.
Definition: fs_xfa.h:1492
virtual void SetCurrentPage(const XFADoc &doc, int current_page_index)=0
A callback function used to set index of current page.
XFAWidget GetNextWidget(const XFAWidget &widget)
Get the next XFA widget of a specified XFA widget in current tab order.
Message box button ID: No.
Definition: fs_xfa.h:427
TextEncoding
Enumeration for text encoding for XFA submit.
Definition: fs_xfa.h:628
bool Bold()
(Only useful for rich text) Make the rich text bold.
String ID for case: Not allow to modify field. Sample message: "You are not allowed to modify this fi...
Definition: fs_xfa.h:172
Definition: fs_xfa.h:2046
Definition: fs_xfa.h:900
String ID for case: Use string in local language for "Wednesday".
Definition: fs_xfa.h:324
bool operator !=(const XFADoc &other) const
Not equal operator.
uint32 ARGB
ARGB color type, 32 bits, ((b) | ((g) << 8) | ((r) << 16)) | ((a) << 24)
Definition: fs_basictypes.h:210
Sample message: "'%s' operator cannot support array calculation".
Definition: fs_xfa.h:286
Beep type: error.
Definition: fs_xfa.h:148
String ID for case: Use string in local language for "Friday".
Definition: fs_xfa.h:328
Sample message: "Invalid node type: '%s'".
Definition: fs_xfa.h:312
Sample message: "Error:Invalid enumerated value:%s".
Definition: fs_xfa.h:372
bool IsSupportMultiSelect()
Check whether the widget supports multiple selections.
Sample message: "Expected operator '%s' instead of '%s'".
Definition: fs_xfa.h:256
Application information: name.
Definition: fs_xfa.h:136
virtual WString LoadString(StringID string_id)=0
A callback function used to load a string in local language for a specified case.
File stream interface, reading & writing.
Definition: fx_stream.h:692
virtual bool PutRequestURL(const wchar_t *url, const wchar_t *data, const wchar_t *encode)=0
A callback function used to put data to the given URL.
Sample message: "%s cannot be left blank. To ignore validations for %s, click Ignore....
Definition: fs_xfa.h:360
Sample message: "Validate access index '%s' out of array".
Definition: fs_xfa.h:276
WidgetChoiceOption(const WidgetChoiceOption &option)
Constructor, with another choice option object.
Definition: fs_xfa.h:73
If set, print page as image; otherwise, as text.
Definition: fs_xfa.h:598
Beep type: default.
Definition: fs_xfa.h:156
int GetIndex() const
Get index of the XFA page.
bool OnMouseEnter()
Call this function when mouse enters current XFA widget.
void FlattenTo(const char *output_file_path)
Flatten current XFA document to a file.
If set, shrink page to fit within content area.
Definition: fs_xfa.h:596
void ResetData()
Reset XFA Widget Data.
Text encoding: GBK.
Definition: fs_xfa.h:636
Application information: version.
Definition: fs_xfa.h:128
String GetXMLContent()
Get the xml content of current XFA widget.
bool Undo()
Undo the operation of related XFA widget. (No effect for rich text)
Definition: fx_basic.h:3758
Sample message: "Invalidate character '%c'".
Definition: fs_xfa.h:228
Type of exported data: XDP.
Definition: fs_xfa.h:944
Egde position: right.
Definition: fs_xfa.h:1556
virtual ARGB GetHighlightColor(const XFADoc &doc)=0
A callback function get the highlight color.
WidgetHAlignType GetHAlign()
Get text horizontal alignment.
Sample message: "Function 's' is built-in.
Definition: fs_xfa.h:294
WString GetValue()
Get the value string.
String ID for case: Use string in local language for "Saturday".
Definition: fs_xfa.h:330
virtual bool SubmitData(const XFADoc &doc, const WString &target, SubmitFormat format, TextEncoding text_encoding, const WString &content)=0
A callback function to submit data.
Center the text horizontally within the available region.
Definition: fs_xfa.h:1520
bool OnKeyUp(uint32 key_code, uint32 flags)
Call this function when key on the keyboard is up.
Sample message: "Cannot modify the '%s' value".
Definition: fs_xfa.h:242
Sample message: "%s.%s cannot covert to object".
Definition: fs_xfa.h:260
String ID for case: Use string in local language for "Sunday".
Definition: fs_xfa.h:318
Beep type: question.
Definition: fs_xfa.h:152
Definition: fs_common.h:373
String ID for case: Server denies. Sample message: "Server does not permit".
Definition: fs_xfa.h:316
foxit::pdf::Signature GetSignature()
Get the signature object from current XFA widget.
XFA document type: Dynamic.
Definition: fs_xfa.h:926
String ID for case: Use string in local language for "May".
Definition: fs_xfa.h:340
Sample message: "Illegal break".
Definition: fs_xfa.h:252
Type of exported data: XML.
Definition: fs_xfa.h:940
virtual void Print(const XFADoc &doc, int start_page_index, int end_page_index, uint32 options)=0
A callback function used to print.
XFA widget type: push button.
Definition: fs_xfa.h:1447
Message box button: OK and Cancel.
Definition: fs_xfa.h:409
Message box button: Yes and No.
Definition: fs_xfa.h:411
virtual void PageViewEvent(int page_index, PageViewEventType page_view_event_type)=0
A callback function to execute page view event.
Sample message: "Unsupported property %s.".
Definition: fs_xfa.h:191
Presence property: Unknown.
Definition: fs_xfa.h:1488
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:196
XFAWidget GetWidgetByFullName(const WString &full_name)
Get the XFA widget which matches the specified full name.
Type
Enumeration for XFA document type.
Definition: fs_xfa.h:924
Sample message: "Invalidate instruction".
Definition: fs_xfa.h:272
Sample message: "The element [%s] has violated its allowable number of occurrences".
Definition: fs_xfa.h:214
bool CanDeSelect()
Check if the selection of the text in related XFA widget can be canceled.
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:214
bool CanPaste()
Check if the text of related XFA widget can be pasted.
Sample message: "Invalid enumerated value: %s".
Definition: fs_xfa.h:304
bool Paste(const wchar_t *text)
Paste the text to related XFA widget.
XFA widget type: check button.
Definition: fs_xfa.h:1449
Header file for common definitions and classes.
Align the text to the top of the available region.
Definition: fs_xfa.h:1540
MsgBoxButtonType
Enumeration for button type of XFA message box.
Definition: fs_xfa.h:405
Presence property: Invisible. Participate in interaction and layout but not rendering.
Definition: fs_xfa.h:1496
WidgetType GetType()
Get type of XFA widget.
virtual void SetChangeMark(const XFADoc &doc)=0
A callback function used to set change mark flag to current XFA document.
String ID for case: Use string in local language for "January".
Definition: fs_xfa.h:332
bool operator !=(const XFAWidget &other) const
Not equal operator.
Sample message: "Expected identifier instead of '%s'".
Definition: fs_xfa.h:224
Sample message: "Cannot find const '%s'".
Definition: fs_xfa.h:268
Type of exported data: Static XDP.
Definition: fs_xfa.h:942
BeepType
Enumeration for XFA beep type.
Definition: fs_xfa.h:146
WString GetDefaultValue()
Get the default value string.
XFA document type: Static.
Definition: fs_xfa.h:928
If set, show printing dialog box.
Definition: fs_xfa.h:592
Sample message: "Invalid Barcode Value: %s is an invalid value for barcodes of type %s....
Definition: fs_xfa.h:379
bool operator !=(const XFAPage &other) const
Not equal operator.
Sample message: "Invalid append operation: %s cannot have a child element of %s".
Definition: fs_xfa.h:306
Sample message: "Unable to set the value for property 'className'".
Definition: fs_xfa.h:216
Hit test area: Client.
Definition: fs_xfa.h:1431
XFADoc & operator=(const XFADoc &other)
Assign operator.
Application information: type.
Definition: fs_xfa.h:138
XFAPage GetPage(int page_index)
Get XFA page by index.
virtual MsgBoxButtonID MsgBox(const wchar_t *message, const wchar_t *title, MsgBoxIconType icon_type, MsgBoxButtonType button_type)=0
A callback function used to set message box.
Text encoding: font specific.
Definition: fs_xfa.h:634
Text encoding: Big5.
Definition: fs_xfa.h:632
String ID for case: Use string in local language for "August".
Definition: fs_xfa.h:346
If set, print annotations.
Definition: fs_xfa.h:602
XFAWidget GetWidget(int widget_index) const
Get XFA widget by index.
virtual bool GetPopupPos(int page_index, float min_popup, float max_popup, const RectF &rect_widget, RectF &inout_rect_popup)=0
A callback function used to get the pop-up position.
Definition: fs_basictypes.h:449
int GetWidgetCount() const
Get the count of XFA widget.
Sample message: "Expected '%s' instead of '%s'".
Definition: fs_xfa.h:226
Sample message: "Unable to set the value for property 'version'".
Definition: fs_xfa.h:210
virtual void WidgetEvent(const XFAWidget &xfa_widget, WidgetEventType widget_event_type)=0
A callback function to execute XFA widget event.
bool selected
Used to indicate whether the option is selected or not.
Definition: fs_xfa.h:108
bool OnRButtonUp(const PointF &point, uint32 flags)
Call this function when right button is up.
bool DeSelect()
Cancel the selection of the text in related XFA widget.
bool operator==(const XFAPage &other) const
Equal operator.
XFA widget type: Exclusion Group for radio button only.
Definition: fs_xfa.h:1475
Sample message: "Compiler error".
Definition: fs_xfa.h:240
Sample message: "Value!".
Definition: fs_xfa.h:185
Sample message: "Invalidate expression '%s'".
Definition: fs_xfa.h:234
Message box button: OK.
Definition: fs_xfa.h:407
bool ValidateValue(const wchar_t *value, WString &format)
Validate whether the value conforms to the format of current XFA widget.
Sample message: "Cannot find method '%s'".
Definition: fs_xfa.h:266
String ID for case: Use string in local language for "April".
Definition: fs_xfa.h:338
virtual WStringArray ShowFileDialog(const wchar_t *string_title, const wchar_t *string_filter, bool is_openfile_dialog)=0
A callback function used to show file dialog.
Invalidate current page.
Definition: fs_xfa.h:582
Left-align the last line and spread-justify the rest.
Definition: fs_xfa.h:1522
Sample message: "Calculate Override".
Definition: fs_xfa.h:168
HitTestArea
Enumeration for hit test area of XFA widget.
Definition: fs_xfa.h:1427
Sample message: "Divide by zero".
Definition: fs_xfa.h:258
Sample message: "Message limit exceeded. Remaining %d validation errors not reported....
Definition: fs_xfa.h:358
String ID for case: Use string in local language for "March".
Definition: fs_xfa.h:336
WidgetChoiceOption & operator=(const WidgetChoiceOption &option)
Assign operator.
Definition: fs_xfa.h:84
XFADoc(const pdf::PDFDoc &document, DocProviderCallback *xfa_doc_provider_handler)
Constructor.
String ID for case: Some setting operation to property is invalid. Sample message: "Invalid property ...
Definition: fs_xfa.h:196
WidgetEdgePosition
Enumeration for the positon of XFA widget edge position.
Definition: fs_xfa.h:1552
Text encoding: UCS-2.
Definition: fs_xfa.h:648
String ID for case: Use string in local language for "June".
Definition: fs_xfa.h:342
Rotation
Enumeration for rotation.
Definition: fs_common.h:57
If set, that means printing process can be canceled.
Definition: fs_xfa.h:594
Foxit namespace.
Definition: fs_pdf3d.h:27
Text encoding: KSC5601.
Definition: fs_xfa.h:644
Sample message: "Invalidate left-value '%s'".
Definition: fs_xfa.h:238
virtual common::file::ReaderCallback * DownLoadUrl(const wchar_t *url)=0
A callback function used to download from specified URL.
virtual void GotoURL(const XFADoc &doc, const WString &url)=0
A callback function used to go to a specified URL.
String ID for case: Filter for image files. Sample message: "Image Files(*.bmp;*.jpg;*....
Definition: fs_xfa.h:179
RectF GetRect()
Get rectangle of XFA widget.
virtual WString GetAppInfo(AppInfo app_info)=0
A callback function used to get application information for a specified information type.
WString Cut()
Cut the text of related XFA widget.
Event type: all page views are removed.
Definition: fs_xfa.h:666
BYTE STRING CLASS.
Definition: fx_string.h:317
virtual WString PostRequestURL(const wchar_t *url, const wchar_t *data, const wchar_t *content_type, const wchar_t *encode, const wchar_t *header)=0
A callback function used to post data to the given URL.
Event type: Unknown.
Definition: fs_xfa.h:909
Application information: language.
Definition: fs_xfa.h:130
bool Superscript()
(Only useful for rich text) Make the rich text as superscript.
bool CanUndo()
Check if the operation of related XFA widget can be undone.
MsgBoxButtonID
Enumeration for button ID of XFA message box.
Definition: fs_xfa.h:421
Application information: platform.
Definition: fs_xfa.h:132
Application information: variation.
Definition: fs_xfa.h:134
Sample message: "'%s' function's %d argument cannot be array".
Definition: fs_xfa.h:288
ExportDataType
Enumeration for the type of exported data.
Definition: fs_xfa.h:938
String ID for case: Use string in local language for "February".
Definition: fs_xfa.h:334
Align the text to the bottom of the available region.
Definition: fs_xfa.h:1542
Egde position: left.
Definition: fs_xfa.h:1560
bool IsListBox()
Check whether the widget is listbox or not.
Spread-justify all lines to fill the available region.
Definition: fs_xfa.h:1524
Sample message: "%s cannot be left blank.".
Definition: fs_xfa.h:362
Sample message: "Expected number instead of '%s'".
Definition: fs_xfa.h:274
Sample message: "Undefined identifier '%s'".
Definition: fs_xfa.h:236
Sample message: "%s : %s".
Definition: fs_xfa.h:296
#define NULL
The null-pointer value.
Definition: fx_system.h:792
Definition: fs_signature.h:99
Hit test area: HyperLink.
Definition: fs_xfa.h:1435
bool ClearStyle()
(Only useful for rich text) Clear the style of the rich text.
Definition: fx_coordinates.h:1076
bool operator==(const XFADoc &other) const
Equal operator.
Event type: before an XFA widget is removed.
Definition: fs_xfa.h:678
XFA widget type: radio button.
Definition: fs_xfa.h:1467
Sample message: "At least one required field was empty. Please fill in the required fields(highlighte...
Definition: fs_xfa.h:377
WidgetChoiceOption(const wchar_t *option_label, bool selected)
Constructor, with parameters.
Definition: fs_xfa.h:64
Sample message: "Cannot find container '%s'".
Definition: fs_xfa.h:262
bool CanRedo()
Check if the operation of related XFA widget can be redone.
void KillFocus()
Kill the focus of XFA widget.
Sample message: "Cannot directly assign the value to object".
Definition: fs_xfa.h:270
Text encoding: ShiftJIS.
Definition: fs_xfa.h:646
bool IsEmpty() const
Check whether current object is empty or not.
Sample message: "Cannot assign to '%s'".
Definition: fs_xfa.h:278
Sample message: "Function '%s' does not have %d parameters".
Definition: fs_xfa.h:244
Sample message: "'%s' doesn't have property '%s'".
Definition: fs_xfa.h:310
Message box icon: Warning.
Definition: fs_xfa.h:393
Beep type: status.
Definition: fs_xfa.h:154
Name type: caption name. Name in this type will be retrieved from caption entry.
Definition: fs_xfa.h:1508
Text encoding: ISO8859NN.
Definition: fs_xfa.h:642
void ProcessEvent(EventType event_type)
Process a kind of event for all the XFA widgets in current XFA document.
void SetDefaultValue(const wchar_t *value)
Set the default value string.
void SetFocus(XFAWidget xfa_widget)
Set the focus of XFA widget.
bool IsChecked() const
Check if current XFA widget is checked.
Sample message: "Illegal value:cannot assign '%s' to %s.".
Definition: fs_xfa.h:368
bool operator==(const WidgetMenu &other) const
Equal operator.
Sample message: "Unable to set".
Definition: fs_xfa.h:183
Definition: fs_image.h:460
virtual void Release()=0
A callback function used to release current callback object itself.
String ID for case: Use string in local language for "Today".
Definition: fs_xfa.h:356
Sample message: "Unexpected expression '%s'".
Definition: fs_xfa.h:248
Sample message: "Incorrect number of parameters are used when calling method '%s'".
Definition: fs_xfa.h:300
float GetWidth() const
Get the width.
bool IsEmpty() const
Check whether current object is empty or not.
The submit data is packaged in XDP format, as described in XDP Specification.
Definition: fs_xfa.h:612
XFA widget type: image.
Definition: fs_xfa.h:1477
bool IsAllowRichText()
Check whether the widget allows rich text formatting.
XFAWidget GetLastWidget()
Get the last XFA widget in current tab order.
String ID for case: Some enumerate value is invalid. Sample message: "Invalid enumerate value:".
Definition: fs_xfa.h:187
Type GetType() const
Get the XFA document type.
SubmitFormat
Enumeration for XFA submit format.
Definition: fs_xfa.h:610
virtual bool PopupMenu(int page_index, const PointF &rect_popup)=0
A callback function used to pop up the context menu.
Definition: fx_coordinates.h:771
XFAWidget GetFirstWidget()
Get the first XFA widget in current tab order.
Hit test area: Unknown.
Definition: fs_xfa.h:1429
XFA document type: XDP, as Raw XML data.
Definition: fs_xfa.h:930
XFA widget type: choice list.
Definition: fs_xfa.h:1459
Event type: after a page view is added.
Definition: fs_xfa.h:662
Text encoding: UTF-8.
Definition: fs_xfa.h:652