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/primitive2d/groupprimitive2d.hxx> 32 #include <tools/string.hxx> 33 34 ////////////////////////////////////////////////////////////////////////////// 35 36 namespace drawinglayer 37 { 38 namespace primitive2d 39 { 40 /** TextHierarchyLinePrimitive2D class 41 42 Text format hierarchy helper class. It decomposes to it's 43 content, so all direct renderers may ignore it. If You need 44 to know more about line hierarchies You may react on it and 45 also need to take care that the source of data uses it. 46 47 This primitive encapsulates text lines. 48 */ 49 class TextHierarchyLinePrimitive2D : public GroupPrimitive2D 50 { 51 private: 52 public: 53 /// constructor 54 TextHierarchyLinePrimitive2D(const Primitive2DSequence& rChildren); 55 56 /// provide unique ID 57 DeclPrimitrive2DIDBlock() 58 }; 59 } // end of namespace primitive2d 60 } // end of namespace drawinglayer 61 62 ////////////////////////////////////////////////////////////////////////////// 63 64 namespace drawinglayer 65 { 66 namespace primitive2d 67 { 68 /** TextHierarchyBulletPrimitive2D class 69 70 This primitive encapsulates text bullets. 71 */ 72 class TextHierarchyBulletPrimitive2D : public GroupPrimitive2D 73 { 74 private: 75 public: 76 /// constructor 77 TextHierarchyBulletPrimitive2D(const Primitive2DSequence& rChildren); 78 79 /// provide unique ID 80 DeclPrimitrive2DIDBlock() 81 }; 82 } // end of namespace primitive2d 83 } // end of namespace drawinglayer 84 85 ////////////////////////////////////////////////////////////////////////////// 86 87 namespace drawinglayer 88 { 89 namespace primitive2d 90 { 91 /** TextHierarchyParagraphPrimitive2D class 92 93 This primitive encapsulates text paragraphs. 94 */ 95 class TextHierarchyParagraphPrimitive2D : public GroupPrimitive2D 96 { 97 private: 98 public: 99 /// constructor 100 TextHierarchyParagraphPrimitive2D(const Primitive2DSequence& rChildren); 101 102 /// provide unique ID 103 DeclPrimitrive2DIDBlock() 104 }; 105 } // end of namespace primitive2d 106 } // end of namespace drawinglayer 107 108 ////////////////////////////////////////////////////////////////////////////// 109 110 namespace drawinglayer 111 { 112 namespace primitive2d 113 { 114 /** TextHierarchyBlockPrimitive2D class 115 116 This primitive encapsulates text blocks. 117 */ 118 class TextHierarchyBlockPrimitive2D : public GroupPrimitive2D 119 { 120 private: 121 public: 122 /// constructor 123 TextHierarchyBlockPrimitive2D(const Primitive2DSequence& rChildren); 124 125 /// provide unique ID 126 DeclPrimitrive2DIDBlock() 127 }; 128 } // end of namespace primitive2d 129 } // end of namespace drawinglayer 130 131 ////////////////////////////////////////////////////////////////////////////// 132 133 namespace drawinglayer 134 { 135 namespace primitive2d 136 { 137 /** FieldType definition */ 138 enum FieldType 139 { 140 /** unspecified. If more info is needed for a FieldType, 141 create a new type and it's handling 142 */ 143 FIELD_TYPE_COMMON, 144 145 /** uses "FIELD_SEQ_BEGIN;PageField" -> special handling */ 146 FIELD_TYPE_PAGE, 147 148 /** uses URL as string -> special handling */ 149 FIELD_TYPE_URL 150 }; 151 152 /** TextHierarchyFieldPrimitive2D class 153 154 This primitive encapsulates text fields. 155 Also: This type uses a type enum to transport the encapsulated field 156 type. Also added is a String which is type-dependent. E.g. for URL 157 fields, it contains the URL. 158 */ 159 class TextHierarchyFieldPrimitive2D : public GroupPrimitive2D 160 { 161 private: 162 FieldType meType; 163 rtl::OUString maString; 164 165 public: 166 /// constructor 167 TextHierarchyFieldPrimitive2D( 168 const Primitive2DSequence& rChildren, 169 const FieldType& rFieldType, 170 const rtl::OUString& rString); 171 172 /// data read access 173 FieldType getType() const { return meType; } 174 const rtl::OUString& getString() const { return maString; } 175 176 /// compare operator 177 virtual bool operator==(const BasePrimitive2D& rPrimitive) const; 178 179 /// provide unique ID 180 DeclPrimitrive2DIDBlock() 181 }; 182 } // end of namespace primitive2d 183 } // end of namespace drawinglayer 184 185 ////////////////////////////////////////////////////////////////////////////// 186 187 namespace drawinglayer 188 { 189 namespace primitive2d 190 { 191 /** TextHierarchyEditPrimitive2D class 192 193 #i97628# 194 Primitive to encapsulate text from an active text edit; some 195 renderers need to suppress this output due to painting the 196 edited text in e.g. an OutlinerEditView. It's derived from 197 GroupPrimitive2D, so the implicit decomposition will use the 198 content. To suppress, this primitive needs to be parsed by 199 the renderer without taking any action. 200 */ 201 class TextHierarchyEditPrimitive2D : public GroupPrimitive2D 202 { 203 private: 204 public: 205 /// constructor 206 TextHierarchyEditPrimitive2D(const Primitive2DSequence& rChildren); 207 208 /// provide unique ID 209 DeclPrimitrive2DIDBlock() 210 }; 211 } // end of namespace primitive2d 212 } // end of namespace drawinglayer 213 214 ////////////////////////////////////////////////////////////////////////////// 215 216 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTHIERARCHYPRIMITIVE2D_HXX 217 218 ////////////////////////////////////////////////////////////////////////////// 219 // eof 220