1 /**
2  * Describes an annotation.
3  */
4 module harud.annotation;
5 
6 import harud;
7 import harud.c.capi;
8 
9 /**
10 * Haru PDF Annotation Class.
11 */
12 class Annotation : IHaruObject {
13    protected HPDF_Annotation _annotation;
14 
15    this(HPDF_Annotation annotation) {
16       _annotation = annotation;
17    }
18 
19    /**
20    * Defines the appearance when a mouse clicks on a link annotation.
21    *
22    * Params:
23    *   mode = mode for highlighting
24    */
25    HPDF_STATUS setHighlightMode(HaruAnnotHighlightMode mode) {
26       return HPDF_LinkAnnot_SetHighlightMode(this._annotation, mode);
27    }
28 
29    /**
30    * Defines the style of the annotation's border.
31    *
32    * Params:
33    *   width = The width of an annotation's border.
34    *   dashOn = The dash style.
35    *   dashOff = The dash style
36    */
37    HPDF_STATUS setBorderStyle(float width, ushort dashOn, ushort dashOff) {
38       return HPDF_LinkAnnot_SetBorderStyle(this._annotation, width, dashOn, dashOff);
39    }
40 
41    /**
42    * Defines the style of the annotation's icon
43    *
44    * Params:
45    *   icon = a AnnotationIcon value
46    */
47    HPDF_STATUS setIcon(HaruAnnotIcon icon) {
48       return HPDF_TextAnnot_SetIcon(this._annotation, icon);
49    }
50 
51    /**
52    * Defines whether the text-annotation is initially open.
53    *
54    * Params:
55    *   open = true means the annotation initially displayed open.
56    */
57    HPDF_STATUS setOpened(bool open) {
58       return HPDF_TextAnnot_SetOpened(this._annotation, cast(uint)open);
59    }
60 
61    public HPDF_HANDLE getHandle() {
62       return this._annotation;
63    }
64 }