forked from pocoproject/poco
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextAnnotation.h
More file actions
88 lines (64 loc) · 1.67 KB
/
TextAnnotation.h
File metadata and controls
88 lines (64 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//
// TextAnnotation.h
//
// Library: PDF
// Package: PDFCore
// Module: TextAnnotation
//
// Definition of the TextAnnotation class.
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef PDF_TextAnnotation_INCLUDED
#define PDF_TextAnnotation_INCLUDED
#include "Poco/PDF/PDF.h"
#include "Poco/PDF/Resource.h"
#include "Poco/PDF/Destination.h"
namespace Poco {
namespace PDF {
class PDF_API TextAnnotation: public Resource<HPDF_Annotation>
/// A TextAnnotation represents a PDF annotation resource.
{
public:
enum IconType
{
ANNOTATION_ICON_COMMENT = HPDF_ANNOT_ICON_COMMENT,
ANNOTATION_ICON_KEY = HPDF_ANNOT_ICON_KEY,
ANNOTATION_ICON_NOTE = HPDF_ANNOT_ICON_NOTE,
ANNOTATION_ICON_HELP = HPDF_ANNOT_ICON_HELP,
ANNOTATION_ICON_NEW_PARAGRAPH = HPDF_ANNOT_ICON_NEW_PARAGRAPH,
ANNOTATION_ICON_PARAGRAPH = HPDF_ANNOT_ICON_PARAGRAPH,
ANNOTATION_ICON_INSERT = HPDF_ANNOT_ICON_INSERT
};
TextAnnotation(HPDF_Doc* pPDF,
const HPDF_Annotation& annotation,
const std::string& name = "");
/// Creates the annotation.
virtual ~TextAnnotation();
/// Destroys the annotation.
void open();
/// Opens the annotation.
void close();
/// Closes the annotation.
void icon(IconType iconType);
};
//
// inlines
//
inline void TextAnnotation::open()
{
HPDF_TextAnnot_SetOpened(handle(), HPDF_TRUE);
}
inline void TextAnnotation::close()
{
HPDF_TextAnnot_SetOpened(handle(), HPDF_FALSE);
}
inline void TextAnnotation::icon(IconType iconType)
{
HPDF_TextAnnot_SetIcon(handle(), static_cast<HPDF_AnnotIcon>(iconType));
}
} } // namespace Poco::PDF
#endif // PDF_TextAnnotation_INCLUDED