blob: 207c1046c1d6f6f51ca06e1667923cbef1bf9def [file] [log] [blame]
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001// Copyright 2014 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Tom Sepez9857e202015-05-13 17:09:26 -07004
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07005// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
Tom Sepez9857e202015-05-13 17:09:26 -07007#ifndef PUBLIC_FPDF_SEARCHEX_H_
8#define PUBLIC_FPDF_SEARCHEX_H_
9
Dan Sinclair85c8e7f2016-11-21 13:50:32 -050010// NOLINTNEXTLINE(build/include)
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070011#include "fpdfview.h"
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070012
13#ifdef __cplusplus
14extern "C" {
dsinclair860193b2016-04-25 19:44:20 -070015#endif // __cplusplus
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070016
dsinclair860193b2016-04-25 19:44:20 -070017// Get the character index in |text_page| internal character list.
18//
19// text_page - a text page information structure.
20// nTextIndex - index of the text returned from |FPDFText_GetText|.
21//
22// Returns the index of the character in internal character list. -1 for error.
Dan Sinclair00d2ad12017-08-10 14:13:02 -040023FPDF_EXPORT int FPDF_CALLCONV
Nico Weber9d8ec5a2015-08-04 13:00:21 -070024FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070025
Nicolas Pena5c1961d2017-03-10 11:59:17 -050026// Get the text index in |text_page| internal character list.
27//
28// text_page - a text page information structure.
29// nCharIndex - index of the character in internal character list.
30//
31// Returns the index of the text returned from |FPDFText_GetText|. -1 for error.
Dan Sinclair00d2ad12017-08-10 14:13:02 -040032FPDF_EXPORT int FPDF_CALLCONV
Nicolas Pena5c1961d2017-03-10 11:59:17 -050033FPDFText_GetTextIndexFromCharIndex(FPDF_TEXTPAGE text_page, int nCharIndex);
34
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070035#ifdef __cplusplus
dsinclair860193b2016-04-25 19:44:20 -070036} // extern "C"
37#endif // __cplusplus
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070038
Tom Sepez9857e202015-05-13 17:09:26 -070039#endif // PUBLIC_FPDF_SEARCHEX_H_