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:
39 
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 
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 
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 
101 
106 
111 
116 
121 };
122 
124 class TextSearchCharInfo FS_FINAL : public Base {
125  public:
128 
135 
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_
TextSearch & operator=(const TextSearch &other)
赋值操作符。
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
int char_info_size
字符信息数量。
Definition: fs_ofdtextsearch.h:120
TextSearchResultInfo & operator=(const TextSearchResultInfo &other)
赋值操作符。
Definition: fs_ofdtextsearch.h:61
bool IsEmpty() const
检查当前对象是否为空。
int rect_size
矩形数量。
Definition: fs_ofdtextsearch.h:110
Definition: fs_ofdtextsearch.h:176
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
Definition: fx_coordinates.h:30
bool IsEmpty() const
检查当前对象是否为空。
Definition: fs_ofdtextsearch.h:20
bool operator==(const TextSearch &other) const
相等操作符。
foxit::PointF GetResultCenter(int index)
获取指定索引的搜索结果中心点。
TextSearchCharInfo(const TextSearchCharInfo &other)
构造函数,通过另一个文本搜索字符信息对象。
TextSearch(OFDPackage package, const String &keyword)
带参数的构造函数。
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
TextSearchResultInfo(const TextSearchResultInfo &other)
构造函数,通过另一个文本搜索结果信息对象。
Definition: fs_ofdtextsearch.h:45
bool operator==(const TextSearchCharInfo &other) const
相等操作符。
int char_info_pos
字符信息起始位置。
Definition: fs_ofdtextsearch.h:115
Definition: fs_ofdpackage.h:26
bool operator !=(const TextSearch &other) const
不相等操作符。
FX_UINT32 uint32
无符号 32 位整数。
Definition: fs_basictypes.h:195
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
通用定义和类的头文件。
Definition: fx_coordinates.h:596
int page_index
页面索引。
Definition: fs_ofdtextsearch.h:105
int GetResultCountInPage(int page_index)
获取指定页面索引的搜索结果数量。
Definition: fs_basictypes.h:465
int doc_index
文档索引。
Definition: fs_ofdtextsearch.h:95
TextSearchResultInfo GetResult(int index)
获取指定索引的搜索结果信息。
Foxit命名空间。
Definition: fs_taggedpdf.h:27
~TextSearch()
析构函数。
字节字符串类
Definition: fx_string.h:317
foxit::uint32 page_id
页面ID。
Definition: fs_ofdtextsearch.h:100
Definition: fs_ofdpage.h:27
FX_RECT GetResultRect(int index, int rect_index)
获取指定索引的搜索结果矩形框。
TextSearchCharInfo & operator=(const TextSearchCharInfo &other)
赋值操作符。
TextSearchCharInfo GetResultCharInfo(int index, int char_info_index)
获取指定索引的搜索结果字符信息。
Definition: fs_ofdtextsearch.h:124
int GetResultCount()
获取搜索结果数量。
foxit::PointF GetResultCenterInPage(int page_index, int index)
获取指定页面索引的搜索结果中心点。
bool operator !=(const TextSearchCharInfo &other) const
不相等操作符。