LibreOffice Module sw (master) 1
swatrset.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#ifndef INCLUDED_SW_INC_SWATRSET_HXX
20#define INCLUDED_SW_INC_SWATRSET_HXX
21
22#include <svl/itemset.hxx>
23#include <svl/itempool.hxx>
24#include "swdllapi.h"
25#include "calbck.hxx"
26
27class SwDoc;
28class OutputDevice;
30class SvxPostureItem;
31class SvxWeightItem;
32class SvxShadowedItem;
33class SvxAutoKernItem;
35class SvxContourItem;
36class SvxKerningItem;
38class SvxOverlineItem;
41class SvxFontItem;
42class SvxColorItem;
43class SvxLanguageItem;
45class SvxCaseMapItem;
46class SvxNoHyphenItem;
47class SvxBlinkItem;
49class SvxTwoLinesItem;
54
55// Frame attributes
58class SvxPaperBinItem;
59class SvxLRSpaceItem;
60class SvxULSpaceItem;
61class SwFormatContent;
62class SwFormatHeader;
63class SwFormatFooter;
64class SvxPrintItem;
65class SvxOpaqueItem;
66class SvxProtectItem;
70class SwFormatAnchor;
71class SvxBoxItem;
72class SvxBrushItem;
73class SvxShadowItem;
76class SwFormatCol;
77class SvxMacroItem;
79class SwFormatURL;
85class SwFormatChain;
94
95// Graphic attributes
96class SwMirrorGrf;
97class SwCropGrf;
98class SwRotationGrf;
99class SwLuminanceGrf;
100class SwContrastGrf;
101class SwChannelRGrf;
102class SwChannelGGrf;
103class SwChannelBGrf;
104class SwGammaGrf;
105class SwInvertGrf;
107class SwDrawModeGrf;
108
109// Paragraph attributes
111class SvxAdjustItem;
113class SwRegisterItem;
114class SwNumRuleItem;
115class SvxWidowsItem;
116class SvxOrphansItem;
117class SvxTabStopItem;
119class SwFormatDrop;
124class SvxParaGridItem;
126
127// TableBox attributes
130class SwTableBoxValue;
131
132namespace vcl {
134};
135
136class SAL_DLLPUBLIC_RTTI SwAttrPool final : public SfxItemPool
137{
138private:
139 friend void InitCore(); // For creating/deleting of version maps.
140 friend void FinitCore();
141
143
144public:
145 SwAttrPool( SwDoc* pDoc );
146private:
147 virtual ~SwAttrPool() override;
148public:
149
150 SwDoc* GetDoc() { return m_pDoc; }
151 const SwDoc* GetDoc() const { return m_pDoc; }
152
153};
154
156{
157 // Pointer for Modify-System
158 SwAttrSet *m_pOldSet, *m_pNewSet;
159
160 // Notification-Callback
161 virtual void Changed( const SfxPoolItem& rOld, const SfxPoolItem& rNew ) override;
162
163 void PutChgd( const SfxPoolItem& rI ) { SfxItemSet::PutDirect( rI ); }
164public:
165 SwAttrSet( SwAttrPool&, sal_uInt16 nWhich1, sal_uInt16 nWhich2 );
166 SwAttrSet( SwAttrPool&, const WhichRangesContainer& nWhichPairTable );
167 SwAttrSet( const SwAttrSet& );
168
169 virtual std::unique_ptr<SfxItemSet> Clone(bool bItems = true, SfxItemPool *pToPool = nullptr) const override;
170
171 bool Put_BC( const SfxPoolItem& rAttr, SwAttrSet* pOld, SwAttrSet* pNew );
172 bool Put_BC( const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew );
173
174 // Delete an item or a range.
175 sal_uInt16 ClearItem_BC( sal_uInt16 nWhich, SwAttrSet* pOld, SwAttrSet* pNew );
176 sal_uInt16 ClearItem_BC( sal_uInt16 nWhich1, sal_uInt16 nWhich2,
177 SwAttrSet* pOld = nullptr, SwAttrSet* pNew = nullptr );
178
179 int Intersect_BC( const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew );
180
181 void GetPresentation( SfxItemPresentation ePres,
182 MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText ) const;
183
184 SwAttrPool* GetPool() const { return static_cast<SwAttrPool*>(SfxItemSet::GetPool()); }
185
186 // Copy attributes, if necessary across documents.
187 void CopyToModify( sw::BroadcastingModify& rMod ) const;
188
189 // Special treatment for some attributes.
190 // Set Modify-pointer (the old pDefinedIn) at the following attributes:
191 // - SwFormatDropCaps
192 // - SwFormatPageDesc
193 // (Is called at insert in formats/nodes.)
194 // Second version is for the SwAttrSet handles of SwContentNode.
195 bool SetModifyAtAttr( const sw::BroadcastingModify* pModify );
196
197 // Document is set at SwAttrPool. Therefore it is always accessible.
198 const SwDoc *GetDoc() const { return GetPool()->GetDoc(); }
199 SwDoc *GetDoc() { return GetPool()->GetDoc(); }
200
201 // Get methods: bool indicates whether to search only in Set (when false)
202 // or also in parents. If nothing is found then default attribute is returned.
203 // Character attributes. Implementation in charatr.hxx.
204 inline const SvxPostureItem &GetPosture( bool = true ) const;
205 inline const SvxWeightItem &GetWeight( bool = true ) const;
206 inline const SvxShadowedItem &GetShadowed( bool = true ) const;
207 inline const SvxAutoKernItem &GetAutoKern( bool = true ) const;
208 inline const SvxWordLineModeItem &GetWordLineMode( bool = true ) const;
209 inline const SvxContourItem &GetContour( bool = true ) const;
210 inline const SvxKerningItem &GetKerning( bool = true ) const;
211 inline const SvxUnderlineItem &GetUnderline( bool = true ) const;
212 inline const SvxOverlineItem &GetOverline( bool = true ) const;
213 inline const SvxCrossedOutItem &GetCrossedOut( bool = true ) const;
214 inline const SvxFontHeightItem &GetSize( bool = true ) const;
215 inline const SvxFontItem &GetFont( bool = true ) const;
216 inline const SvxColorItem &GetColor( bool = true ) const;
217 inline const SvxLanguageItem &GetLanguage( bool = true ) const;
218 inline const SvxEscapementItem &GetEscapement( bool = true ) const;
219 inline const SvxCaseMapItem &GetCaseMap( bool = true ) const;
220 inline const SvxNoHyphenItem &GetNoHyphenHere( bool = true ) const;
221 inline const SvxFontItem &GetCJKFont( bool = true ) const;
222 inline const SvxFontHeightItem &GetCJKSize( bool = true ) const;
223 inline const SvxLanguageItem &GetCJKLanguage( bool = true ) const;
224 inline const SvxPostureItem &GetCJKPosture( bool = true ) const;
225 inline const SvxWeightItem &GetCJKWeight( bool = true ) const;
226 inline const SvxFontItem &GetCTLFont( bool = true ) const;
227 inline const SvxFontHeightItem &GetCTLSize( bool = true ) const;
228 inline const SvxLanguageItem &GetCTLLanguage( bool = true ) const;
229 inline const SvxPostureItem &GetCTLPosture( bool = true ) const;
230 inline const SvxWeightItem &GetCTLWeight( bool = true ) const;
231 inline const SvxEmphasisMarkItem &GetEmphasisMark( bool = true ) const;
232 inline const SvxTwoLinesItem &Get2Lines( bool = true ) const;
233 inline const SvxCharScaleWidthItem &GetCharScaleW( bool = true ) const;
234 inline const SvxCharRotateItem &GetCharRotate( bool = true ) const;
235 inline const SvxCharReliefItem &GetCharRelief( bool = true ) const;
236 inline const SvxCharHiddenItem &GetCharHidden( bool = true ) const;
237
238 // Frame attributes. Implementation in frmatr.hxx.
239 inline const SwFormatFillOrder &GetFillOrder( bool = true ) const;
240 inline const SwFormatFrameSize &GetFrameSize( bool = true ) const;
241 inline const SvxPaperBinItem &GetPaperBin( bool = true ) const;
242 inline const SvxLRSpaceItem &GetLRSpace( bool = true ) const;
243 inline const SvxULSpaceItem &GetULSpace( bool = true ) const;
244 inline const SwFormatContent &GetContent( bool = true ) const;
245 inline const SwFormatHeader &GetHeader( bool = true ) const;
246 inline const SwFormatFooter &GetFooter( bool = true ) const;
247 inline const SvxPrintItem &GetPrint( bool = true ) const;
248 inline const SvxOpaqueItem &GetOpaque( bool = true ) const;
249 inline const SvxProtectItem &GetProtect( bool = true ) const;
250 inline const SwFormatSurround &GetSurround( bool = true ) const;
251 inline const SwFormatVertOrient &GetVertOrient( bool = true ) const;
252 inline const SwFormatHoriOrient &GetHoriOrient( bool = true ) const;
253 inline const SwFormatAnchor &GetAnchor( bool = true ) const;
254 inline const SvxBoxItem &GetBox( bool = true ) const;
255 inline const SvxFormatKeepItem &GetKeep( bool = true ) const;
256 inline const SvxBrushItem &GetBackground( bool = true ) const;
257 inline const SvxShadowItem &GetShadow( bool = true ) const;
258 inline const SwFormatPageDesc &GetPageDesc( bool = true ) const;
259 inline const SvxFormatBreakItem &GetBreak( bool = true ) const;
260 inline const SwFormatCol &GetCol( bool = true ) const;
261 inline const SvxMacroItem &GetMacro( bool = true ) const;
262 inline const SwFormatURL &GetURL( bool = true ) const;
263 inline const SwFormatEditInReadonly &GetEditInReadonly( bool = true ) const;
264 inline const SwFormatLayoutSplit &GetLayoutSplit( bool = true ) const;
265 inline const SwFormatRowSplit &GetRowSplit( bool = true ) const;
266 inline const SwFormatFlySplit &GetFlySplit( bool = true ) const;
267 inline const SwFormatChain &GetChain( bool = true ) const;
268 inline const SwFormatLineNumber &GetLineNumber( bool = true ) const;
269 inline const SwFormatFootnoteAtTextEnd &GetFootnoteAtTextEnd( bool = true ) const;
270 inline const SwFormatEndAtTextEnd &GetEndAtTextEnd( bool = true ) const;
271 inline const SwFormatNoBalancedColumns &GetBalancedColumns( bool = true ) const;
272 inline const SvxFrameDirectionItem &GetFrameDir( bool = true ) const;
273 inline const SwHeaderAndFooterEatSpacingItem &GetHeaderAndFooterEatSpacing( bool = true ) const;
274 inline const SwFormatFollowTextFlow &GetFollowTextFlow(bool = true) const;
275 inline const SwFormatWrapInfluenceOnObjPos& GetWrapInfluenceOnObjPos(bool = true) const;
276 inline const SdrTextVertAdjustItem& GetTextVertAdjust(bool = true) const;
277
278 // Graphic attributes - implementation in grfatr.hxx
279 inline const SwMirrorGrf &GetMirrorGrf( bool = true ) const;
280 inline const SwCropGrf &GetCropGrf( bool = true ) const;
281 inline const SwRotationGrf &GetRotationGrf(bool = true ) const;
282 inline const SwLuminanceGrf &GetLuminanceGrf(bool = true ) const;
283 inline const SwContrastGrf &GetContrastGrf(bool = true ) const;
284 inline const SwChannelRGrf &GetChannelRGrf(bool = true ) const;
285 inline const SwChannelGGrf &GetChannelGGrf(bool = true ) const;
286 inline const SwChannelBGrf &GetChannelBGrf(bool = true ) const;
287 inline const SwGammaGrf &GetGammaGrf(bool = true ) const;
288 inline const SwInvertGrf &GetInvertGrf(bool = true ) const;
289 inline const SwTransparencyGrf &GetTransparencyGrf(bool = true ) const;
290 inline const SwDrawModeGrf &GetDrawModeGrf(bool = true ) const;
291
292 // Paragraph attributes - implementation in paratr.hxx
293 inline const SvxLineSpacingItem &GetLineSpacing( bool = true ) const;
294 inline const SvxAdjustItem &GetAdjust( bool = true ) const;
295 inline const SvxFormatSplitItem &GetSplit( bool = true ) const;
296 inline const SwRegisterItem &GetRegister( bool = true ) const;
297 inline const SwNumRuleItem &GetNumRule( bool = true ) const;
298 inline const SvxWidowsItem &GetWidows( bool = true ) const;
299 inline const SvxOrphansItem &GetOrphans( bool = true ) const;
300 inline const SvxTabStopItem &GetTabStops( bool = true ) const;
301 inline const SvxHyphenZoneItem &GetHyphenZone( bool = true ) const;
302 inline const SwFormatDrop &GetDrop( bool = true ) const;
303 inline const SvxScriptSpaceItem &GetScriptSpace(bool = true) const;
304 inline const SvxHangingPunctuationItem &GetHangingPunctuation(bool = true) const;
305 inline const SvxForbiddenRuleItem &GetForbiddenRule(bool = true) const;
306 inline const SvxParaVertAlignItem &GetParaVertAlign(bool = true) const;
307 inline const SvxParaGridItem &GetParaGrid(bool = true) const;
308 inline const SwParaConnectBorderItem &GetParaConnectBorder(bool = true ) const;
309
310 // Tablebox attributes - implementation in cellatr.hxx
311 inline const SwTableBoxNumFormat &GetTableBoxNumFormat( bool = true ) const;
312 inline const SwTableBoxFormula &GetTableBoxFormula( bool = true ) const;
313 inline const SwTableBoxValue &GetTableBoxValue( bool = true ) const;
314};
315
316//Helper for filters to find true lineheight of a font
318 const SwAttrSet &rSet,
319 const vcl::RenderContext &rOut, sal_Int16 nScript);
320#endif
321
322/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provides access to settings of a document.
virtual void Changed(const SfxPoolItem &rOld, const SfxPoolItem &rNew)
SfxItemPool * GetPool() const
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const
void PutDirect(const SfxPoolItem &rItem)
SwDoc * m_pDoc
Definition: swatrset.hxx:142
const SwDoc * GetDoc() const
Definition: swatrset.hxx:151
SwDoc * GetDoc()
Definition: swatrset.hxx:150
const SwDoc * GetDoc() const
Definition: swatrset.hxx:198
SwAttrPool * GetPool() const
Definition: swatrset.hxx:184
SwDoc * GetDoc()
Definition: swatrset.hxx:199
SwAttrSet * m_pNewSet
Definition: swatrset.hxx:158
void PutChgd(const SfxPoolItem &rI)
Definition: swatrset.hxx:163
Definition: doc.hxx:195
FlyAnchors.
Definition: fmtanchr.hxx:37
Connection (text flow) between two FlyFrames.
Definition: fmtcnct.hxx:32
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:32
If SwFormatDrop is a Client, it is the CharFormat that describes the font for the DropCaps.
Definition: paratr.hxx:63
Determines if a fly frame can be split across multiple pages.
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:65
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:34
Defines the horizontal position of a fly frame.
Definition: fmtornt.hxx:73
If text in multi-column sections should be evenly distributed.
Definition: fmtclbl.hxx:29
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:36
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
Allows positioning of floating screen objects without considering their own wrapping type and the wra...
virtual OUString GetURL() const override
void InitCore()
Definition: init.cxx:450
void FinitCore()
Definition: init.cxx:669
MapUnit
static bool Put_BC(std::shared_ptr< const SfxItemSet > &rpAttrSet, const SwContentNode &rNode, const SfxPoolItem &rAttr, SwAttrSet *pOld, SwAttrSet *pNew)
Definition: node.cxx:188
static sal_uInt16 ClearItem_BC(std::shared_ptr< const SfxItemSet > &rpAttrSet, const SwContentNode &rNode, sal_uInt16 nWhich, SwAttrSet *pOld, SwAttrSet *pNew)
Definition: node.cxx:240
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:390
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
Definition: fmtcol.cxx:74
sal_Int16 GetCaseMap(sal_Int32 nToken)
long Long
vcl::Font GetFont(vcl::Font const &rFont, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
OutputDevice RenderContext
Definition: paintfrm.hxx:30
SfxItemPresentation
SW_DLLPUBLIC tools::Long AttrSetToLineHeight(const IDocumentSettingAccess &rIDocumentSettingAccess, const SwAttrSet &rSet, const vcl::RenderContext &rOut, sal_Int16 nScript)
Helper for filters to find true lineheight of a font.
Definition: swfont.cxx:1454
#define SW_DLLPUBLIC
Definition: swdllapi.h:28