namespace Paroxe.PdfRenderer
{
///
/// Reprensent a search result. To result location is describe with index of the first char and the length of the result.
///
public struct PDFSearchResult
{
private readonly int m_PageIndex;
private readonly int m_StartIndex; // index of the first character
private readonly int m_Count; // number of characters
public PDFSearchResult(int pageIndex, int startIndex, int count)
{
m_PageIndex = pageIndex;
m_StartIndex = startIndex;
m_Count = count;
}
///
/// Indicate whether the result is valid or invalid.
///
public bool IsValid
{
get { return m_PageIndex != -1; }
}
///
/// The pageIndex of the result.
///
public int PageIndex
{
get { return m_PageIndex; }
}
///
/// The index of the first character of the result within the page.
///
public int StartIndex
{
get { return m_StartIndex; }
}
///
/// The length of the result within the page.
///
public int Count
{
get { return m_Count; }
}
}
}