LCOV - code coverage report
Current view: top level - sw/inc - swatrset.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 7 7 100.0 %
Date: 2015-06-13 12:38:46 Functions: 9 9 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : #include <tools/solar.h>
      22             : #include <tools/mempool.hxx>
      23             : #include <svl/itemset.hxx>
      24             : #include <svl/itempool.hxx>
      25             : #include <swdllapi.h>
      26             : 
      27             : class SwModify;
      28             : class SwDoc;
      29             : class OutputDevice;
      30             : class IDocumentSettingAccess;
      31             : class SfxBoolItem;
      32             : class SvxPostureItem;
      33             : class SvxWeightItem;
      34             : class SvxShadowedItem;
      35             : class SvxAutoKernItem;
      36             : class SvxWordLineModeItem;
      37             : class SvxContourItem;
      38             : class SvxKerningItem;
      39             : class SvxUnderlineItem;
      40             : class SvxOverlineItem;
      41             : class SvxCrossedOutItem;
      42             : class SvxFontHeightItem;
      43             : class SvxPropSizeItem;
      44             : class SvxFontItem;
      45             : class SvxColorItem;
      46             : class SvxCharSetColorItem;
      47             : class SvxLanguageItem;
      48             : class SvxEscapementItem;
      49             : class SvxCaseMapItem;
      50             : class SvxNoHyphenItem;
      51             : class SvxBlinkItem;
      52             : class SvxEmphasisMarkItem;
      53             : class SvxTwoLinesItem;
      54             : class SvxCharScaleWidthItem;
      55             : class SvxCharRotateItem;
      56             : class SvxCharReliefItem;
      57             : class SvxCharHiddenItem;
      58             : 
      59             : // Frame attributes
      60             : class SwFormatFillOrder;
      61             : class SwFormatFrmSize;
      62             : class SvxPaperBinItem;
      63             : class SvxLRSpaceItem;
      64             : class SvxULSpaceItem;
      65             : class SwFormatContent;
      66             : class SwFormatHeader;
      67             : class SwFormatFooter;
      68             : class SvxPrintItem;
      69             : class SvxOpaqueItem;
      70             : class SvxProtectItem;
      71             : class SwFormatSurround;
      72             : class SwFormatVertOrient;
      73             : class SwFormatHoriOrient;
      74             : class SwFormatAnchor;
      75             : class SvxBoxItem;
      76             : class SvxBrushItem;
      77             : class XFillStyleItem;
      78             : class XFillGradientItem;
      79             : class SvxShadowItem;
      80             : class SwFormatPageDesc;
      81             : class SvxFormatBreakItem;
      82             : class SwFormatCol;
      83             : class SvxMacroItem;
      84             : class SvxFormatKeepItem;
      85             : class SwFormatURL;
      86             : class SwFormatLineNumber;
      87             : class SwFormatEditInReadonly;
      88             : class SwFormatLayoutSplit;
      89             : class SwFormatRowSplit;
      90             : class SwFormatChain;
      91             : class SwFormatFootnoteAtTextEnd;
      92             : class SwFormatEndAtTextEnd;
      93             : class SwFormatNoBalancedColumns;
      94             : class SvxFrameDirectionItem;
      95             : class SwTextGridItem;
      96             : class SwHeaderAndFooterEatSpacingItem;
      97             : class SwFormatFollowTextFlow;
      98             : class SwFormatWrapInfluenceOnObjPos;
      99             : class SdrTextVertAdjustItem;
     100             : 
     101             : // Graphic attributes
     102             : class SwMirrorGrf;
     103             : class SwCropGrf;
     104             : class SwRotationGrf;
     105             : class SwLuminanceGrf;
     106             : class SwContrastGrf;
     107             : class SwChannelRGrf;
     108             : class SwChannelGGrf;
     109             : class SwChannelBGrf;
     110             : class SwGammaGrf;
     111             : class SwInvertGrf;
     112             : class SwTransparencyGrf;
     113             : class SwDrawModeGrf;
     114             : 
     115             : // Paragraph attributes
     116             : class SvxLineSpacingItem;
     117             : class SvxAdjustItem;
     118             : class SvxFormatSplitItem;
     119             : class SwRegisterItem;
     120             : class SwNumRuleItem;
     121             : class SvxWidowsItem;
     122             : class SvxOrphansItem;
     123             : class SvxTabStopItem;
     124             : class SvxHyphenZoneItem;
     125             : class SwFormatDrop;
     126             : class SvxScriptSpaceItem;
     127             : class SvxHangingPunctuationItem;
     128             : class SvxForbiddenRuleItem;
     129             : class SvxParaVertAlignItem;
     130             : class SvxParaGridItem;
     131             : class SwParaConnectBorderItem;
     132             : 
     133             : // TableBox attributes
     134             : class SwTableBoxNumFormat;
     135             : class SwTableBoxFormula;
     136             : class SwTableBoxValue;
     137             : 
     138             : class SwAttrPool : public SfxItemPool
     139             : {
     140             : private:
     141             :     //UUUU helpers to add/rmove DrawingLayer ItemPool, used in constructor
     142             :     // and destructor; still isolated to evtl. allow other use later, but
     143             :     // used bz default now to have it instantly as needed for DrawingLayer
     144             :     // FillStyle support
     145             :     void createAndAddSecondaryPools();
     146             :     void removeAndDeleteSecondaryPools();
     147             : 
     148             :     friend void _InitCore();            // For creating/deleting of version maps.
     149             :     friend void _FinitCore();
     150             :     static sal_uInt16* pVersionMap1;
     151             :     static sal_uInt16* pVersionMap2;
     152             :     static sal_uInt16* pVersionMap3;
     153             :     static sal_uInt16* pVersionMap4;
     154             :     // due to extension of attribute set a new version
     155             :     // map for binary filter is necessary (version map 5).
     156             :     static sal_uInt16* pVersionMap5;
     157             :     static sal_uInt16* pVersionMap6;
     158             :     static sal_uInt16* pVersionMap7;
     159             : 
     160             :     SwDoc* pDoc;
     161             : 
     162             : public:
     163             :     SwAttrPool( SwDoc* pDoc );
     164             : protected:
     165             :     virtual ~SwAttrPool();
     166             : public:
     167             : 
     168    30577936 :           SwDoc* GetDoc()           { return pDoc; }
     169             :     const SwDoc* GetDoc() const     { return pDoc; }
     170             : 
     171             : };
     172             : 
     173     9751504 : class SW_DLLPUBLIC SwAttrSet : public SfxItemSet
     174             : {
     175             :     // Pointer for Modify-System
     176             :     SwAttrSet *pOldSet, *pNewSet;
     177             : 
     178             :     // Notification-Callback
     179             :     virtual void Changed( const SfxPoolItem& rOld, const SfxPoolItem& rNew ) SAL_OVERRIDE;
     180             : 
     181     3584074 :     void PutChgd( const SfxPoolItem& rI ) { SfxItemSet::PutDirect( rI ); }
     182             : public:
     183             :     SwAttrSet( SwAttrPool&, sal_uInt16 nWhich1, sal_uInt16 nWhich2 );
     184             :     SwAttrSet( SwAttrPool&, const sal_uInt16* nWhichPairTable );
     185             :     SwAttrSet( const SwAttrSet& );
     186             : 
     187             :     virtual SfxItemSet* Clone(bool bItems = true, SfxItemPool *pToPool = 0) const SAL_OVERRIDE;
     188             : 
     189             :     bool Put_BC( const SfxPoolItem& rAttr, SwAttrSet* pOld, SwAttrSet* pNew );
     190             :     bool Put_BC( const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew );
     191             : 
     192             :     // Delete an item or a range.
     193             :     sal_uInt16 ClearItem_BC( sal_uInt16 nWhich, SwAttrSet* pOld, SwAttrSet* pNew );
     194             :     sal_uInt16 ClearItem_BC( sal_uInt16 nWhich1, sal_uInt16 nWhich2,
     195             :                         SwAttrSet* pOld = 0, SwAttrSet* pNew = 0 );
     196             : 
     197             :     int Intersect_BC( const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew );
     198             : 
     199             :     void GetPresentation( SfxItemPresentation ePres,
     200             :         SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString &rText ) const;
     201             : 
     202    37538138 :     SwAttrPool* GetPool() const { return static_cast<SwAttrPool*>(SfxItemSet::GetPool()); }
     203             : 
     204             :     // Copy attributes, if necessary across documents.
     205             :     void CopyToModify( SwModify& rMod ) const;
     206             : 
     207             :     // Special treatment for some attributes.
     208             :     // Set Modify-pointer (the old pDefinedIn) at the following attributes:
     209             :     //  - SwFormatDropCaps
     210             :     //  - SwFormatPageDesc
     211             :     // (Is called at insert in formats/nodes.)
     212             :     // Second version is for the SwAttrSet handles of SwContentNode.
     213             :     bool SetModifyAtAttr( const SwModify* pModify );
     214             : 
     215             :     // Document is set at SwAttrPool. Therefore it is always accessible.
     216     1268014 :     const SwDoc *GetDoc() const { return GetPool()->GetDoc(); }
     217    29226164 :           SwDoc *GetDoc()       { return GetPool()->GetDoc(); }
     218             : 
     219             :     // Get methods: bool indicates whether to search only in Set (when false)
     220             :     // or also in parents. If nothing is found then default attribute is returned.
     221             :     // Character attributes. Implementation in charatr.hxx.
     222             :     inline const SvxPostureItem           &GetPosture( bool = true ) const;
     223             :     inline const SvxWeightItem          &GetWeight( bool = true ) const;
     224             :     inline const SvxShadowedItem        &GetShadowed( bool = true ) const;
     225             :     inline const SvxAutoKernItem        &GetAutoKern( bool = true ) const;
     226             :     inline const SvxWordLineModeItem    &GetWordLineMode( bool = true ) const;
     227             :     inline const SvxContourItem         &GetContour( bool = true ) const;
     228             :     inline const SvxKerningItem         &GetKerning( bool = true ) const;
     229             :     inline const SvxUnderlineItem       &GetUnderline( bool = true ) const;
     230             :     inline const SvxOverlineItem        &GetOverline( bool = true ) const;
     231             :     inline const SvxCrossedOutItem      &GetCrossedOut( bool = true ) const;
     232             :     inline const SvxFontHeightItem        &GetSize( bool = true ) const;
     233             :     inline const SvxPropSizeItem        &GetPropSize( bool = true ) const;
     234             :     inline const SvxFontItem            &GetFont( bool = true ) const;
     235             :     inline const SvxColorItem           &GetColor( bool = true ) const;
     236             :     inline const SvxCharSetColorItem    &GetCharSetColor( bool = true ) const;
     237             :     inline const SvxLanguageItem        &GetLanguage( bool = true ) const;
     238             :     inline const SvxEscapementItem      &GetEscapement( bool = true ) const;
     239             :     inline const SvxCaseMapItem         &GetCaseMap( bool = true ) const;
     240             :     inline const SvxNoHyphenItem      &GetNoHyphenHere( bool = true ) const;
     241             :     inline const SvxBlinkItem         &GetBlink( bool = true ) const;
     242             :     inline const SvxBrushItem         &GetChrBackground( bool = true ) const;
     243             :     inline const SvxBrushItem         &GetChrHighlight( bool = true ) const;
     244             :     inline const SvxFontItem          &GetCJKFont( bool = true ) const;
     245             :     inline const SvxFontHeightItem    &GetCJKSize( bool = true ) const;
     246             :     inline const SvxLanguageItem      &GetCJKLanguage( bool = true ) const;
     247             :     inline const SvxPostureItem       &GetCJKPosture( bool = true ) const;
     248             :     inline const SvxWeightItem        &GetCJKWeight( bool = true ) const;
     249             :     inline const SvxFontItem          &GetCTLFont( bool = true ) const;
     250             :     inline const SvxFontHeightItem    &GetCTLSize( bool = true ) const;
     251             :     inline const SvxLanguageItem      &GetCTLLanguage( bool = true ) const;
     252             :     inline const SvxPostureItem       &GetCTLPosture( bool = true ) const;
     253             :     inline const SvxWeightItem        &GetCTLWeight( bool = true ) const;
     254             :     inline const SfxBoolItem              &GetWritingDirection( bool = true ) const;
     255             :     inline const SvxEmphasisMarkItem  &GetEmphasisMark( bool = true ) const;
     256             :     inline const SvxTwoLinesItem      &Get2Lines( bool = true ) const;
     257             :     inline const SvxCharScaleWidthItem    &GetCharScaleW( bool = true ) const;
     258             :     inline const SvxCharRotateItem        &GetCharRotate( bool = true ) const;
     259             :     inline const SvxCharReliefItem        &GetCharRelief( bool = true ) const;
     260             :     inline const SvxCharHiddenItem      &GetCharHidden( bool = true ) const;
     261             :     inline const SvxBoxItem      &GetCharBorder( bool = true ) const;
     262             :     inline const SvxShadowItem      &GetCharShadow( bool = true ) const;
     263             : 
     264             :     // Frame attributes. Implementation in frmatr.hxx.
     265             :     inline const SwFormatFillOrder       &GetFillOrder( bool = true ) const;
     266             :     inline const SwFormatFrmSize             &GetFrmSize( bool = true ) const;
     267             :     inline const SvxPaperBinItem      &GetPaperBin( bool = true ) const;
     268             :     inline const SvxLRSpaceItem           &GetLRSpace( bool = true ) const;
     269             :     inline const SvxULSpaceItem           &GetULSpace( bool = true ) const;
     270             :     inline const SwFormatContent           &GetContent( bool = true ) const;
     271             :     inline const SwFormatHeader          &GetHeader( bool = true ) const;
     272             :     inline const SwFormatFooter          &GetFooter( bool = true ) const;
     273             :     inline const SvxPrintItem             &GetPrint( bool = true ) const;
     274             :     inline const SvxOpaqueItem            &GetOpaque( bool = true ) const;
     275             :     inline const SvxProtectItem           &GetProtect( bool = true ) const;
     276             :     inline const SwFormatSurround            &GetSurround( bool = true ) const;
     277             :     inline const SwFormatVertOrient      &GetVertOrient( bool = true ) const;
     278             :     inline const SwFormatHoriOrient      &GetHoriOrient( bool = true ) const;
     279             :     inline const SwFormatAnchor          &GetAnchor( bool = true ) const;
     280             :     inline const SvxBoxItem               &GetBox( bool = true ) const;
     281             :     inline const SvxFormatKeepItem         &GetKeep( bool = true ) const;
     282             :     inline const SvxBrushItem           &GetBackground( bool = true ) const;
     283             :     inline const SvxShadowItem            &GetShadow( bool = true ) const;
     284             :     inline const SwFormatPageDesc            &GetPageDesc( bool = true ) const;
     285             :     inline const SvxFormatBreakItem      &GetBreak( bool = true ) const;
     286             :     inline const SwFormatCol                 &GetCol( bool = true ) const;
     287             :     inline const SvxMacroItem             &GetMacro( bool = true ) const;
     288             :     inline const SwFormatURL             &GetURL( bool = true ) const;
     289             :     inline const SwFormatEditInReadonly  &GetEditInReadonly( bool = true ) const;
     290             :     inline const SwFormatLayoutSplit     &GetLayoutSplit( bool = true ) const;
     291             :     inline const SwFormatRowSplit          &GetRowSplit( bool = true ) const;
     292             :     inline const SwFormatChain             &GetChain( bool = true ) const;
     293             :     inline const SwFormatLineNumber      &GetLineNumber( bool = true ) const;
     294             :     inline const SwFormatFootnoteAtTextEnd     &GetFootnoteAtTextEnd( bool = true ) const;
     295             :     inline const SwFormatEndAtTextEnd     &GetEndAtTextEnd( bool = true ) const;
     296             :     inline const SwFormatNoBalancedColumns &GetBalancedColumns( bool = true ) const;
     297             :     inline const SvxFrameDirectionItem    &GetFrmDir( bool = true ) const;
     298             :     inline const SwTextGridItem         &GetTextGrid( bool = true ) const;
     299             :     inline const SwHeaderAndFooterEatSpacingItem &GetHeaderAndFooterEatSpacing( bool = true ) const;
     300             :     inline const SwFormatFollowTextFlow    &GetFollowTextFlow(bool = true) const;
     301             :     inline const SwFormatWrapInfluenceOnObjPos& GetWrapInfluenceOnObjPos(bool = true) const;
     302             :     inline const SdrTextVertAdjustItem& GetTextVertAdjust(bool = true) const;
     303             : 
     304             :     // Graphic attributes   - implementation in grfatr.hxx
     305             :     inline const SwMirrorGrf            &GetMirrorGrf( bool = true ) const;
     306             :     inline const SwCropGrf            &GetCropGrf( bool = true ) const;
     307             :     inline const SwRotationGrf            &GetRotationGrf(bool = true ) const;
     308             :     inline const SwLuminanceGrf       &GetLuminanceGrf(bool = true ) const;
     309             :     inline const SwContrastGrf            &GetContrastGrf(bool = true ) const;
     310             :     inline const SwChannelRGrf            &GetChannelRGrf(bool = true ) const;
     311             :     inline const SwChannelGGrf            &GetChannelGGrf(bool = true ) const;
     312             :     inline const SwChannelBGrf            &GetChannelBGrf(bool = true ) const;
     313             :     inline const SwGammaGrf           &GetGammaGrf(bool = true ) const;
     314             :     inline const SwInvertGrf          &GetInvertGrf(bool = true ) const;
     315             :     inline const SwTransparencyGrf        &GetTransparencyGrf(bool = true ) const;
     316             :     inline const SwDrawModeGrf            &GetDrawModeGrf(bool = true ) const;
     317             : 
     318             :     // Paragraph attributes - implementation in paratr.hxx
     319             :     inline const SvxLineSpacingItem       &GetLineSpacing( bool = true ) const;
     320             :     inline const SvxAdjustItem            &GetAdjust( bool = true ) const;
     321             :     inline const SvxFormatSplitItem      &GetSplit( bool = true ) const;
     322             :     inline const SwRegisterItem           &GetRegister( bool = true ) const;
     323             :     inline const SwNumRuleItem            &GetNumRule( bool = true ) const;
     324             :     inline const SvxWidowsItem            &GetWidows( bool = true ) const;
     325             :     inline const SvxOrphansItem           &GetOrphans( bool = true ) const;
     326             :     inline const SvxTabStopItem           &GetTabStops( bool = true ) const;
     327             :     inline const SvxHyphenZoneItem        &GetHyphenZone( bool = true ) const;
     328             :     inline const SwFormatDrop                &GetDrop( bool = true ) const;
     329             :     inline const SvxScriptSpaceItem       &GetScriptSpace(bool = true) const;
     330             :     inline const SvxHangingPunctuationItem &GetHangingPunctuation(bool = true) const;
     331             :     inline const SvxForbiddenRuleItem     &GetForbiddenRule(bool = true) const;
     332             :     inline const SvxParaVertAlignItem &GetParaVertAlign(bool = true) const;
     333             :     inline const SvxParaGridItem        &GetParaGrid(bool = true) const;
     334             :     inline const SwParaConnectBorderItem &GetParaConnectBorder(bool = true ) const;
     335             : 
     336             :     // Tablebox attributes  - implementation in cellatr.hxx
     337             :     inline  const SwTableBoxNumFormat       &GetTableBoxNumFormat( bool = true ) const;
     338             :     inline  const SwTableBoxFormula     &GetTableBoxFormula( bool = true ) const;
     339             :     inline  const SwTableBoxValue           &GetTableBoxValue( bool = true ) const;
     340             : 
     341     1970064 :     DECL_FIXEDMEMPOOL_NEWDEL(SwAttrSet)
     342             : };
     343             : 
     344             : //Helper for filters to find true lineheight of a font
     345             : SW_DLLPUBLIC long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess,
     346             :                           const SwAttrSet &rSet,
     347             :                           const OutputDevice &rOut, sal_Int16 nScript);
     348             : #endif
     349             : 
     350             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11