Foxit PDF SDK
fs_psi.h
Go to the documentation of this file.
1 
15 #ifndef FS_PSI_H_
16 #define FS_PSI_H_
17 
18 #include "common/fs_common.h"
19 #include "pdf/annots/fs_annot.h"
20 #include "pdf/fs_pdfpage.h"
21 
27 namespace foxit {
31 namespace pdf {
32 // forward declaration
33 class PSI;
34 
40 class PSICallback {
41  public:
47  virtual void Release() = 0;
56  virtual void Refresh(PSI psi, const RectF& rect) = 0;
57 
58  protected:
59  ~PSICallback() {}
60 };
61 
73 class PSI FS_FINAL : public Base {
74  public:
84  PSI(common::Bitmap& bitmap, bool simulate);
85 
95  PSI(int width, int height, bool simulate);
96 
102  PSI(const PSI& other);
110  PSI& operator = (const PSI& other);
111 
119  bool operator == (const PSI& other) const;
127  bool operator != (const PSI& other) const;
128 
136  bool IsEmpty() const;
138  ~PSI();
139 
149  void SetCallback(PSICallback* callback);
150 
161  void SetColor(RGB color);
162 
173  void SetDiameter(int diameter);
174 
186  void SetOpacity(float opacity);
187 
199  void AddPoint(const PointF& point, common::Path::PointType type, float pressure);
200 
209 
216 
238  annots::PSInk ConvertToPDFAnnot(const PDFPage& page, const RectF& annot_rect, common::Rotation rotate);
239 
240  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
241  explicit PSI(FS_HANDLE handle = NULL);
242 
243 };
244 } // namespace pdf
245 } // namespace foxit
246 #endif // FS_PSI_H_
247 
foxit::pdf::PSI::ConvertToPDFAnnot
annots::PSInk ConvertToPDFAnnot(const PDFPage &page, const RectF &annot_rect, common::Rotation rotate)
Convert a PSI object to a PSInk annotation and insert the PSInk annotation to a PDF page.
foxit::pdf::PSI::GetBitmap
common::Bitmap GetBitmap()
Get the canvas bitmap.
foxit::FS_HANDLE
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:214
foxit::common::Path::PointType
PointType
Enumeration for point type in path.
Definition: fs_common.h:2012
foxit::pdf::PSI::operator=
PSI & operator=(const PSI &other)
Assign operator.
fs_common.h
Header file for common definitions and classes.
foxit::pdf::PSI::SetCallback
void SetCallback(PSICallback *callback)
Set a callback object for refreshing.
foxit::pdf::PSI::operator==
bool operator==(const PSI &other) const
Equal operator.
foxit::pdf::PSI::SetDiameter
void SetDiameter(int diameter)
Set ink diameter.
foxit::pdf::PSI::AddPoint
void AddPoint(const PointF &point, common::Path::PointType type, float pressure)
Add a point.
foxit::pdf::PSI::operator!=
bool operator!=(const PSI &other) const
Not equal operator.
CFX_PSVTemplate
Definition: fx_coordinates.h:30
foxit::common::Rotation
Rotation
Enumeration for rotation.
Definition: fs_common.h:57
foxit::pdf::PSI
Definition: fs_psi.h:73
fs_pdfpage.h
Header file for PDF page related definitions and classes.
foxit
Foxit namespace.
Definition: fs_taggedpdf.h:27
foxit::pdf::PSICallback::Refresh
virtual void Refresh(PSI psi, const RectF &rect)=0
A callback function used to refresh a specified region for PSI.
foxit::pdf::PSI::~PSI
~PSI()
Destructor.
foxit::pdf::annots::PSInk
Definition: fs_annot.h:5097
foxit::pdf::PSICallback
Definition: fs_psi.h:40
NULL
#define NULL
The null-pointer value.
Definition: fx_system.h:780
foxit::pdf::PSI::SetOpacity
void SetOpacity(float opacity)
Set ink opacity.
foxit::pdf::PSI::SetColor
void SetColor(RGB color)
Set ink color.
CFX_FloatRect
Definition: fx_coordinates.h:771
foxit::RGB
uint32 RGB
RGB color type, 24 bits, ((b) | ((g) << 8) | ((r) << 16)))
Definition: fs_basictypes.h:212
foxit::pdf::PDFPage
Definition: fs_pdfpage.h:412
foxit::pdf::PSI::PSI
PSI(common::Bitmap &bitmap, bool simulate)
Constructor, with a bitmap as canvas.
foxit::pdf::PSI::GetContentsRect
RectF GetContentsRect()
Get contents rectangle.
fs_annot.h
Header file for annotation related definitions and classes.
foxit::common::Bitmap
Definition: fs_image.h:36
foxit::pdf::PSI::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::pdf::PSICallback::Release
virtual void Release()=0
A callback function used to release current callback object itself.
foxit::Base
Definition: fs_basictypes.h:427