Loading...
Searching...
No Matches
Highlights.h
Go to the documentation of this file.
1//---------------------------------------------------------------------------------------
2// Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3// Consult legal.txt regarding legal and license information.
4//---------------------------------------------------------------------------------------
5#ifndef PDFTRON_H_CPPHighlights
6#define PDFTRON_H_CPPHighlights
7
8#include <PDF/PDFDoc.h>
9#include <Common/UString.h>
10#include <C/PDF/TRN_Highlights.h>
11#include <PDF/TextRange.h>
12
13namespace pdftron {
14 namespace PDF {
15
17{
19 {
20 page_num = 0; //invalid
21 position = 0;
22 length = 0;
23 }
24
25 Highlight(int pg, int pos, int len) : page_num(pg), position(pos), length(len)
26 {}
27
29 {}
30
33 int length;
34};
35
71{
72 friend class PDFView;
73 friend class PDFViewCtrl;
74 friend class TextSearch;
75public:
76
86 Highlights(const Highlights& hlts);
87
92
99 void Load( const UString& file_name );
100
106 void Save( const UString& file_name );
107
114
120 void Add( const Highlights& hlts );
121
125 void Clear();
126
135 void Begin(PDFDoc& doc);
136
140 bool HasNext() const;
141
145 void Next();
146
151
165 std::vector<QuadPoint> GetCurrentQuads() const;
166
167#ifndef SWIG
168 int GetCurrentQuads(const double* &quads) const;
169#endif
170
175
179 void Destroy();
180
181
182 //for xamarin use only
183 static Highlights* CreateInternal(ptrdiff_t impl);
184 ptrdiff_t GetHandleInternal();
185
186#ifndef SWIGHIDDEN
187
188//private:
189 TRN_Highlights mp_highlights;
190 //for xamarin use only
191 Highlights(TRN_Highlights impl) : mp_highlights(impl) {}
192#endif
193};
194
195
196#include <Impl/Highlights.inl>
197
198 } // namespace PDF
199} // namespace pdftron
200
201#endif // PDFTRON_H_CPPHighlights
TextRange GetCurrentTextRange() const
Highlights & operator=(const Highlights &hlts)
Highlights(TRN_Highlights impl)
Definition Highlights.h:191
void Save(const UString &file_name)
void Add(const Highlights &hlts)
pdftron::PDF::Highlight Highlight
Definition Highlights.h:77
friend class PDFViewCtrl
Definition Highlights.h:73
void Load(const UString &file_name)
void Begin(PDFDoc &doc)
ptrdiff_t GetHandleInternal()
std::vector< QuadPoint > GetCurrentQuads() const
int GetCurrentQuads(const double *&quads) const
int GetCurrentPageNumber() const
static Highlights * CreateInternal(ptrdiff_t impl)
TRN_Highlights mp_highlights
Definition Highlights.h:189
Highlights(const Highlights &hlts)
friend class TextSearch
Definition Highlights.h:74
Highlight(const Highlight &hlt)
Definition Highlights.h:28
Highlight(int pg, int pos, int len)
Definition Highlights.h:25