public class

SearchResultsView

extends RelativeLayout
implements FindTextTask.Callback
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.RelativeLayout
         ↳ com.pdftron.pdf.controls.SearchResultsView
Known Direct Subclasses

Class Overview

A Relative layout that shows search results

Summary

Nested Classes
enum SearchResultsView.SearchResultStatus  
interface SearchResultsView.SearchResultsListener Listener interface for search result events  
class SearchResultsView.Section A class contains information about search result section  
class SearchResultsView.Theme  
[Expand]
Inherited Constants
From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
SearchResultsView(Context context)
Class constructor
SearchResultsView(Context context, AttributeSet attrs)
Class constructor
SearchResultsView(Context context, AttributeSet attrs, int defStyleAttr)
Class constructor
Public Methods
void add(TextSearchResult item)
Adds a text search result item to search result list
void cancelGetResult()
This should be called when cancelling search
void cancelSearch()
Cancels the current search
void findText(String pattern)
Finds a specified pattern in the document.
PDFDoc getDoc()
Gets PDFDoc contained in PDFViewCtrl
SearchResultsView.SearchResultStatus getResult(boolean searchUp)
Goes to the next result in the window.
String getSearchPattern()
boolean isActive()
void onFindTextTaskCancelled()
Called when the task of finding text has been cancelled.
void onFindTextTaskFinished(int numResults, ArrayList<TextSearchResult> results, HashMap<TextSearchResult, ArrayList<Double>> highlights)
Called when the task of finding text has been terminated.
void onFindTextTaskProgressUpdated(boolean foundResultOnPage, int pagesSearched, ArrayList<TextSearchResult> results)
Called when the task of finding text has been updated.
void onFindTextTaskStarted()
Called when the task of finding text has started.
void reset()
Resets internal state of window
void restartSearch()
Starts a new search
void setMatchCase(boolean matchCase)
Sets whether the the pattern is case sensitive.
void setPdfViewCtrl(PDFViewCtrl pdfViewCtrl)
Sets the PDFViewCtrl.
void setSearchResultsListener(SearchResultsView.SearchResultsListener listener)
void setWholeWord(boolean wholeWord)
Sets whether the whole word should match the pattern.
[Expand]
Inherited Methods
From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.pdftron.pdf.asynctask.FindTextTask.Callback

Public Constructors

public SearchResultsView (Context context)

Class constructor

public SearchResultsView (Context context, AttributeSet attrs)

Class constructor

public SearchResultsView (Context context, AttributeSet attrs, int defStyleAttr)

Class constructor

Public Methods

public void add (TextSearchResult item)

Adds a text search result item to search result list

Parameters
item text search result item

public void cancelGetResult ()

This should be called when cancelling search

public void cancelSearch ()

Cancels the current search

public void findText (String pattern)

Finds a specified pattern in the document.

Parameters
pattern The pattern to be found

public PDFDoc getDoc ()

Gets PDFDoc contained in PDFViewCtrl

Returns
  • The PDFDoc

public SearchResultsView.SearchResultStatus getResult (boolean searchUp)

Goes to the next result in the window.

Parameters
searchUp True if should go to previous search (up); False if should go to the next search (down)
Returns
  • The status of search.

public String getSearchPattern ()

Returns
  • The search pattern

public boolean isActive ()

Returns
  • True if searching task is active

public void onFindTextTaskCancelled ()

Called when the task of finding text has been cancelled.

public void onFindTextTaskFinished (int numResults, ArrayList<TextSearchResult> results, HashMap<TextSearchResult, ArrayList<Double>> highlights)

Called when the task of finding text has been terminated.

Parameters
numResults The number of result
results The results

public void onFindTextTaskProgressUpdated (boolean foundResultOnPage, int pagesSearched, ArrayList<TextSearchResult> results)

Called when the task of finding text has been updated.

Parameters
foundResultOnPage True if result on the page has been found
results The text search results

public void onFindTextTaskStarted ()

Called when the task of finding text has started.

public void reset ()

Resets internal state of window

public void restartSearch ()

Starts a new search

public void setMatchCase (boolean matchCase)

Sets whether the the pattern is case sensitive.

Parameters
matchCase True if the pattern is case sensitive

public void setPdfViewCtrl (PDFViewCtrl pdfViewCtrl)

Sets the PDFViewCtrl.

Parameters
pdfViewCtrl The PDFViewCtrl

public void setSearchResultsListener (SearchResultsView.SearchResultsListener listener)

Parameters
listener The Listener

public void setWholeWord (boolean wholeWord)

Sets whether the whole word should match the pattern.

Parameters
wholeWord True if the whole word should match the pattern