public class CPDFEditTextSearchReplace
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
SearchModeCaseInsensitive |
static int |
SearchModeCaseSensitive |
static int |
SearchModeMatchWholeWord |
static int |
SearchModeNoMatchWholeWord |
Constructor and Description |
---|
CPDFEditTextSearchReplace(android.content.Context context,
CPDFDocument document) |
CPDFEditTextSearchReplace(android.content.Context context,
CPDFReaderView readerView) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the search results.
|
android.util.SparseArray<java.util.ArrayList<CPDFEditFindSelection>> |
findSelections()
Search text in all pages.
|
android.util.SparseArray<java.util.ArrayList<CPDFEditFindSelection>> |
getAllReplaceSelections()
Get all the search results those are replaced.
|
int |
getCurrentPageIndex()
Get current page index.
|
android.util.SparseArray<java.util.ArrayList<CPDFEditFindSelection>> |
getCurrentSearchResult()
Get all search results.
|
int |
getCurrentSelectionIndex()
Get the index of the search results in current page.
|
boolean |
isIgnoreCase()
Whether to ignore the capitalization when searching.
|
boolean |
isMatchWholeWord()
Whether to match the whole word when searching.
|
boolean |
isSelectCurrent()
Whether select current result.
|
boolean |
replace(java.lang.String text)
Replace current search result with specified text.
|
boolean |
replaceAll(java.lang.String text)
Replace all search results with specified text.
|
CPDFEditFindSelection |
searchBackward()
Get previous search result.
|
CPDFEditFindSelection |
searchForward()
Get next search result.
|
void |
selectNextAfterReplace(boolean select)
Whether selecting next after replace current text.
|
boolean |
setCurrentSelection(int page,
int index)
Set the index and page of current search result.
|
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 static final int SearchModeCaseInsensitive
public static final int SearchModeNoMatchWholeWord
public static final int SearchModeCaseSensitive
public static final int SearchModeMatchWholeWord
public CPDFEditTextSearchReplace(android.content.Context context, CPDFReaderView readerView)
public CPDFEditTextSearchReplace(android.content.Context context, CPDFDocument document)
public android.util.SparseArray<java.util.ArrayList<CPDFEditFindSelection>> getCurrentSearchResult()
public int getCurrentPageIndex()
public int getCurrentSelectionIndex()
public boolean setCurrentSelection(int page, int index)
page
- The page index of current search result.index
- The index in page of current search result.public void selectNextAfterReplace(boolean select)
select
- Whether selecting next.public android.util.SparseArray<java.util.ArrayList<CPDFEditFindSelection>> getAllReplaceSelections()
public boolean isSelectCurrent()
public android.util.SparseArray<java.util.ArrayList<CPDFEditFindSelection>> findSelections()
public CPDFEditFindSelection searchForward()
public CPDFEditFindSelection searchBackward()
public boolean replace(java.lang.String text)
text
- The text to replace.public boolean replaceAll(java.lang.String text)
text
- Text to replace.public void setSearchConfig(java.lang.String keyword, int searchMode)
keyword
- KeywordsearchMode
- Search mode, more: CPDFTextSearcher.PDFSearchOptions
public void setIgnoreCase(boolean ignore)
ignore
- Whether to ignore the capitalization.public void setMatchWholeWord(boolean matchWhole)
matchWhole
- Whether to match the whole word.public boolean isIgnoreCase()
public boolean isMatchWholeWord()
public void clear()