bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / filter / eppt / text.hxx
blobc60ae43a323d9230be592bf2183bd470df4539da
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef EPPT_TEXT_HXX
21 #define EPPT_TEXT_HXX
23 #include "epptbase.hxx"
24 #include "epptdef.hxx"
26 #include <rtl/textenc.h>
27 #include <com/sun/star/awt/FontDescriptor.hpp>
28 #include <com/sun/star/lang/Locale.hpp>
29 #include <editeng/svxenum.hxx>
31 #include <boost/shared_ptr.hpp>
33 namespace com { namespace sun { namespace star {
34 namespace awt { struct FontDescriptor; }
35 namespace beans { class XPropertyState; }
36 namespace text { class XTextRange; class XTextContent; class XSimpleText; }
37 namespace style { struct TabStop; }
38 }}}
40 struct SOParagraph
42 sal_Bool bExtendedParameters;
43 sal_uInt32 nParaFlags;
44 sal_Int16 nBulletFlags;
45 String sPrefix;
46 String sSuffix;
47 String sGraphicUrl; // String to a graphic
48 Size aBuGraSize;
49 sal_uInt32 nNumberingType; // this is actually a SvxEnum
50 sal_uInt32 nHorzAdjust;
51 sal_uInt32 nBulletColor;
52 sal_Int32 nBulletOfs;
53 sal_Int16 nStartWith; // start of numbering
54 sal_Int16 nTextOfs;
55 sal_Int16 nBulletRealSize; // scale in percent
56 sal_Int16 nDepth; // actual depth
57 sal_Unicode cBulletId; // if Numbering Type == CharSpecial
58 ::com::sun::star::awt::FontDescriptor aFontDesc;
60 sal_Bool bExtendedBulletsUsed;
61 sal_uInt16 nBulletId;
62 sal_uInt32 nMappedNumType;
63 sal_Bool bNumberingIsNumber;
65 SOParagraph()
66 : bExtendedParameters(false)
67 , nParaFlags(0)
68 , nBulletFlags(0)
69 , nNumberingType(SVX_NUM_NUMBER_NONE)
70 , nHorzAdjust(0)
71 , nBulletColor(0)
72 , nBulletOfs(0)
73 , nStartWith(0)
74 , nTextOfs(0)
75 , nBulletRealSize(0)
76 , nDepth(0)
77 , cBulletId(0)
78 , bExtendedBulletsUsed(false)
79 , nBulletId(0xffff)
80 , nMappedNumType(0)
81 , bNumberingIsNumber(true)
86 class PropStateValue : public PropValue
88 protected :
90 ::com::sun::star::beans::PropertyState ePropState;
91 ::com::sun::star::uno::Reference
92 < ::com::sun::star::beans::XPropertyState > mXPropState;
94 sal_Bool ImplGetPropertyValue( const OUString& rString, sal_Bool bGetPropertyState = sal_True );
98 struct FieldEntry
100 sal_uInt32 nFieldType;
101 sal_uInt32 nFieldStartPos;
102 sal_uInt32 nFieldEndPos;
103 String aRepresentation;
104 String aFieldUrl;
106 FieldEntry( sal_uInt32 nType, sal_uInt32 nStart, sal_uInt32 nEnd )
108 nFieldType = nType;
109 nFieldStartPos = nStart;
110 nFieldEndPos = nEnd;
114 class PortionObj : public PropStateValue
117 friend class ParagraphObj;
119 protected :
121 void ImplClear();
122 void ImplConstruct( const PortionObj& rPortionObj );
123 sal_uInt32 ImplGetTextField( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRangeRef,
124 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef, String& rURL );
125 sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
126 void ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool bGetPropStateValue = sal_False );
128 public :
130 ::com::sun::star::beans::PropertyState meCharColor;
131 ::com::sun::star::beans::PropertyState meCharHeight;
132 ::com::sun::star::beans::PropertyState meFontName;
133 ::com::sun::star::beans::PropertyState meAsianOrComplexFont;
134 ::com::sun::star::beans::PropertyState meCharEscapement;
135 ::com::sun::star::lang::Locale meCharLocale;
136 sal_uInt16 mnCharAttrHard;
138 sal_uInt32 mnCharColor;
139 sal_uInt16 mnCharAttr;
140 sal_uInt16 mnCharHeight;
141 sal_uInt16 mnFont;
142 sal_uInt16 mnAsianOrComplexFont;
143 sal_Int16 mnCharEscapement;
145 sal_uInt32 mnTextSize;
146 sal_Bool mbLastPortion;
148 sal_uInt16* mpText;
149 FieldEntry* mpFieldEntry;
151 PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRangeRef,
152 sal_Bool bLast, FontCollection& rFontCollection );
153 PortionObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef,
154 FontCollection& rFontCollection );
155 PortionObj( const PortionObj& rPortionObj );
156 ~PortionObj();
158 void Write( SvStream* pStrm, sal_Bool bLast );
159 sal_uInt32 Count() const { return mnTextSize; };
161 PortionObj& operator=( const PortionObj& rPortionObj );
164 struct ParaFlags
166 sal_Bool bFirstParagraph : 1;
167 sal_Bool bLastParagraph : 1;
169 ParaFlags() { bFirstParagraph = sal_True; bLastParagraph = sal_False; };
172 class ParagraphObj : public std::vector<PortionObj*>, public PropStateValue, public SOParagraph
174 friend class TextObj;
175 friend struct PPTExParaSheet;
177 MapMode maMapModeSrc;
178 MapMode maMapModeDest;
180 protected :
182 void ImplConstruct( const ParagraphObj& rParagraphObj );
183 void ImplClear();
184 sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
185 void ImplGetParagraphValues( PPTExBulletProvider& rBuProv, sal_Bool bGetPropStateValue = sal_False );
186 void ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nDepth, sal_Bool bIsBullet, sal_Bool bGetPropStateValue = sal_False );
188 public :
190 ::com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > maTabStop;
192 sal_uInt32 mnTextSize;
194 sal_Bool mbIsBullet;
195 sal_Bool mbFirstParagraph;
196 sal_Bool mbLastParagraph;
198 ::com::sun::star::beans::PropertyState meBullet;
199 ::com::sun::star::beans::PropertyState meTextAdjust;
200 ::com::sun::star::beans::PropertyState meLineSpacing;
201 ::com::sun::star::beans::PropertyState meLineSpacingTop;
202 ::com::sun::star::beans::PropertyState meLineSpacingBottom;
203 ::com::sun::star::beans::PropertyState meForbiddenRules;
204 ::com::sun::star::beans::PropertyState meParagraphPunctation;
205 ::com::sun::star::beans::PropertyState meBiDi;
207 sal_uInt16 mnTextAdjust;
208 sal_Int16 mnLineSpacing;
209 sal_Bool mbFixedLineSpacing;
210 sal_Int16 mnLineSpacingTop;
211 sal_Int16 mnLineSpacingBottom;
212 sal_Bool mbForbiddenRules;
213 sal_Bool mbParagraphPunctation;
214 sal_uInt16 mnBiDi;
216 ParagraphObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & rXTextContentRef,
217 ParaFlags, FontCollection& rFontCollection,
218 PPTExBulletProvider& rBuProv );
219 ParagraphObj( const ParagraphObj& rParargraphObj );
220 ParagraphObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef,
221 PPTExBulletProvider& rBuProv );
223 void CalculateGraphicBulletSize( sal_uInt16 nFontHeight );
224 ~ParagraphObj();
226 void Write( SvStream* pStrm );
227 sal_uInt32 CharacterCount() const { return mnTextSize; };
229 ParagraphObj& operator=( const ParagraphObj& rParagraphObj );
232 struct ImplTextObj;
234 class TextObj
236 boost::shared_ptr<ImplTextObj> mpImplTextObj;
237 void ImplCalculateTextPositions();
239 public :
240 TextObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XSimpleText > &
241 rXText, int nInstance, FontCollection& rFontCollection, PPTExBulletProvider& rBuProv );
243 ParagraphObj* GetParagraph(int idx);
244 sal_uInt32 ParagraphCount() const;
245 sal_uInt32 Count() const;
246 int GetInstance() const;
247 sal_Bool HasExtendedBullets();
248 void WriteTextSpecInfo( SvStream* pStrm );
251 #endif
253 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */