1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTHIERARCHYPRIMITIVE2D_HXX
25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTHIERARCHYPRIMITIVE2D_HXX
26 
27 #include <drawinglayer/drawinglayerdllapi.h>
28 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
29 #include <tools/string.hxx>
30 
31 //////////////////////////////////////////////////////////////////////////////
32 
33 namespace drawinglayer
34 {
35 	namespace primitive2d
36 	{
37         /** TextHierarchyLinePrimitive2D class
38 
39             Text format hierarchy helper class. It decomposes to it's
40 		    content, so all direct renderers may ignore it. If You need
41 		    to know more about line hierarchies You may react on it and
42 		    also need to take care that the source of data uses it.
43 
44             This primitive encapsulates text lines.
45          */
46 		class DRAWINGLAYER_DLLPUBLIC TextHierarchyLinePrimitive2D : public GroupPrimitive2D
47 		{
48 		private:
49 		public:
50             /// constructor
51 			TextHierarchyLinePrimitive2D(const Primitive2DSequence& rChildren);
52 
53 			/// provide unique ID
54 			DeclPrimitrive2DIDBlock()
55 		};
56 	} // end of namespace primitive2d
57 } // end of namespace drawinglayer
58 
59 //////////////////////////////////////////////////////////////////////////////
60 
61 namespace drawinglayer
62 {
63 	namespace primitive2d
64 	{
65         /** TextHierarchyBulletPrimitive2D class
66 
67             This primitive encapsulates text bullets.
68          */
69 		class DRAWINGLAYER_DLLPUBLIC TextHierarchyBulletPrimitive2D : public GroupPrimitive2D
70 		{
71 		private:
72 		public:
73             /// constructor
74 			TextHierarchyBulletPrimitive2D(const Primitive2DSequence& rChildren);
75 
76 			/// provide unique ID
77 			DeclPrimitrive2DIDBlock()
78 		};
79 	} // end of namespace primitive2d
80 } // end of namespace drawinglayer
81 
82 //////////////////////////////////////////////////////////////////////////////
83 
84 namespace drawinglayer
85 {
86 	namespace primitive2d
87 	{
88         /** TextHierarchyParagraphPrimitive2D class
89 
90             This primitive encapsulates text paragraphs.
91          */
92 		class DRAWINGLAYER_DLLPUBLIC TextHierarchyParagraphPrimitive2D : public GroupPrimitive2D
93 		{
94 		private:
95 		public:
96             /// constructor
97 			TextHierarchyParagraphPrimitive2D(const Primitive2DSequence& rChildren);
98 
99 			/// provide unique ID
100 			DeclPrimitrive2DIDBlock()
101 		};
102 	} // end of namespace primitive2d
103 } // end of namespace drawinglayer
104 
105 //////////////////////////////////////////////////////////////////////////////
106 
107 namespace drawinglayer
108 {
109 	namespace primitive2d
110 	{
111         /** TextHierarchyBlockPrimitive2D class
112 
113             This primitive encapsulates text blocks.
114          */
115 		class DRAWINGLAYER_DLLPUBLIC TextHierarchyBlockPrimitive2D : public GroupPrimitive2D
116 		{
117 		private:
118 		public:
119             /// constructor
120 			TextHierarchyBlockPrimitive2D(const Primitive2DSequence& rChildren);
121 
122 			/// provide unique ID
123 			DeclPrimitrive2DIDBlock()
124 		};
125 	} // end of namespace primitive2d
126 } // end of namespace drawinglayer
127 
128 //////////////////////////////////////////////////////////////////////////////
129 
130 namespace drawinglayer
131 {
132 	namespace primitive2d
133 	{
134         /** FieldType definition */
135 		enum FieldType
136 		{
137             /** unspecified. If more info is needed for a FieldType,
138                 create a new type and it's handling
139              */
140 			FIELD_TYPE_COMMON,
141 
142             /** uses "FIELD_SEQ_BEGIN;PageField" -> special handling */
143             FIELD_TYPE_PAGE,
144 
145             /** uses URL as string -> special handling */
146 			FIELD_TYPE_URL
147 		};
148 
149         /** TextHierarchyFieldPrimitive2D class
150 
151             This primitive encapsulates text fields.
152 		    Also: This type uses a type enum to transport the encapsulated field
153 		    type. Also added is a String which is type-dependent. E.g. for URL
154 		    fields, it contains the URL.
155          */
156 		class DRAWINGLAYER_DLLPUBLIC TextHierarchyFieldPrimitive2D : public GroupPrimitive2D
157 		{
158 		private:
159 			FieldType								meType;
160             rtl::OUString                           maString;
161 
162 		public:
163             /// constructor
164 			TextHierarchyFieldPrimitive2D(
165 				const Primitive2DSequence& rChildren,
166 				const FieldType& rFieldType,
167                 const rtl::OUString& rString);
168 
169 			/// data read access
getType() const170 			FieldType getType() const { return meType; }
getString() const171 			const rtl::OUString& getString() const { return maString; }
172 
173 			/// compare operator
174 			virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
175 
176 			/// provide unique ID
177 			DeclPrimitrive2DIDBlock()
178 		};
179 	} // end of namespace primitive2d
180 } // end of namespace drawinglayer
181 
182 //////////////////////////////////////////////////////////////////////////////
183 
184 namespace drawinglayer
185 {
186 	namespace primitive2d
187 	{
188         /** TextHierarchyEditPrimitive2D class
189 
190             #i97628#
191             Primitive to encapsulate text from an active text edit; some
192             renderers need to suppress this output due to painting the
193             edited text in e.g. an OutlinerEditView. It's derived from
194             GroupPrimitive2D, so the implicit decomposition will use the
195             content. To suppress, this primitive needs to be parsed by
196             the renderer without taking any action.
197          */
198 		class DRAWINGLAYER_DLLPUBLIC TextHierarchyEditPrimitive2D : public GroupPrimitive2D
199 		{
200 		private:
201 		public:
202             /// constructor
203 			TextHierarchyEditPrimitive2D(const Primitive2DSequence& rChildren);
204 
205 			/// provide unique ID
206 			DeclPrimitrive2DIDBlock()
207 		};
208 	} // end of namespace primitive2d
209 } // end of namespace drawinglayer
210 
211 //////////////////////////////////////////////////////////////////////////////
212 
213 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTHIERARCHYPRIMITIVE2D_HXX
214 
215 //////////////////////////////////////////////////////////////////////////////
216 // eof
217