Foxit PDF SDK

fs_ofdtextsearch.h
1 #ifndef FS_OFD_TEXTSEARCH_H_
2 #define FS_OFD_TEXTSEARCH_H_
3
4 #include "common/fs_common.h"
5
11 namespace foxit {
15 namespace ofd {
16 class OFDPackage;
17 class OFDPage;
18
20 class TextSearchResultInfo FS_FINAL : public Object {
21 public:
32 explicit TextSearchResultInfo(int doc_index, foxit::uint32 page_id, int page_index, int rect_size, int char_info_pos, int char_info_size) :
33 doc_index(doc_index),
34 page_id(page_id),
35 page_index(page_index),
36 rect_size(rect_size),
37 char_info_pos(char_info_pos),
38 char_info_size(char_info_size) {}
39
45 TextSearchResultInfo(const TextSearchResultInfo& other) {
46 this->doc_index = other.doc_index;
47 this->page_id = other.page_id;
48 this->page_index = other.page_index;
49 this->rect_size = other.rect_size;
50 this->char_info_pos = other.char_info_pos;
51 this->char_info_size = other.char_info_size;
52 }
53
61 TextSearchResultInfo& operator = (const TextSearchResultInfo& other) {
62 this->doc_index = other.doc_index;
63 this->page_id = other.page_id;
64 this->page_index = other.page_index;
65 this->rect_size = other.rect_size;
66 this->char_info_pos = other.char_info_pos;
67 this->char_info_size = other.char_info_size;
68 return *this;
69 }
70
83 void Set(int doc_index, foxit::uint32 page_id, int page_index, int rect_size, int char_info_pos, int char_info_size) {
84 this->doc_index = doc_index;
85 this->page_id = page_id;
86 this->page_index = page_index;
87 this->rect_size = rect_size;
88 this->char_info_pos = char_info_pos;
89 this->char_info_size = char_info_size;
90 }
91
95 int doc_index;
96
100 foxit::uint32 page_id;
101
105 int page_index;
106
110 int rect_size;
111
115 int char_info_pos;
116
120 int char_info_size;
121 };
122
124 class TextSearchCharInfo FS_FINAL : public Base {
125 public:
127 ~TextSearchCharInfo();
128
134 TextSearchCharInfo(const TextSearchCharInfo& other);
135
143 TextSearchCharInfo& operator = (const TextSearchCharInfo& other);
144
152 bool operator == (const TextSearchCharInfo& other) const;
153
161 bool operator != (const TextSearchCharInfo& other) const;
162
170 bool IsEmpty() const;
171
172 explicit TextSearchCharInfo(FS_HANDLE handle);
173 };
174
176 class TextSearch FS_FINAL : public Base {
177 public:
184 explicit TextSearch(OFDPackage package, const String& keyword);
185
192 explicit TextSearch(OFDPage page, const String& keyword);
193
195 ~TextSearch();
196
202 TextSearch(const TextSearch& other);
203
211 TextSearch& operator = (const TextSearch& other);
212
220 bool operator == (const TextSearch& other) const;
221
229 bool operator != (const TextSearch& other) const;
230
238 bool IsEmpty() const;
239
245 int GetResultCount();
246
255 TextSearchResultInfo GetResult(int index);
256
267 FX_RECT GetResultRect(int index, int rect_index);
268
279 TextSearchCharInfo GetResultCharInfo(int index, int char_info_index);
280
289 foxit::PointF GetResultCenter(int index);
290
298 int GetResultCountInPage(int page_index);
299
309 foxit::PointF GetResultCenterInPage(int page_index, int index);
310
311 explicit TextSearch(FS_HANDLE handle);
312 };
313
314 } // namespace ofd
315 } // namespace foxit
316
317 #endif // FS_OFD_TEXTSEARCH_H_
foxit::ofd::TextSearch::operator=
TextSearch & operator=(const TextSearch &other)
赋值操作符。
foxit::Object
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
foxit::ofd::TextSearchResultInfo::char_info_size
int char_info_size
字符信息数量。
Definition: fs_ofdtextsearch.h:120
foxit::ofd::TextSearchResultInfo::operator=
TextSearchResultInfo & operator=(const TextSearchResultInfo &other)
赋值操作符。
Definition: fs_ofdtextsearch.h:61
foxit::ofd::TextSearchCharInfo::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::ofd::TextSearchResultInfo::rect_size
int rect_size
矩形数量。
Definition: fs_ofdtextsearch.h:110
foxit::ofd::TextSearch
Definition: fs_ofdtextsearch.h:176
foxit::ofd::TextSearchResultInfo::Set
void Set(int doc_index, foxit::uint32 page_id, int page_index, int rect_size, int char_info_pos, int char_info_size)
设置值。
Definition: fs_ofdtextsearch.h:83
CFX_PSVTemplate
Definition: fx_coordinates.h:30
foxit::ofd::TextSearch::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::ofd::TextSearchResultInfo
Definition: fs_ofdtextsearch.h:20
foxit::ofd::TextSearch::operator==
bool operator==(const TextSearch &other) const
相等操作符。
foxit::ofd::TextSearchCharInfo::~TextSearchCharInfo
~TextSearchCharInfo()
foxit::ofd::TextSearch::GetResultCenter
foxit::PointF GetResultCenter(int index)
获取指定索引的搜索结果中心点。
foxit::ofd::TextSearchCharInfo::TextSearchCharInfo
TextSearchCharInfo(const TextSearchCharInfo &other)
构造函数，通过另一个文本搜索字符信息对象。
foxit::ofd::TextSearch::TextSearch
TextSearch(OFDPackage package, const String &keyword)
带参数的构造函数。
foxit::ofd::TextSearchResultInfo::TextSearchResultInfo
TextSearchResultInfo(int doc_index, foxit::uint32 page_id, int page_index, int rect_size, int char_info_pos, int char_info_size)
带参数的构造函数。
Definition: fs_ofdtextsearch.h:32
foxit::ofd::TextSearchResultInfo::TextSearchResultInfo
TextSearchResultInfo(const TextSearchResultInfo &other)
构造函数，通过另一个文本搜索结果信息对象。
Definition: fs_ofdtextsearch.h:45
foxit::ofd::TextSearchCharInfo::operator==
bool operator==(const TextSearchCharInfo &other) const
相等操作符。
foxit::ofd::TextSearchResultInfo::char_info_pos
int char_info_pos
字符信息起始位置。
Definition: fs_ofdtextsearch.h:115
foxit::ofd::OFDPackage
Definition: fs_ofdpackage.h:26
foxit::ofd::TextSearch::operator !=
bool operator !=(const TextSearch &other) const
不相等操作符。
foxit::uint32
FX_UINT32 uint32
无符号 32 位整数。
Definition: fs_basictypes.h:195
foxit::FS_HANDLE
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
fs_common.h
通用定义和类的头文件。
FX_RECT
Definition: fx_coordinates.h:596
foxit::ofd::TextSearchResultInfo::page_index
int page_index
页面索引。
Definition: fs_ofdtextsearch.h:105
foxit::ofd::TextSearch::GetResultCountInPage
int GetResultCountInPage(int page_index)
获取指定页面索引的搜索结果数量。
foxit::Base
Definition: fs_basictypes.h:465
foxit::ofd::TextSearchResultInfo::doc_index
int doc_index
文档索引。
Definition: fs_ofdtextsearch.h:95
foxit::ofd::TextSearch::GetResult
TextSearchResultInfo GetResult(int index)
获取指定索引的搜索结果信息。
foxit
Foxit命名空间。
Definition: fs_taggedpdf.h:27
foxit::ofd::TextSearch::~TextSearch
~TextSearch()
析构函数。
CFX_ByteString
字节字符串类
Definition: fx_string.h:317
foxit::ofd::TextSearchResultInfo::page_id
foxit::uint32 page_id
页面ID。
Definition: fs_ofdtextsearch.h:100
foxit::ofd::OFDPage
Definition: fs_ofdpage.h:27
foxit::ofd::TextSearch::GetResultRect
FX_RECT GetResultRect(int index, int rect_index)
获取指定索引的搜索结果矩形框。
foxit::ofd::TextSearchCharInfo::operator=
TextSearchCharInfo & operator=(const TextSearchCharInfo &other)
赋值操作符。
foxit::ofd::TextSearch::GetResultCharInfo
TextSearchCharInfo GetResultCharInfo(int index, int char_info_index)
获取指定索引的搜索结果字符信息。
foxit::ofd::TextSearchCharInfo
Definition: fs_ofdtextsearch.h:124
foxit::ofd::TextSearch::GetResultCount
int GetResultCount()
获取搜索结果数量。
foxit::ofd::TextSearch::GetResultCenterInPage
foxit::PointF GetResultCenterInPage(int page_index, int index)
获取指定页面索引的搜索结果中心点。
foxit::ofd::TextSearchCharInfo::operator !=
bool operator !=(const TextSearchCharInfo &other) const
不相等操作符。