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.contents;
28:
29: import it.stefanochizzolini.clown.documents.Document;
30: import it.stefanochizzolini.clown.documents.contents.objects.ContentObject;
31: import it.stefanochizzolini.clown.documents.contents.xObjects.XObject;
32:
33: /**
34: Generic content entity.
35: <p>It provides common ways to convert any content into content stream objects.</p>
36: @version 0.0.5
37: @since 0.0.5
38: */
39: public interface IContentEntity {
40: /**
41: Converts the entity to its equivalent content-stream inline (dependent) object representation
42: (see also [PDF:1.6:4.8.6]).
43: <h3>Remarks</h3>
44: <p>This method creates an inline object within the target content context, returning it. To show it
45: in its content context (eg: a page), then it must be applied in an appropriate manner (see
46: PrimitiveFilter object).</p>
47: <p>Specifically, the resulting inline object must be shown within the same content context that it
48: was targeted for. Due to its direct-content nature (opposite to the indirect-content nature of
49: external objects), it should be shown only one time in order not to wastefully multiply its
50: data.</p>
51: @param context Target content context.
52: @return The inline object representing the entity.
53: */
54: ContentObject toInlineObject(IContentContext context);
55:
56: /**
57: Converts the entity to its equivalent external (independent) object representation
58: (see also [PDF:1.6:4.7]).
59: <h3>Remarks</h3>
60: <p>This method creates an external object within the target document, returning it. To show it
61: in a content context (eg: a page), then it must be applied in an appropriate manner (see
62: PrimitiveFilter object).</p>
63: @param context Target document.
64: @return The external object representing the entity.
65: */
66: XObject toXObject(Document context);
67: }
|