#include <Highlights.h>
Public Types | |
typedef pdftron::PDF::Highlight | Highlight |
Public Member Functions | |
Highlights () | |
~Highlights () | |
Highlights (const Highlights &hlts) | |
Highlights & | operator= (const Highlights &hlts) |
void | Load (const UString &file_name) |
void | Save (const UString &file_name) |
UString | SaveToString () |
void | Add (const Highlights &hlts) |
void | Clear () |
void | Begin (PDFDoc &doc) |
bool | HasNext () const |
void | Next () |
int | GetCurrentPageNumber () const |
std::vector< QuadPoint > | GetCurrentQuads () const |
int | GetCurrentQuads (const double *&quads) const |
TextRange | GetCurrentTextRange () const |
void | Destroy () |
ptrdiff_t | GetHandleInternal () |
Highlights (TRN_Highlights impl) | |
Static Public Member Functions | |
static Highlights * | CreateInternal (ptrdiff_t impl) |
Public Attributes | |
TRN_Highlights | mp_highlights |
Friends | |
class | PDFView |
class | PDFViewCtrl |
class | TextSearch |
Highlights is used to store the necessary information and perform certain tasks in accordance with Adobe's Highlight standard, whose details can be found at:
http://partners.adobe.com/public/developer/en/pdf/HighlightFileFormat.pdf
In a nutshell, the Highlights class maintains a set of highlights. Each highlight contains three pieces of information:
page: the number of the page this Highlight is on; position: the start position (text offset) of this Highlight; length: the length of this Highlight.
Possible use case scenarios for Highlights include:
Note:
For a sample code, please take a look at the TextSearchTest sample project.
Definition at line 70 of file Highlights.h.
Definition at line 77 of file Highlights.h.
pdftron::PDF::Highlights::Highlights | ( | ) |
Constructor and destructor.
pdftron::PDF::Highlights::~Highlights | ( | ) |
pdftron::PDF::Highlights::Highlights | ( | const Highlights & | hlts | ) |
Copy constructor.
|
inline |
Definition at line 191 of file Highlights.h.
void pdftron::PDF::Highlights::Add | ( | const Highlights & | hlts | ) |
Add highlights.
hlts | the Highlights instance containing the highlights to be added. |
void pdftron::PDF::Highlights::Begin | ( | PDFDoc & | doc | ) |
Rewind the internal pointer to the first highlight.
doc | the PDF document to which the highlights correspond. |
void pdftron::PDF::Highlights::Clear | ( | ) |
Clear the current Highlight information in the class.
|
static |
void pdftron::PDF::Highlights::Destroy | ( | ) |
Frees the native memory of the object.
int pdftron::PDF::Highlights::GetCurrentPageNumber | ( | ) | const |
Get the page number of the current highlight.
std::vector<QuadPoint> pdftron::PDF::Highlights::GetCurrentQuads | ( | ) | const |
Get the corresponding quadrangles of the current highlight.
quads | the output pointer to the resulting quadrangles. |
int pdftron::PDF::Highlights::GetCurrentQuads | ( | const double *& | quads | ) | const |
TextRange pdftron::PDF::Highlights::GetCurrentTextRange | ( | ) | const |
Get a TextRange object that represents the current highlight.
ptrdiff_t pdftron::PDF::Highlights::GetHandleInternal | ( | ) |
bool pdftron::PDF::Highlights::HasNext | ( | ) | const |
Query if there is any subsequent highlight after the current highlight.
void pdftron::PDF::Highlights::Load | ( | const UString & | file_name | ) |
void pdftron::PDF::Highlights::Next | ( | ) |
Move the current highlight to the next highlight.
Highlights& pdftron::PDF::Highlights::operator= | ( | const Highlights & | hlts | ) |
Assignment operator.
void pdftron::PDF::Highlights::Save | ( | const UString & | file_name | ) |
Save the current Highlight information in the class to a file.
file_name | the name of the file to save to. |
UString pdftron::PDF::Highlights::SaveToString | ( | ) |
Save the current Highlight information in the class to an XML string.
|
friend |
Definition at line 72 of file Highlights.h.
|
friend |
Definition at line 73 of file Highlights.h.
|
friend |
Definition at line 74 of file Highlights.h.
TRN_Highlights pdftron::PDF::Highlights::mp_highlights |
Definition at line 189 of file Highlights.h.