LibreOffice Module sd (master) 1
text.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include "epptbase.hxx"
23
24#include <com/sun/star/awt/FontDescriptor.hpp>
25#include <com/sun/star/lang/Locale.hpp>
26#include <editeng/svxenum.hxx>
27#include <vector>
28#include <memory>
29
30namespace com::sun::star {
31 namespace awt { struct FontDescriptor; }
32 namespace beans { class XPropertyState; }
33 namespace text { class XTextRange; class XTextContent; class XSimpleText; }
34 namespace style { struct TabStop; }
35}
36
38{
40 sal_uInt32 nParaFlags;
41 sal_Int16 nBulletFlags;
42 OUString sPrefix;
43 OUString sSuffix;
44 OUString sGraphicUrl; // String to a graphic
47 sal_uInt32 nHorzAdjust;
48 sal_uInt32 nBulletColor;
49 sal_Int32 nBulletOfs;
50 sal_Int16 nStartWith; // start of numbering
51 sal_Int16 nTextOfs;
52 sal_Int16 nBulletRealSize; // scale in percent
53 sal_Int16 nDepth; // actual depth
54 sal_Unicode cBulletId; // if Numbering Type == CharSpecial
55 css::awt::FontDescriptor aFontDesc;
56
58 sal_uInt16 nBulletId;
59 sal_uInt32 nMappedNumType;
61
63 : bExtendedParameters(false)
64 , nParaFlags(0)
65 , nBulletFlags(0)
67 , nHorzAdjust(0)
68 , nBulletColor(0)
69 , nBulletOfs(0)
70 , nStartWith(0)
71 , nTextOfs(0)
73 , nDepth(0)
74 , cBulletId(0)
76 , nBulletId(0xffff)
78 , bNumberingIsNumber(true)
79 {
80 }
81};
82
84{
85public:
87 : PropValue()
88 , ePropState(css::beans::PropertyState_AMBIGUOUS_VALUE)
89 {
90 }
91protected:
92 css::beans::PropertyState ePropState;
93 css::uno::Reference < css::beans::XPropertyState > mXPropState;
94
95 bool ImplGetPropertyValue( const OUString& rString, bool bGetPropertyState );
96};
97
99{
100 sal_uInt32 nFieldType;
101 sal_uInt32 nFieldStartPos;
102 sal_uInt32 nFieldEndPos;
104 OUString aFieldUrl;
105
106 FieldEntry( sal_uInt32 nType, sal_uInt32 nStart, sal_uInt32 nEnd )
107 : nFieldType(nType),
108 nFieldStartPos(nStart),
109 nFieldEndPos(nEnd)
110 {
111 }
112};
113
114class PortionObj final : public PropStateValue
115{
116
117 friend class ParagraphObj;
118
119 void ImplClear();
120 void ImplConstruct( const PortionObj& rPortionObj );
121 static sal_uInt32 ImplGetTextField( css::uno::Reference< css::text::XTextRange > & rXTextRangeRef,
122 const css::uno::Reference< css::beans::XPropertySet > & rXPropSetRef, OUString& rURL );
123 sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
124 void ImplGetPortionValues( FontCollection& rFontCollection, bool bGetPropStateValue );
125
126 public:
127
128 css::beans::PropertyState meCharColor;
129 css::beans::PropertyState meCharHeight;
130 css::beans::PropertyState meFontName;
131 css::beans::PropertyState meAsianOrComplexFont;
132 css::beans::PropertyState meCharEscapement;
133 css::lang::Locale meCharLocale;
134 sal_uInt16 mnCharAttrHard;
135
136 sal_uInt32 mnCharColor;
137 sal_uInt16 mnCharAttr;
138 sal_uInt16 mnCharHeight;
139 sal_uInt16 mnFont;
142
143 sal_uInt32 mnTextSize;
145
146 std::unique_ptr<sal_uInt16[]> mpText;
147 std::unique_ptr<FieldEntry> mpFieldEntry;
148
149 PortionObj( css::uno::Reference< css::text::XTextRange > & rXTextRangeRef,
150 bool bLast, FontCollection& rFontCollection );
151 PortionObj( const css::uno::Reference< css::beans::XPropertySet > & rXPropSetRef,
152 FontCollection& rFontCollection );
153 PortionObj( const PortionObj& rPortionObj );
154 ~PortionObj();
155
156 void Write( SvStream* pStrm, bool bLast );
157 sal_uInt32 Count() const { return mnTextSize; };
158
159 PortionObj& operator=( const PortionObj& rPortionObj );
160};
161
163{
166
168};
169
171{
172 friend class TextObj;
173 friend struct PPTExParaSheet;
174
175 std::vector<std::unique_ptr<PortionObj> > mvPortions;
176
177 protected:
178
179 void ImplConstruct( const ParagraphObj& rParagraphObj );
180 void ImplClear();
181 sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
182 void ImplGetParagraphValues( PPTExBulletProvider* pBuProv, bool bGetPropStateValue );
183 void ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int16 nDepth, bool bIsBullet, bool bGetPropStateValue );
184
185 public:
186
187 css::uno::Sequence< css::style::TabStop > maTabStop;
188
189 sal_uInt32 mnTextSize;
190
194
195 css::beans::PropertyState meBullet;
196 css::beans::PropertyState meTextAdjust;
197 css::beans::PropertyState meLineSpacing;
198 css::beans::PropertyState meLineSpacingTop;
199 css::beans::PropertyState meLineSpacingBottom;
200 css::beans::PropertyState meForbiddenRules;
201 css::beans::PropertyState meParagraphPunctation;
202 css::beans::PropertyState meBiDi;
203
204 sal_uInt16 mnTextAdjust;
205 sal_Int16 mnLineSpacing;
211 sal_uInt16 mnBiDi;
212
213 ParagraphObj( css::uno::Reference< css::text::XTextContent > const & rXTextContentRef,
214 ParaFlags, FontCollection& rFontCollection,
215 PPTExBulletProvider& rBuProv );
216 ParagraphObj( const ParagraphObj& rParargraphObj ) = delete;
217 ParagraphObj( const css::uno::Reference< css::beans::XPropertySet > & rXPropSetRef,
218 PPTExBulletProvider* pBuProv );
219
220 bool empty() const { return mvPortions.empty(); }
221
222 const PortionObj& front() const { return *mvPortions.front(); }
223
224 std::vector<std::unique_ptr<PortionObj> >::const_iterator begin() const { return mvPortions.begin(); }
225 std::vector<std::unique_ptr<PortionObj> >::const_iterator end() const { return mvPortions.end(); }
226
227 void CalculateGraphicBulletSize( sal_uInt16 nFontHeight );
229
230 void Write( SvStream* pStrm );
231 sal_uInt32 CharacterCount() const { return mnTextSize; };
232
233 ParagraphObj& operator=( const ParagraphObj& rParagraphObj );
234};
235
236struct ImplTextObj;
237
239{
240 std::shared_ptr<ImplTextObj> mpImplTextObj;
242
243public:
244 TextObj( css::uno::Reference< css::text::XSimpleText > const &
245 rXText, int nInstance, FontCollection& rFontCollection, PPTExBulletProvider& rBuProv );
246
247 ParagraphObj* GetParagraph(int idx);
248 sal_uInt32 ParagraphCount() const;
249 sal_uInt32 Count() const;
250 int GetInstance() const;
251 bool HasExtendedBullets() const;
252};
253
254/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::beans::PropertyState meLineSpacingBottom
Definition: text.hxx:199
void ImplConstruct(const ParagraphObj &rParagraphObj)
Definition: pptx-text.cxx:1179
sal_Int16 mnLineSpacingBottom
Definition: text.hxx:208
std::vector< std::unique_ptr< PortionObj > >::const_iterator begin() const
Definition: text.hxx:224
bool mbParagraphPunctation
Definition: text.hxx:210
sal_uInt32 mnTextSize
Definition: text.hxx:189
bool empty() const
Definition: text.hxx:220
std::vector< std::unique_ptr< PortionObj > > mvPortions
Definition: text.hxx:175
css::beans::PropertyState meBiDi
Definition: text.hxx:202
void ImplGetNumberingLevel(PPTExBulletProvider *pBuProv, sal_Int16 nDepth, bool bIsBullet, bool bGetPropStateValue)
Definition: pptx-text.cxx:768
bool mbFirstParagraph
Definition: text.hxx:192
css::beans::PropertyState meBullet
Definition: text.hxx:195
ParagraphObj & operator=(const ParagraphObj &rParagraphObj)
Definition: pptx-text.cxx:1236
css::beans::PropertyState meLineSpacingTop
Definition: text.hxx:198
bool mbIsBullet
Definition: text.hxx:191
ParagraphObj(css::uno::Reference< css::text::XTextContent > const &rXTextContentRef, ParaFlags, FontCollection &rFontCollection, PPTExBulletProvider &rBuProv)
Definition: pptx-text.cxx:676
sal_uInt32 CharacterCount() const
Definition: text.hxx:231
bool mbFixedLineSpacing
Definition: text.hxx:206
css::uno::Sequence< css::style::TabStop > maTabStop
Definition: text.hxx:187
void ImplGetParagraphValues(PPTExBulletProvider *pBuProv, bool bGetPropStateValue)
Definition: pptx-text.cxx:1066
css::beans::PropertyState meForbiddenRules
Definition: text.hxx:200
sal_Int16 mnLineSpacingTop
Definition: text.hxx:207
const PortionObj & front() const
Definition: text.hxx:222
sal_uInt32 ImplCalculateTextPositions(sal_uInt32 nCurrentTextPosition)
Definition: pptx-text.cxx:1228
sal_uInt16 mnTextAdjust
Definition: text.hxx:204
bool mbForbiddenRules
Definition: text.hxx:209
sal_Int16 mnLineSpacing
Definition: text.hxx:205
sal_uInt16 mnBiDi
Definition: text.hxx:211
void Write(SvStream *pStrm)
Definition: pptx-text.cxx:739
void ImplClear()
Definition: pptx-text.cxx:745
void CalculateGraphicBulletSize(sal_uInt16 nFontHeight)
Definition: pptx-text.cxx:750
bool mbLastParagraph
Definition: text.hxx:193
ParagraphObj(const ParagraphObj &rParargraphObj)=delete
css::beans::PropertyState meParagraphPunctation
Definition: text.hxx:201
std::vector< std::unique_ptr< PortionObj > >::const_iterator end() const
Definition: text.hxx:225
css::beans::PropertyState meTextAdjust
Definition: text.hxx:196
css::beans::PropertyState meLineSpacing
Definition: text.hxx:197
sal_uInt16 mnCharHeight
Definition: text.hxx:138
std::unique_ptr< FieldEntry > mpFieldEntry
Definition: text.hxx:147
sal_uInt32 mnTextSize
Definition: text.hxx:143
css::beans::PropertyState meCharColor
Definition: text.hxx:128
static sal_uInt32 ImplGetTextField(css::uno::Reference< css::text::XTextRange > &rXTextRangeRef, const css::uno::Reference< css::beans::XPropertySet > &rXPropSetRef, OUString &rURL)
Definition: pptx-text.cxx:495
sal_uInt16 mnCharAttr
Definition: text.hxx:137
css::beans::PropertyState meCharEscapement
Definition: text.hxx:132
PortionObj(css::uno::Reference< css::text::XTextRange > &rXTextRangeRef, bool bLast, FontCollection &rFontCollection)
Definition: pptx-text.cxx:83
css::beans::PropertyState meAsianOrComplexFont
Definition: text.hxx:131
css::lang::Locale meCharLocale
Definition: text.hxx:133
void ImplGetPortionValues(FontCollection &rFontCollection, bool bGetPropStateValue)
Definition: pptx-text.cxx:236
sal_uInt16 mnCharAttrHard
Definition: text.hxx:134
bool mbLastPortion
Definition: text.hxx:144
sal_uInt16 mnFont
Definition: text.hxx:139
sal_uInt32 mnCharColor
Definition: text.hxx:136
std::unique_ptr< sal_uInt16[]> mpText
Definition: text.hxx:146
PortionObj & operator=(const PortionObj &rPortionObj)
Definition: pptx-text.cxx:640
css::beans::PropertyState meCharHeight
Definition: text.hxx:129
void ImplConstruct(const PortionObj &rPortionObj)
Definition: pptx-text.cxx:444
void ImplClear()
Definition: pptx-text.cxx:438
sal_uInt32 Count() const
Definition: text.hxx:157
sal_uInt32 ImplCalculateTextPositions(sal_uInt32 nCurrentTextPosition)
Definition: pptx-text.cxx:473
css::beans::PropertyState meFontName
Definition: text.hxx:130
void Write(SvStream *pStrm, bool bLast)
Definition: pptx-text.cxx:227
sal_Int16 mnCharEscapement
Definition: text.hxx:141
sal_uInt16 mnAsianOrComplexFont
Definition: text.hxx:140
bool ImplGetPropertyValue(const OUString &rString, bool bGetPropertyState)
Definition: epptso.cxx:597
css::beans::PropertyState ePropState
Definition: text.hxx:92
PropStateValue()
Definition: text.hxx:86
css::uno::Reference< css::beans::XPropertyState > mXPropState
Definition: text.hxx:93
int GetInstance() const
Definition: pptx-text.cxx:1316
sal_uInt32 ParagraphCount() const
Definition: pptx-text.cxx:1306
TextObj(css::uno::Reference< css::text::XSimpleText > const &rXText, int nInstance, FontCollection &rFontCollection, PPTExBulletProvider &rBuProv)
Definition: pptx-text.cxx:1263
void ImplCalculateTextPositions()
Definition: pptx-text.cxx:1294
ParagraphObj * GetParagraph(int idx)
Definition: pptx-text.cxx:1301
sal_uInt32 Count() const
Definition: pptx-text.cxx:1311
std::shared_ptr< ImplTextObj > mpImplTextObj
Definition: text.hxx:240
bool HasExtendedBullets() const
Definition: pptx-text.cxx:1321
def text(shape, orig_st)
QPRO_FUNC_TYPE nType
OUString aRepresentation
Definition: text.hxx:103
sal_uInt32 nFieldEndPos
Definition: text.hxx:102
FieldEntry(sal_uInt32 nType, sal_uInt32 nStart, sal_uInt32 nEnd)
Definition: text.hxx:106
OUString aFieldUrl
Definition: text.hxx:104
sal_uInt32 nFieldStartPos
Definition: text.hxx:101
sal_uInt32 nFieldType
Definition: text.hxx:100
PPTExBulletProvider * pBuProv
Definition: epptbase.hxx:285
ParaFlags()
Definition: text.hxx:167
bool bLastParagraph
Definition: text.hxx:165
bool bFirstParagraph
Definition: text.hxx:164
sal_Int16 nBulletFlags
Definition: text.hxx:41
bool bNumberingIsNumber
Definition: text.hxx:60
SvxNumType nNumberingType
Definition: text.hxx:46
bool bExtendedParameters
Definition: text.hxx:39
css::awt::FontDescriptor aFontDesc
Definition: text.hxx:55
sal_uInt32 nMappedNumType
Definition: text.hxx:59
OUString sGraphicUrl
Definition: text.hxx:44
SOParagraph()
Definition: text.hxx:62
sal_uInt16 nBulletId
Definition: text.hxx:58
sal_uInt32 nHorzAdjust
Definition: text.hxx:47
bool bExtendedBulletsUsed
Definition: text.hxx:57
sal_uInt32 nParaFlags
Definition: text.hxx:40
OUString sPrefix
Definition: text.hxx:42
sal_Int16 nBulletRealSize
Definition: text.hxx:52
sal_Int16 nDepth
Definition: text.hxx:53
sal_Int16 nTextOfs
Definition: text.hxx:51
sal_Int32 nBulletOfs
Definition: text.hxx:49
sal_uInt32 nBulletColor
Definition: text.hxx:48
Size aBuGraSize
Definition: text.hxx:45
sal_Unicode cBulletId
Definition: text.hxx:54
sal_Int16 nStartWith
Definition: text.hxx:50
OUString sSuffix
Definition: text.hxx:43
SvxNumType
SVX_NUM_NUMBER_NONE
sal_uInt16 sal_Unicode