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 
127 class TextSearchCharInfo FS_FINAL : public Base {
128  public:
131 
138 
147 
155  bool operator == (const TextSearchCharInfo& other) const;
156 
164  bool operator != (const TextSearchCharInfo& other) const;
165 
173  bool IsEmpty() const;
174 
175  explicit TextSearchCharInfo(FS_HANDLE handle);
176 };
177 
179 class TextSearch FS_FINAL : public Base {
180  public:
187  explicit TextSearch(OFDPackage package, const String& keyword);
188 
195  explicit TextSearch(OFDPage page, const String& keyword);
196 
198  ~TextSearch();
199 
205  TextSearch(const TextSearch& other);
206 
214  TextSearch& operator = (const TextSearch& other);
215 
223  bool operator == (const TextSearch& other) const;
224 
232  bool operator != (const TextSearch& other) const;
233 
241  bool IsEmpty() const;
242 
248  int GetResultCount();
249 
258  TextSearchResultInfo GetResult(int index);
259 
270  FX_RECT GetResultRect(int index, int rect_index);
271 
282  TextSearchCharInfo GetResultCharInfo(int index, int char_info_index);
283 
292  foxit::PointF GetResultCenter(int index);
293 
301  int GetResultCountInPage(int page_index);
302 
312  foxit::PointF GetResultCenterInPage(int page_index, int index);
313 
314  explicit TextSearch(FS_HANDLE handle);
315 };
316 
317 } // namespace ofd
318 } // namespace foxit
319 
320 #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:179
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:471
int doc_index
文档索引。
Definition: fs_ofdtextsearch.h:95
TextSearchResultInfo GetResult(int index)
获取指定索引的搜索结果信息。
Foxit命名空间。
Definition: fs_pdf3d.h:26
~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)
获取指定索引的搜索结果字符信息。
此类表示OFD文本搜索字符信息。当前这个数据类没有实际的参数, 仅在 OFDPage::ReplaceCharacterBySearch 中作为参数使用。
Definition: fs_ofdtextsearch.h:127
int GetResultCount()
获取搜索结果数量。
foxit::PointF GetResultCenterInPage(int page_index, int index)
获取指定页面索引的搜索结果中心点。
bool operator !=(const TextSearchCharInfo &other) const
不相等操作符。