public class CPDFTextSearcher extends java.lang.Object implements ITextSearcher
Constructor and Description |
---|
CPDFTextSearcher(android.content.Context context,
CPDFDocument document) |
CPDFTextSearcher(android.content.Context context,
CPDFReaderView readerView) |
Modifier and Type | Method and Description |
---|---|
void |
cancelSearch()
Stop searching.
|
int |
getCurrentPageIndex()
Gets the page index that is being searched currently
|
java.util.ArrayList<android.graphics.RectF> |
getSelectedSelections()
Gets the position of keyword that is in focus state currently.
|
java.util.ArrayList<android.graphics.RectF> |
getSelections(int pageIndex)
Gets the position of all keywords in specify page index.
|
boolean |
isIgnoreCase()
Whether to ignore the capitalization when searching.
|
boolean |
isMatchWholeWord()
Whether to match the whole word when searching.
|
void |
searchBackward()
Search backward.
|
void |
searchBegin(int pageIndex,
int textRangeIndex)
Sets the searcher to start searching from the
textRangeIndex keyword in pageIndex page |
void |
searchForward()
Search forward.
|
java.util.ArrayList<CPDFTextRange> |
searchKeyword(int pageIndex)
Searches keyword in the page index, get position information of all keywords, more:
CPDFTextRange |
void |
setIgnoreCase(boolean ignore)
Set whether to ignore the capitalization when searching.
|
void |
setMatchWholeWord(boolean matchWhole)
Set whether to match the whole word when searching.
|
void |
setSearchConfig(java.lang.String keyword,
int searchMode)
Sets the keyword and search mode of searcher
|
public CPDFTextSearcher(android.content.Context context, CPDFReaderView readerView)
public CPDFTextSearcher(android.content.Context context, CPDFDocument document)
public java.util.ArrayList<android.graphics.RectF> getSelections(int pageIndex)
A keyword may correspond to multiple rectangles, because if a keyword wraps, there will be multiple rectangles corresponding to a keyword
getSelections
in interface ITextSearcher
pageIndex
- Page number.pageIndex
pagepublic java.util.ArrayList<android.graphics.RectF> getSelectedSelections()
getSelectedSelections
in interface ITextSearcher
public int getCurrentPageIndex()
getCurrentPageIndex
in interface ITextSearcher
public void setSearchConfig(java.lang.String keyword, int searchMode)
setSearchConfig
in interface ITextSearcher
keyword
- KeywordsearchMode
- Search mode, more: CPDFTextSearcher.PDFSearchOptions
public void setIgnoreCase(boolean ignore)
setIgnoreCase
in interface ITextSearcher
ignore
- Whether to ignore the capitalization.public void setMatchWholeWord(boolean matchWhole)
setMatchWholeWord
in interface ITextSearcher
matchWhole
- Whether to match the whole word.public boolean isIgnoreCase()
isIgnoreCase
in interface ITextSearcher
public boolean isMatchWholeWord()
isMatchWholeWord
in interface ITextSearcher
public void searchBegin(int pageIndex, int textRangeIndex)
textRangeIndex
keyword in pageIndex
pagesearchBegin
in interface ITextSearcher
pageIndex
- Start page index.textRangeIndex
- Start keyword index.public java.util.ArrayList<CPDFTextRange> searchKeyword(int pageIndex)
CPDFTextRange
searchKeyword
in interface ITextSearcher
pageIndex
- Page index.public void searchForward()
searchForward
in interface ITextSearcher
public void searchBackward()
searchBackward
in interface ITextSearcher
public void cancelSearch()
cancelSearch
in interface ITextSearcher