1 /**
2  * Describes a destination
3  */
4 module harud.destination;
5 
6 import harud;
7 import harud.c.capi;
8 
9 /**
10 * Haru PDF Destination Class.
11 */
12 class Destination {
13    private HPDF_Destination _destination;
14 
15    this(HPDF_Destination destination) {
16       _destination = destination;
17    }
18 
19    @property HPDF_Destination destinationHandle() {
20       return this._destination;
21    }
22 
23    /**
24    * Defines the appearance of a page with three parameters which are left, top and zoom.
25    *
26    * Params:
27    *   left = The left coordinates of the page.
28    *   top = The top coordinates of the page.
29    *   zoom = The page magnified factor. The value must be between 0.08(8%) to 32(%).
30    */
31    HPDF_STATUS setXYZ(float left, float top, float zoom) {
32       return HPDF_Destination_SetXYZ(this._destination, left, top, zoom);
33    }
34 
35    /**
36    * Sets the appearance of the page to displadescriptionying entire page within the window
37    */
38    HPDF_STATUS setFit() {
39       return HPDF_Destination_SetFit(this._destination);
40    }
41 
42    /**
43    * Defines the appearance of a page to magnifying to fit the width of the page within the window and setting
44    * the top position of the page to the value of the "top" parameter.
45    *
46    * Params:
47    *   top = The top coordinates of the page.
48    */
49    HPDF_STATUS setFitH(float top) {
50       return HPDF_Destination_SetFitH(this._destination, top);
51    }
52 
53    /**
54    * Defines the appearance of a page to magnifying to fit the
55    * height of the page within the window and setting the left
56    * position of the page to the value of the "left" parameter.
57    *
58    * Params:
59    *   left = The left coordinates of the page.
60    */
61    HPDF_STATUS setFitV(float left) {
62       return HPDF_Destination_SetFitV(this._destination, left);
63    }
64 
65    /**
66    * Defines the appearance of a page to magnifying the page to fit a rectangle specified by left, bottom, right and top.
67    *
68    * Params:
69    *   left = The left coordinates of the page.
70    *   bottom = The bottom coordinates of the page.
71    *   right = The right coordinates of the page.
72    *   top = The top coordinates of the page.
73    *
74    */
75    HPDF_STATUS setFitR(float left, float bottom, float right, float top) {
76       return HPDF_Destination_SetFitR(this._destination, left, bottom, right, top);
77    }
78 
79    /**
80    * Sets the appearance of the page to magnifying to fit the bounding box of the page within the window.
81    *
82    */
83    HPDF_STATUS setFitB() {
84       return HPDF_Destination_SetFitB(this._destination);
85    }
86 
87    /**
88    * Defines the appearance of a page to magnifying to fit the width of the bounding box of the page within the window
89    * and setting the top position of the page to the value of the "top" parameter.
90    *
91    * Params:
92    *  top = The top coordinates of the page.
93    */
94    HPDF_STATUS setFitBH(float top) {
95       return HPDF_Destination_SetFitBH(this._destination, top);
96    }
97 
98    /**
99    * Defines the appearance of a page to magnifying to fit the height of the bounding box of the page within the window
100    * and setting the left position of the page to the value of the "left" parameter.
101    *
102    * Params:
103    *  left = The left coordinates of the page.
104    */
105    HPDF_STATUS setFitBV(float left) {
106       return HPDF_Destination_SetFitBV(this._destination, left);
107    }
108 }