Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef EPPT_TEXT_HXX
30 : : #define EPPT_TEXT_HXX
31 : :
32 : : #include "epptbase.hxx"
33 : : #include "epptdef.hxx"
34 : :
35 : : #include <rtl/textenc.h>
36 : : #include <com/sun/star/awt/FontDescriptor.hpp>
37 : : #include <com/sun/star/lang/Locale.hpp>
38 : :
39 : : namespace com { namespace sun { namespace star {
40 : : namespace awt { struct FontDescriptor; }
41 : : namespace beans { class XPropertyState; }
42 : : namespace text { class XTextRange; class XTextContent; class XSimpleText; }
43 : : namespace style { struct TabStop; }
44 : : }}}
45 : :
46 [ # # ][ # # ]: 0 : struct SOParagraph
47 : : {
48 : : sal_Bool bExtendedParameters;
49 : : sal_uInt32 nParaFlags;
50 : : sal_Int16 nBulletFlags;
51 : : String sPrefix;
52 : : String sSuffix;
53 : : String sGraphicUrl; // String auf eine Graphic
54 : : Size aBuGraSize;
55 : : sal_uInt32 nNumberingType; // in wirlichkeit ist dies ein SvxEnum
56 : : sal_uInt32 nHorzAdjust;
57 : : sal_uInt32 nBulletColor;
58 : : sal_Int32 nBulletOfs;
59 : : sal_Int16 nStartWith; // Start der nummerierung
60 : : sal_Int16 nTextOfs;
61 : : sal_Int16 nBulletRealSize; // GroessenVerhaeltnis in Proz
62 : : sal_Int16 nDepth; // aktuelle tiefe
63 : : sal_Unicode cBulletId; // wenn Numbering Type == CharSpecial
64 : : ::com::sun::star::awt::FontDescriptor aFontDesc;
65 : :
66 : : sal_Bool bExtendedBulletsUsed;
67 : : sal_uInt16 nBulletId;
68 : : sal_uInt32 nMappedNumType;
69 : : sal_Bool bNumberingIsNumber;
70 : :
71 : 0 : SOParagraph()
72 [ # # ][ # # ]: 0 : {
73 : 0 : nDepth = 0;
74 : 0 : bExtendedParameters = sal_False;
75 : 0 : nParaFlags = 0;
76 : 0 : nBulletFlags = 0;
77 : 0 : nBulletOfs = 0;
78 : 0 : nTextOfs = 0;
79 : 0 : bExtendedBulletsUsed = sal_False;
80 : 0 : nBulletId = 0xffff;
81 : 0 : bNumberingIsNumber = sal_True;
82 : 0 : };
83 : : };
84 : :
85 : 0 : class PropStateValue : public PropValue
86 : : {
87 : : protected :
88 : :
89 : : ::com::sun::star::beans::PropertyState ePropState;
90 : : ::com::sun::star::uno::Reference
91 : : < ::com::sun::star::beans::XPropertyState > mXPropState;
92 : :
93 : : sal_Bool ImplGetPropertyValue( const String& rString, sal_Bool bGetPropertyState = sal_True );
94 : :
95 : : };
96 : :
97 [ # # ][ # # ]: 0 : struct FieldEntry
98 : : {
99 : : sal_uInt32 nFieldType;
100 : : sal_uInt32 nFieldStartPos;
101 : : sal_uInt32 nFieldEndPos;
102 : : String aRepresentation;
103 : : String aFieldUrl;
104 : :
105 : 0 : FieldEntry( sal_uInt32 nType, sal_uInt32 nStart, sal_uInt32 nEnd )
106 [ # # ]: 0 : {
107 : 0 : nFieldType = nType;
108 : 0 : nFieldStartPos = nStart;
109 : 0 : nFieldEndPos = nEnd;
110 : 0 : }
111 : : };
112 : :
113 : : class PortionObj : public PropStateValue
114 : : {
115 : :
116 : : friend class ParagraphObj;
117 : :
118 : : protected :
119 : :
120 : : void ImplClear();
121 : : void ImplConstruct( const PortionObj& rPortionObj );
122 : : sal_uInt32 ImplGetTextField( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRangeRef,
123 : : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef, String& rURL );
124 : : sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
125 : : void ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool bGetPropStateValue = sal_False );
126 : :
127 : : public :
128 : :
129 : : ::com::sun::star::beans::PropertyState meCharColor;
130 : : ::com::sun::star::beans::PropertyState meCharHeight;
131 : : ::com::sun::star::beans::PropertyState meFontName;
132 : : ::com::sun::star::beans::PropertyState meAsianOrComplexFont;
133 : : ::com::sun::star::beans::PropertyState meCharEscapement;
134 : : ::com::sun::star::lang::Locale meCharLocale;
135 : : sal_uInt16 mnCharAttrHard;
136 : :
137 : : sal_uInt32 mnCharColor;
138 : : sal_uInt16 mnCharAttr;
139 : : sal_uInt16 mnCharHeight;
140 : : sal_uInt16 mnFont;
141 : : sal_uInt16 mnAsianOrComplexFont;
142 : : sal_Int16 mnCharEscapement;
143 : :
144 : : sal_uInt32 mnTextSize;
145 : : sal_Bool mbLastPortion;
146 : :
147 : : sal_uInt16* mpText;
148 : : FieldEntry* mpFieldEntry;
149 : :
150 : : PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRangeRef,
151 : : sal_Bool bLast, FontCollection& rFontCollection );
152 : : PortionObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef,
153 : : FontCollection& rFontCollection );
154 : : PortionObj( const PortionObj& rPortionObj );
155 : : ~PortionObj();
156 : :
157 : : void Write( SvStream* pStrm, sal_Bool bLast );
158 : 0 : sal_uInt32 Count() const { return mnTextSize; };
159 : :
160 : : PortionObj& operator=( const PortionObj& rPortionObj );
161 : : };
162 : :
163 : : struct ParaFlags
164 : : {
165 : : sal_Bool bFirstParagraph : 1;
166 : : sal_Bool bLastParagraph : 1;
167 : :
168 : 0 : ParaFlags() { bFirstParagraph = sal_True; bLastParagraph = sal_False; };
169 : : };
170 : :
171 : : class ParagraphObj : public std::vector<PortionObj*>, public PropStateValue, public SOParagraph
172 : : {
173 : : friend class TextObj;
174 : : friend struct PPTExParaSheet;
175 : :
176 : : MapMode maMapModeSrc;
177 : : MapMode maMapModeDest;
178 : :
179 : : protected :
180 : :
181 : : void ImplConstruct( const ParagraphObj& rParagraphObj );
182 : : void ImplClear();
183 : : sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
184 : : void ImplGetParagraphValues( PPTExBulletProvider& rBuProv, sal_Bool bGetPropStateValue = sal_False );
185 : : void ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nDepth, sal_Bool bIsBullet, sal_Bool bGetPropStateValue = sal_False );
186 : :
187 : : public :
188 : :
189 : : ::com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > maTabStop;
190 : :
191 : : sal_uInt32 mnTextSize;
192 : :
193 : : sal_Bool mbIsBullet;
194 : : sal_Bool mbFirstParagraph;
195 : : sal_Bool mbLastParagraph;
196 : :
197 : : ::com::sun::star::beans::PropertyState meBullet;
198 : : ::com::sun::star::beans::PropertyState meTextAdjust;
199 : : ::com::sun::star::beans::PropertyState meLineSpacing;
200 : : ::com::sun::star::beans::PropertyState meLineSpacingTop;
201 : : ::com::sun::star::beans::PropertyState meLineSpacingBottom;
202 : : ::com::sun::star::beans::PropertyState meForbiddenRules;
203 : : ::com::sun::star::beans::PropertyState meParagraphPunctation;
204 : : ::com::sun::star::beans::PropertyState meBiDi;
205 : :
206 : : sal_uInt16 mnTextAdjust;
207 : : sal_Int16 mnLineSpacing;
208 : : sal_Bool mbFixedLineSpacing;
209 : : sal_Int16 mnLineSpacingTop;
210 : : sal_Int16 mnLineSpacingBottom;
211 : : sal_Bool mbForbiddenRules;
212 : : sal_Bool mbParagraphPunctation;
213 : : sal_uInt16 mnBiDi;
214 : :
215 : : ParagraphObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & rXTextContentRef,
216 : : ParaFlags, FontCollection& rFontCollection,
217 : : PPTExBulletProvider& rBuProv );
218 : : ParagraphObj( const ParagraphObj& rParargraphObj );
219 : : ParagraphObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef,
220 : : PPTExBulletProvider& rBuProv );
221 : :
222 : : void CalculateGraphicBulletSize( sal_uInt16 nFontHeight );
223 : : ~ParagraphObj();
224 : :
225 : : void Write( SvStream* pStrm );
226 : 0 : sal_uInt32 Count() const { return mnTextSize; };
227 : :
228 : : ParagraphObj& operator=( const ParagraphObj& rParagraphObj );
229 : : };
230 : :
231 : : struct ImplTextObj
232 : : {
233 : : sal_uInt32 mnRefCount;
234 : : sal_uInt32 mnTextSize;
235 : : int mnInstance;
236 : : std::vector<ParagraphObj*> maList;
237 : : sal_Bool mbHasExtendedBullets;
238 : : sal_Bool mbFixedCellHeightUsed;
239 : :
240 : : ImplTextObj( int nInstance );
241 : : ~ImplTextObj();
242 : : };
243 : :
244 : : class TextObj
245 : : {
246 : : ImplTextObj* mpImplTextObj;
247 : : void ImplCalculateTextPositions();
248 : :
249 : : public :
250 : : TextObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XSimpleText > &
251 : : rXText, int nInstance, FontCollection& rFontCollection, PPTExBulletProvider& rBuProv );
252 : : TextObj( const TextObj& rTextObj );
253 : : ~TextObj();
254 : :
255 : 0 : ParagraphObj* GetParagraph(int idx) { return mpImplTextObj->maList[idx]; };
256 : 0 : sal_uInt32 ParagraphCount() const { return mpImplTextObj->maList.size(); };
257 : 0 : sal_uInt32 Count() const { return mpImplTextObj->mnTextSize; };
258 : 0 : int GetInstance() const { return mpImplTextObj->mnInstance; };
259 : 0 : sal_Bool HasExtendedBullets(){ return mpImplTextObj->mbHasExtendedBullets; };
260 : : void WriteTextSpecInfo( SvStream* pStrm );
261 : :
262 : : TextObj& operator=( TextObj& rTextObj );
263 : : };
264 : :
265 : : #endif
266 : :
267 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|