Foxit PDF SDK

fs_taggedpdf.h
Go to the documentation of this file.
1
15 #ifndef FS_TAGGEDPDF_H_
16 #define FS_TAGGEDPDF_H_
17
18 #include "common/fs_common.h"
19 #include "pdf/fs_pdfdoc.h"
20 #include "pdf/fs_pdfpage.h"
21
27 namespace foxit {
31 namespace addon {
35 namespace accessibility {
41 class TaggedPDFCallback {
42 public:
48 typedef enum _ReportCategory {
50 e_ReportCategoryRegion = 0,
52 e_ReportCategoryArtifact = 1,
54 e_ReportCategoryParagraph = 2,
56 e_ReportCategoryListItem = 3,
58 e_ReportCategoryFigure = 4,
60 e_ReportCategoryTable = 5,
62 e_ReportCategoryTableRow = 6,
64 e_ReportCategoryTableHeader = 7,
66 e_ReportCategoryTocItem = 8
67 } ReportCategory;
68
74 typedef enum _ReportConfidence {
76 e_ReportConfidenceHigh = 0,
78 e_ReportConfidenceMediumHigh = 1,
80 e_ReportConfidenceMedium = 2,
82 e_ReportConfidenceMediumLow = 3,
84 e_ReportConfidenceLow = 4
85 } ReportConfidence;
86
87
93 virtual void Release() = 0;
94
111 virtual void Report(ReportCategory category, ReportConfidence confidence, int page_index, const RectF& rect) = 0;
112
113 protected:
114 ~TaggedPDFCallback() {}
115 };
116
124 class TaggedPDF FS_FINAL : public Base {
125 public:
133 TaggedPDF(const foxit::pdf::PDFDoc& doc);
134
135 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
136 explicit TaggedPDF(FS_HANDLE handle);
137
139 ~TaggedPDF();
140
146 TaggedPDF(const TaggedPDF& other);
147
155 TaggedPDF& operator=(const TaggedPDF& other);
156
164 bool operator==(const TaggedPDF& other) const;
165
173 bool operator!=(const TaggedPDF& other) const;
174
182 bool IsEmpty() const;
183
197 void SetCallback(TaggedPDFCallback* callback);
198
215 common::Progressive StartTagDocument(common::PauseCallback* pause = NULL);
216
226 int GetFigureCount();
227
240 bool SetAsDecorativeFigure(int figure_index);
241
258 void SetFigureAlternateText(int figure_index, const wchar_t* alternate_text);
259
274 WString GetFigureAlternateText(int figure_index);
275
288 RectF GetFigureRect(int figure_index);
289
302 int GetFigurePageIndex(int figure_index);
303
304 };
305
306 }
307 }
308 }
309 #endif
foxit::addon::accessibility::TaggedPDF::GetFigureRect
RectF GetFigureRect(int figure_index)
Get the rectangle of figure.
foxit::addon::accessibility::TaggedPDF::SetFigureAlternateText
void SetFigureAlternateText(int figure_index, const wchar_t *alternate_text)
Set figure alternate text.
foxit::addon::accessibility::TaggedPDFCallback
Definition: fs_taggedpdf.h:41
foxit::addon::accessibility::TaggedPDF
Definition: fs_taggedpdf.h:124
foxit::addon::accessibility::TaggedPDFCallback::Release
virtual void Release()=0
A callback function used to release current callback object itself.
fs_pdfdoc.h
Header file for PDF document related definitions and classes.
foxit::addon::accessibility::TaggedPDF::SetAsDecorativeFigure
bool SetAsDecorativeFigure(int figure_index)
Decorate the figure.The decorative figure can not set alternate text.
foxit::addon::accessibility::TaggedPDF::GetFigureCount
int GetFigureCount()
Get the count of figures in tagged document, excluding the decorative figures.
foxit::addon::accessibility::TaggedPDF::TaggedPDF
TaggedPDF(const foxit::pdf::PDFDoc &doc)
Constructor.
CFX_WideString
WIDE STRING CLASS.
Definition: fx_string.h:1461
foxit::pdf::PDFDoc
Definition: fs_pdfdoc.h:776
foxit::addon::accessibility::TaggedPDF::~TaggedPDF
~TaggedPDF()
Destructor.
foxit::addon::accessibility::TaggedPDFCallback::e_ReportConfidenceMedium
Report confidence: medium.
Definition: fs_taggedpdf.h:80
foxit::addon::accessibility::TaggedPDFCallback::e_ReportConfidenceMediumLow
Report confidence: medium low.
Definition: fs_taggedpdf.h:82
foxit::addon::accessibility::TaggedPDFCallback::e_ReportCategoryParagraph
Report category type: paragraph.
Definition: fs_taggedpdf.h:54
foxit::addon::accessibility::TaggedPDF::operator=
TaggedPDF & operator=(const TaggedPDF &other)
Assign operator.
foxit::addon::accessibility::TaggedPDFCallback::e_ReportCategoryRegion
Report category type: region.
Definition: fs_taggedpdf.h:50
foxit::addon::accessibility::TaggedPDFCallback::e_ReportCategoryTocItem
Report category type: toc item.
Definition: fs_taggedpdf.h:66
foxit::addon::accessibility::TaggedPDF::GetFigureAlternateText
WString GetFigureAlternateText(int figure_index)
Get the alternate text of the figure.
foxit::addon::accessibility::TaggedPDFCallback::Report
virtual void Report(ReportCategory category, ReportConfidence confidence, int page_index, const RectF &rect)=0
A callback function used to get the tagged PDF document result information, triggered when the docume...
IFX_Pause
Definition: fx_basic.h:3758
foxit::addon::accessibility::TaggedPDFCallback::e_ReportCategoryArtifact
Report category type: artifact.
Definition: fs_taggedpdf.h:52
foxit::addon::accessibility::TaggedPDF::StartTagDocument
common::Progressive StartTagDocument(common::PauseCallback *pause=0)
Start to auto tag the given PDF document with specified tagged settings.
foxit::common::Progressive
Definition: fs_common.h:373
foxit::addon::accessibility::TaggedPDF::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::FS_HANDLE
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
fs_common.h
Header file for common definitions and classes.
foxit::addon::accessibility::TaggedPDFCallback::e_ReportCategoryListItem
Report category type: list item.
Definition: fs_taggedpdf.h:56
foxit::addon::accessibility::TaggedPDFCallback::e_ReportConfidenceLow
Report confidence: low.
Definition: fs_taggedpdf.h:84
foxit::addon::accessibility::TaggedPDFCallback::ReportConfidence
ReportConfidence
Enumeration for report confidence used for tag PDF document.
Definition: fs_taggedpdf.h:74
foxit::Base
Definition: fs_basictypes.h:451
foxit::addon::accessibility::TaggedPDF::operator==
bool operator==(const TaggedPDF &other) const
Equal operator.
fs_pdfpage.h
Header file for PDF page related definitions and classes.
foxit::addon::accessibility::TaggedPDFCallback::e_ReportConfidenceMediumHigh
Report confidence: medium high.
Definition: fs_taggedpdf.h:78
foxit
Foxit namespace.
Definition: fs_pdf3d.h:26
foxit::addon::accessibility::TaggedPDFCallback::e_ReportCategoryTableRow
Report category type: table row.
Definition: fs_taggedpdf.h:62
foxit::addon::accessibility::TaggedPDFCallback::e_ReportCategoryTable
Report category type: table.
Definition: fs_taggedpdf.h:60
foxit::addon::accessibility::TaggedPDFCallback::e_ReportCategoryTableHeader
Report category type: table header.
Definition: fs_taggedpdf.h:64
NULL
#define NULL
The null-pointer value.
Definition: fx_system.h:792
foxit::addon::accessibility::TaggedPDFCallback::e_ReportCategoryFigure
Report category type: figure.
Definition: fs_taggedpdf.h:58
foxit::addon::accessibility::TaggedPDFCallback::e_ReportConfidenceHigh
Report confidence: high.
Definition: fs_taggedpdf.h:76
foxit::addon::accessibility::TaggedPDF::GetFigurePageIndex
int GetFigurePageIndex(int figure_index)
Get the figure page index by the figure index.
foxit::addon::accessibility::TaggedPDF::SetCallback
void SetCallback(TaggedPDFCallback *callback)
Set a callback object for tagged PDF.
foxit::addon::accessibility::TaggedPDFCallback::ReportCategory
ReportCategory
Enumeration for report category type used for tagged PDF.
Definition: fs_taggedpdf.h:48
CFX_FloatRect
Definition: fx_coordinates.h:771
foxit::addon::accessibility::TaggedPDF::operator!=
bool operator!=(const TaggedPDF &other) const
Not equal operator.