LCOV - code coverage report
Current view: top level - sw/inc - paratr.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 62 70 88.6 %
Date: 2014-11-03 Functions: 42 46 91.3 %
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_PARATR_HXX
      20             : #define INCLUDED_SW_INC_PARATR_HXX
      21             : #include <svl/eitem.hxx>
      22             : #include <svl/stritem.hxx>
      23             : #include "swdllapi.h"
      24             : #include <hintids.hxx>
      25             : #include <calbck.hxx>
      26             : #include <swatrset.hxx>
      27             : #include <format.hxx>
      28             : #include <swtypes.hxx>
      29             : #include <editeng/adjustitem.hxx>
      30             : 
      31             : class SwCharFmt;
      32             : class IntlWrapper;
      33             : 
      34             : #define DROP_WHOLEWORD ((sal_uInt16)0x0001)
      35             : 
      36             : /** If SwFmtDrop is a Client, it is the CharFmt that describes the font for the
      37             :    DropCaps. If it is not a Client, formatting uses the CharFmt of the paragraph.
      38             :    If the CharFmt is modified, this change is propagated to the paragraphs
      39             :    via the Modify of SwFmtDrop. */
      40             : class SW_DLLPUBLIC SwFmtDrop: public SfxPoolItem, public SwClient
      41             : {
      42             :     SwModify* pDefinedIn;       /**< Modify-Object, that contains DropCaps.
      43             :                                   Can only be TxtFmtCollection/TxtNode. */
      44             :     sal_uInt16 nDistance;       ///< Distance to beginning of text.
      45             :     sal_uInt16 nReadFmt;        ///< For Sw3-Reader: CharFormat-Id (load Pool!).
      46             :     sal_uInt8  nLines;          ///< Line count.
      47             :     sal_uInt8  nChars;          ///< Character count.
      48             :     bool   bWholeWord;      ///< First word with initials.
      49             : public:
      50             :     TYPEINFO_OVERRIDE(); ///< Already in base class SwClient.
      51             : 
      52             :     SwFmtDrop();
      53             :     virtual ~SwFmtDrop();
      54             : 
      55             :     // @@@ public copy ctor, but no copy assignment?
      56             :     SwFmtDrop( const SwFmtDrop & );
      57             : private:
      58             :     // @@@ public copy ctor, but no copy assignment?
      59             :     SwFmtDrop & operator= (const SwFmtDrop &);
      60             : 
      61             : protected:
      62             :    virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) SAL_OVERRIDE;
      63             : 
      64             : public:
      65             : 
      66             :     /// "pure virtual methods" of SfxPoolItem
      67             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
      68             :     virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const SAL_OVERRIDE;
      69             :     virtual bool GetPresentation( SfxItemPresentation ePres,
      70             :                                     SfxMapUnit eCoreMetric,
      71             :                                     SfxMapUnit ePresMetric,
      72             :                                     OUString &rText,
      73             :                                     const IntlWrapper*    pIntl = 0) const SAL_OVERRIDE;
      74             :     virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
      75             :     virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
      76             : 
      77      247896 :     inline sal_uInt8 GetLines() const { return nLines; }
      78          76 :     inline sal_uInt8 &GetLines() { return nLines; }
      79             : 
      80      219236 :     inline sal_uInt8 GetChars() const { return nChars; }
      81          76 :     inline sal_uInt8 &GetChars() { return nChars; }
      82             : 
      83      219224 :     inline bool GetWholeWord() const { return bWholeWord; }
      84          76 :     inline bool &GetWholeWord() { return bWholeWord; }
      85             : 
      86      150114 :     inline sal_uInt16 GetDistance() const { return nDistance; }
      87          76 :     inline sal_uInt16 &GetDistance() { return nDistance; }
      88             : 
      89         134 :    inline const SwCharFmt *GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); }
      90         110 :     inline SwCharFmt *GetCharFmt()       { return (SwCharFmt*)GetRegisteredIn(); }
      91             :     void SetCharFmt( SwCharFmt *pNew );
      92             :     /// Get information from Client.
      93             :     virtual bool GetInfo( SfxPoolItem& ) const SAL_OVERRIDE;
      94             : 
      95             :     /// Get and set Modify pointer.
      96          42 :     inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
      97          34 :     inline void ChgDefinedIn( const SwModify* pNew )
      98          34 :     { pDefinedIn = (SwModify*)pNew; }
      99             : };
     100             : 
     101      194322 : class SwRegisterItem : public SfxBoolItem
     102             : {
     103             : public:
     104             :     TYPEINFO_OVERRIDE();
     105             : 
     106             :     inline SwRegisterItem( const bool bRegister = false );
     107             : 
     108             :     /// @@@ public copy assignment, but no copy ctor?
     109             :     inline SwRegisterItem& operator=( const SwRegisterItem& rRegister );
     110             : 
     111             :     /// "pure virtual methods" of SfxPoolItem
     112             :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     113             :     virtual bool GetPresentation( SfxItemPresentation ePres,
     114             :                                     SfxMapUnit eCoreMetric,
     115             :                                     SfxMapUnit ePresMetric,
     116             :                                     OUString &rText,
     117             :                                     const IntlWrapper*    pIntl = 0 ) const SAL_OVERRIDE;
     118             : };
     119             : 
     120       26400 : inline SwRegisterItem::SwRegisterItem( const bool bRegister ) :
     121       26400 :     SfxBoolItem( RES_PARATR_REGISTER, bRegister )
     122       26400 : {}
     123             : 
     124             : inline SwRegisterItem& SwRegisterItem::operator=(
     125             :     const SwRegisterItem& rRegister )
     126             : {
     127             :     SetValue( rRegister.GetValue() );
     128             :     return *this;
     129             : }
     130             : 
     131       12846 : class SW_DLLPUBLIC SwNumRuleItem : public SfxStringItem
     132             : {
     133             : public:
     134             :     TYPEINFO_OVERRIDE();
     135             : 
     136         972 :     SwNumRuleItem()
     137         972 :         : SfxStringItem( RES_PARATR_NUMRULE, OUString() ) {}
     138             : 
     139        4520 :     SwNumRuleItem( const OUString& rRuleName )
     140        4520 :         : SfxStringItem( RES_PARATR_NUMRULE, rRuleName ) {}
     141             : 
     142        3634 :     SwNumRuleItem( const SwNumRuleItem& rCpy )
     143        3634 :         : SfxStringItem( RES_PARATR_NUMRULE, rCpy.GetValue() ) {}
     144             : 
     145           0 :     SwNumRuleItem& operator=( const SwNumRuleItem& rCpy )
     146           0 :     { SetValue( rCpy.GetValue() ); return *this; }
     147             : 
     148             :     /// "pure virtual methods" of SfxPoolItem
     149             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
     150             :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     151             :     virtual bool GetPresentation( SfxItemPresentation ePres,
     152             :                                     SfxMapUnit eCoreMetric,
     153             :                                     SfxMapUnit ePresMetric,
     154             :                                     OUString &rText,
     155             :                                     const IntlWrapper*    pIntl = 0 ) const SAL_OVERRIDE;
     156             : 
     157             :     virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const SAL_OVERRIDE;
     158             :     virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) SAL_OVERRIDE;
     159             : };
     160             : 
     161         210 : class SwParaConnectBorderItem : public SfxBoolItem
     162             : {
     163             : public:
     164             :     TYPEINFO_OVERRIDE();
     165             : 
     166             :     inline SwParaConnectBorderItem( const bool bConnect = true );
     167             : 
     168             :     /// @@@ public copy assignment, but no copy ctor?
     169             :     inline SwParaConnectBorderItem& operator=( const SwParaConnectBorderItem& rConnect );
     170             : 
     171             :     /// "pure virtual methods" of SfxPoolItem
     172             :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     173             :     virtual bool GetPresentation( SfxItemPresentation ePres,
     174             :                                     SfxMapUnit eCoreMetric,
     175             :                                     SfxMapUnit ePresMetric,
     176             :                                     OUString &rText,
     177             :                                     const IntlWrapper*    pIntl = 0 ) const SAL_OVERRIDE;
     178             : };
     179             : 
     180          96 : inline SwParaConnectBorderItem::SwParaConnectBorderItem( const bool bConnect ) :
     181          96 :     SfxBoolItem( RES_PARATR_CONNECT_BORDER, bConnect )
     182          96 : {}
     183             : 
     184             : inline SwParaConnectBorderItem& SwParaConnectBorderItem::operator=(
     185             :     const SwParaConnectBorderItem& rConnect )
     186             : {
     187             :     SetValue( rConnect.GetValue() );
     188             :     return *this;
     189             : }
     190             : 
     191             : //  Implementation of paragraph-attributes methods of SwAttrSet
     192      660132 : inline const SvxLineSpacingItem &SwAttrSet::GetLineSpacing(bool bInP) const
     193      660132 :     {   return (const SvxLineSpacingItem&)Get( RES_PARATR_LINESPACING,bInP); }
     194      505164 : inline const SvxAdjustItem &SwAttrSet::GetAdjust(bool bInP) const
     195      505164 :     {   return (const SvxAdjustItem&)Get( RES_PARATR_ADJUST,bInP); }
     196       52295 : inline const SvxFmtSplitItem &SwAttrSet::GetSplit(bool bInP) const
     197       52295 :     {   return (const SvxFmtSplitItem&)Get( RES_PARATR_SPLIT,bInP); }
     198      396589 : inline const SwRegisterItem &SwAttrSet::GetRegister(bool bInP) const
     199      396589 :     {   return (const SwRegisterItem&)Get( RES_PARATR_REGISTER,bInP); }
     200        3628 : inline const SvxWidowsItem &SwAttrSet::GetWidows(bool bInP) const
     201        3628 :     {   return (const SvxWidowsItem&)Get( RES_PARATR_WIDOWS,bInP); }
     202       49957 : inline const SvxOrphansItem &SwAttrSet::GetOrphans(bool bInP) const
     203       49957 :     {   return (const SvxOrphansItem&)Get( RES_PARATR_ORPHANS,bInP); }
     204      318182 : inline const SvxTabStopItem &SwAttrSet::GetTabStops(bool bInP) const
     205      318182 :     {   return (const SvxTabStopItem&)Get( RES_PARATR_TABSTOP,bInP); }
     206      180563 : inline const SvxHyphenZoneItem &SwAttrSet::GetHyphenZone(bool bInP) const
     207      180563 :     {   return (const SvxHyphenZoneItem&)Get(RES_PARATR_HYPHENZONE,bInP); }
     208      126458 : inline const SwFmtDrop &SwAttrSet::GetDrop(bool bInP) const
     209      126458 :     {   return (const SwFmtDrop&)Get(RES_PARATR_DROP,bInP); }
     210       20776 : inline const SwNumRuleItem &SwAttrSet::GetNumRule(bool bInP) const
     211       20776 :     {   return (const SwNumRuleItem&)Get(RES_PARATR_NUMRULE,bInP); }
     212       97770 : inline const SvxScriptSpaceItem& SwAttrSet::GetScriptSpace(bool bInP) const
     213       97770 :     {   return (const SvxScriptSpaceItem&)Get(RES_PARATR_SCRIPTSPACE,bInP); }
     214       97770 : inline const SvxHangingPunctuationItem &SwAttrSet::GetHangingPunctuation(bool bInP) const
     215       97770 :     {   return (const SvxHangingPunctuationItem&)Get(RES_PARATR_HANGINGPUNCTUATION,bInP); }
     216       97770 : inline const SvxForbiddenRuleItem &SwAttrSet::GetForbiddenRule(bool bInP) const
     217       97770 :     {   return (const SvxForbiddenRuleItem&)Get(RES_PARATR_FORBIDDEN_RULES, bInP); }
     218      318182 : inline const SvxParaVertAlignItem &SwAttrSet::GetParaVertAlign(bool bInP) const
     219      318182 :     {   return (const SvxParaVertAlignItem&)Get( RES_PARATR_VERTALIGN, bInP ); }
     220      385740 : inline const SvxParaGridItem &SwAttrSet::GetParaGrid(bool bInP) const
     221      385740 :     {   return (const SvxParaGridItem&)Get( RES_PARATR_SNAPTOGRID, bInP ); }
     222      158746 : inline const SwParaConnectBorderItem &SwAttrSet::GetParaConnectBorder(bool bInP) const
     223      158746 :     {   return (const SwParaConnectBorderItem&)Get( RES_PARATR_CONNECT_BORDER, bInP ); }
     224             : 
     225             : // Implementation of paragraph-attributes methods of SwFmt
     226           0 : inline const SvxLineSpacingItem &SwFmt::GetLineSpacing(bool bInP) const
     227           0 :     {   return aSet.GetLineSpacing(bInP); }
     228             : inline const SvxAdjustItem &SwFmt::GetAdjust(bool bInP) const
     229             :     {   return aSet.GetAdjust(bInP); }
     230             : inline const SvxFmtSplitItem &SwFmt::GetSplit(bool bInP) const
     231             :     {   return aSet.GetSplit(bInP); }
     232             : inline const SwRegisterItem &SwFmt::GetRegister(bool bInP) const
     233             :     {   return aSet.GetRegister(bInP); }
     234             : inline const SvxWidowsItem &SwFmt::GetWidows(bool bInP) const
     235             :     {   return aSet.GetWidows(bInP); }
     236             : inline const SvxOrphansItem &SwFmt::GetOrphans(bool bInP) const
     237             :     {   return aSet.GetOrphans(bInP); }
     238           0 : inline const SvxTabStopItem &SwFmt::GetTabStops(bool bInP) const
     239           0 :     {   return aSet.GetTabStops(bInP); }
     240             : inline const SvxHyphenZoneItem &SwFmt::GetHyphenZone(bool bInP) const
     241             :     {   return aSet.GetHyphenZone(bInP); }
     242           0 : inline const SwFmtDrop &SwFmt::GetDrop(bool bInP) const
     243           0 :     {   return aSet.GetDrop(bInP); }
     244       20776 : inline const SwNumRuleItem &SwFmt::GetNumRule(bool bInP) const
     245       20776 :     {   return aSet.GetNumRule(bInP); }
     246             : inline const SvxScriptSpaceItem& SwFmt::GetScriptSpace(bool bInP) const
     247             :     {   return aSet.GetScriptSpace(bInP) ; }
     248             : inline const SvxHangingPunctuationItem &SwFmt::GetHangingPunctuation(bool bInP) const
     249             :     {   return aSet.GetHangingPunctuation(bInP) ; }
     250             : inline const SvxForbiddenRuleItem &SwFmt::GetForbiddenRule(bool bInP) const
     251             :     {   return (const SvxForbiddenRuleItem&)aSet.Get(RES_PARATR_FORBIDDEN_RULES, bInP); }
     252             : inline const SvxParaVertAlignItem &SwFmt::GetParaVertAlign(bool bInP) const
     253             :     {   return (const SvxParaVertAlignItem&)aSet.Get( RES_PARATR_VERTALIGN, bInP ); }
     254             : inline const SvxParaGridItem &SwFmt::GetParaGrid(bool bInP) const
     255             :     {   return (const SvxParaGridItem&)aSet.Get( RES_PARATR_SNAPTOGRID, bInP ); }
     256             : inline const SwParaConnectBorderItem &SwFmt::GetParaConnectBorder(bool bInP) const
     257             :     {   return (const SwParaConnectBorderItem&)aSet.Get( RES_PARATR_CONNECT_BORDER, bInP ); }
     258             : 
     259             : #endif
     260             : 
     261             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10