01: /*
02: Copyright © 2007 Stefano Chizzolini. http://clown.stefanochizzolini.it
03:
04: Contributors:
05: * Stefano Chizzolini (original code developer, http://www.stefanochizzolini.it):
06: contributed code is Copyright © 2007 by Stefano Chizzolini.
07:
08: This file should be part of the source code distribution of "PDF Clown library"
09: (the Program): see the accompanying README files for more info.
10:
11: This Program is free software; you can redistribute it and/or modify it under
12: the terms of the GNU General Public License as published by the Free Software
13: Foundation; either version 2 of the License, or (at your option) any later version.
14:
15: This Program is distributed in the hope that it will be useful, but WITHOUT ANY
16: WARRANTY, either expressed or implied; without even the implied warranty of
17: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more details.
18:
19: You should have received a copy of the GNU General Public License along with this
20: Program (see README files); if not, go to the GNU website (http://www.gnu.org/).
21:
22: Redistribution and use, with or without modification, are permitted provided that such
23: redistributions retain the above copyright notice, license and disclaimer, along with
24: this list of conditions.
25: */
26:
27: package it.stefanochizzolini.clown.documents;
28:
29: import it.stefanochizzolini.clown.documents.Document;
30: import it.stefanochizzolini.clown.documents.interaction.Destinations;
31: import it.stefanochizzolini.clown.objects.PdfDictionary;
32: import it.stefanochizzolini.clown.objects.PdfDirectObject;
33: import it.stefanochizzolini.clown.objects.PdfIndirectObject;
34: import it.stefanochizzolini.clown.objects.PdfObjectWrapper;
35: import it.stefanochizzolini.clown.objects.PdfName;
36: import it.stefanochizzolini.clown.util.NotImplementedException;
37:
38: /**
39: Name dictionary [PDF:1.6:3.6.3].
40:
41: @author Stefano Chizzolini
42: @version 0.0.4, 05/30/07
43: @since 0.0.4
44: */
45: public class Names extends PdfObjectWrapper<PdfDictionary> {
46: // <class>
47: // <dynamic>
48: // <constructors>
49: public Names(Document context) {
50: super (context.getFile(), new PdfDictionary());
51: }
52:
53: /**
54: <h3>Remarks</h3>
55: <p>For internal use only.</p>
56: */
57: public Names(PdfDirectObject baseObject, PdfIndirectObject container) {
58: super (baseObject, container);
59: }
60:
61: // </constructors>
62:
63: // <interface>
64: // <public>
65: @Override
66: public Names clone(Document context) {
67: throw new NotImplementedException();
68: }
69:
70: /**
71: Gets the map of name strings to destinations.
72: */
73: public Destinations getDestinations() {
74: /*
75: NOTE: 'Dests' entry may be undefined.
76: */
77: PdfDirectObject destinations = getBaseDataObject().get(
78: PdfName.Dests);
79: if (destinations == null)
80: return null;
81:
82: return new Destinations(destinations, getContainer());
83: }
84:
85: /**
86: Sets the map of name strings to destinations.
87: */
88: public void setDestinations(Destinations value) {
89: getBaseDataObject().put(PdfName.Dests, value.getBaseObject());
90: }
91: // </public>
92: // </interface>
93: // </dynamic>
94: // </class>
95: }
|