1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTHIERARCHYPRIMITIVE2D_HXX
29 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTHIERARCHYPRIMITIVE2D_HXX
30 
31 #include <drawinglayer/drawinglayerdllapi.h>
32 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
33 #include <tools/string.hxx>
34 
35 //////////////////////////////////////////////////////////////////////////////
36 
37 namespace drawinglayer
38 {
39 	namespace primitive2d
40 	{
41         /** TextHierarchyLinePrimitive2D class
42 
43             Text format hierarchy helper class. It decomposes to it's
44 		    content, so all direct renderers may ignore it. If You need
45 		    to know more about line hierarchies You may react on it and
46 		    also need to take care that the source of data uses it.
47 
48             This primitive encapsulates text lines.
49          */
50 		class DRAWINGLAYER_DLLPUBLIC TextHierarchyLinePrimitive2D : public GroupPrimitive2D
51 		{
52 		private:
53 		public:
54             /// constructor
55 			TextHierarchyLinePrimitive2D(const Primitive2DSequence& rChildren);
56 
57 			/// provide unique ID
58 			DeclPrimitrive2DIDBlock()
59 		};
60 	} // end of namespace primitive2d
61 } // end of namespace drawinglayer
62 
63 //////////////////////////////////////////////////////////////////////////////
64 
65 namespace drawinglayer
66 {
67 	namespace primitive2d
68 	{
69         /** TextHierarchyBulletPrimitive2D class
70 
71             This primitive encapsulates text bullets.
72          */
73 		class DRAWINGLAYER_DLLPUBLIC TextHierarchyBulletPrimitive2D : public GroupPrimitive2D
74 		{
75 		private:
76 		public:
77             /// constructor
78 			TextHierarchyBulletPrimitive2D(const Primitive2DSequence& rChildren);
79 
80 			/// provide unique ID
81 			DeclPrimitrive2DIDBlock()
82 		};
83 	} // end of namespace primitive2d
84 } // end of namespace drawinglayer
85 
86 //////////////////////////////////////////////////////////////////////////////
87 
88 namespace drawinglayer
89 {
90 	namespace primitive2d
91 	{
92         /** TextHierarchyParagraphPrimitive2D class
93 
94             This primitive encapsulates text paragraphs.
95          */
96 		class DRAWINGLAYER_DLLPUBLIC TextHierarchyParagraphPrimitive2D : public GroupPrimitive2D
97 		{
98 		private:
99 		public:
100             /// constructor
101 			TextHierarchyParagraphPrimitive2D(const Primitive2DSequence& rChildren);
102 
103 			/// provide unique ID
104 			DeclPrimitrive2DIDBlock()
105 		};
106 	} // end of namespace primitive2d
107 } // end of namespace drawinglayer
108 
109 //////////////////////////////////////////////////////////////////////////////
110 
111 namespace drawinglayer
112 {
113 	namespace primitive2d
114 	{
115         /** TextHierarchyBlockPrimitive2D class
116 
117             This primitive encapsulates text blocks.
118          */
119 		class DRAWINGLAYER_DLLPUBLIC TextHierarchyBlockPrimitive2D : public GroupPrimitive2D
120 		{
121 		private:
122 		public:
123             /// constructor
124 			TextHierarchyBlockPrimitive2D(const Primitive2DSequence& rChildren);
125 
126 			/// provide unique ID
127 			DeclPrimitrive2DIDBlock()
128 		};
129 	} // end of namespace primitive2d
130 } // end of namespace drawinglayer
131 
132 //////////////////////////////////////////////////////////////////////////////
133 
134 namespace drawinglayer
135 {
136 	namespace primitive2d
137 	{
138         /** FieldType definition */
139 		enum FieldType
140 		{
141             /** unspecified. If more info is needed for a FieldType,
142                 create a new type and it's handling
143              */
144 			FIELD_TYPE_COMMON,
145 
146             /** uses "FIELD_SEQ_BEGIN;PageField" -> special handling */
147             FIELD_TYPE_PAGE,
148 
149             /** uses URL as string -> special handling */
150 			FIELD_TYPE_URL
151 		};
152 
153         /** TextHierarchyFieldPrimitive2D class
154 
155             This primitive encapsulates text fields.
156 		    Also: This type uses a type enum to transport the encapsulated field
157 		    type. Also added is a String which is type-dependent. E.g. for URL
158 		    fields, it contains the URL.
159          */
160 		class DRAWINGLAYER_DLLPUBLIC TextHierarchyFieldPrimitive2D : public GroupPrimitive2D
161 		{
162 		private:
163 			FieldType								meType;
164             rtl::OUString                           maString;
165 
166 		public:
167             /// constructor
168 			TextHierarchyFieldPrimitive2D(
169 				const Primitive2DSequence& rChildren,
170 				const FieldType& rFieldType,
171                 const rtl::OUString& rString);
172 
173 			/// data read access
174 			FieldType getType() const { return meType; }
175 			const rtl::OUString& getString() const { return maString; }
176 
177 			/// compare operator
178 			virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
179 
180 			/// provide unique ID
181 			DeclPrimitrive2DIDBlock()
182 		};
183 	} // end of namespace primitive2d
184 } // end of namespace drawinglayer
185 
186 //////////////////////////////////////////////////////////////////////////////
187 
188 namespace drawinglayer
189 {
190 	namespace primitive2d
191 	{
192         /** TextHierarchyEditPrimitive2D class
193 
194             #i97628#
195             Primitive to encapsulate text from an active text edit; some
196             renderers need to suppress this output due to painting the
197             edited text in e.g. an OutlinerEditView. It's derived from
198             GroupPrimitive2D, so the implicit decomposition will use the
199             content. To suppress, this primitive needs to be parsed by
200             the renderer without taking any action.
201          */
202 		class DRAWINGLAYER_DLLPUBLIC TextHierarchyEditPrimitive2D : public GroupPrimitive2D
203 		{
204 		private:
205 		public:
206             /// constructor
207 			TextHierarchyEditPrimitive2D(const Primitive2DSequence& rChildren);
208 
209 			/// provide unique ID
210 			DeclPrimitrive2DIDBlock()
211 		};
212 	} // end of namespace primitive2d
213 } // end of namespace drawinglayer
214 
215 //////////////////////////////////////////////////////////////////////////////
216 
217 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTHIERARCHYPRIMITIVE2D_HXX
218 
219 //////////////////////////////////////////////////////////////////////////////
220 // eof
221