LCOV - code coverage report
Current view: top level - sw/inc - grfatr.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 86 0.0 %
Date: 2014-04-14 Functions: 0 68 0.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_GRFATR_HXX
      20             : #define INCLUDED_SW_INC_GRFATR_HXX
      21             : 
      22             : #include <hintids.hxx>
      23             : #include <tools/gen.hxx>
      24             : #include <svl/eitem.hxx>
      25             : #include <svl/intitem.hxx>
      26             : #include <svx/grfcrop.hxx>
      27             : #include "swdllapi.h"
      28             : #include <swatrset.hxx>
      29             : #include <format.hxx>
      30             : 
      31             : /******************************************************************************
      32             :  *  class SwMirrorGrf
      33             :  ******************************************************************************/
      34             : 
      35             : enum MirrorGraph
      36             : {
      37             : RES_MIRROR_GRAPH_BEGIN,
      38             :     RES_MIRROR_GRAPH_DONT = RES_MIRROR_GRAPH_BEGIN,
      39             :     RES_MIRROR_GRAPH_VERT,
      40             :     RES_MIRROR_GRAPH_HOR,
      41             :     RES_MIRROR_GRAPH_BOTH,
      42             : RES_MIRROR_GRAPH_END
      43             : };
      44             : 
      45           0 : class SW_DLLPUBLIC SwMirrorGrf : public SfxEnumItem
      46             : {
      47             :     sal_Bool bGrfToggle; // Flip graphics on even pages.
      48             : 
      49             : public:
      50           0 :     SwMirrorGrf( MirrorGraph eMiro = RES_MIRROR_GRAPH_DONT )
      51           0 :         : SfxEnumItem( RES_GRFATR_MIRRORGRF, static_cast< sal_uInt16 >(eMiro) ), bGrfToggle( sal_False )
      52           0 :     {}
      53           0 :     SwMirrorGrf( const SwMirrorGrf &rMirrorGrf )
      54           0 :         : SfxEnumItem( RES_GRFATR_MIRRORGRF, rMirrorGrf.GetValue()),
      55           0 :         bGrfToggle( rMirrorGrf.IsGrfToggle() )
      56           0 :     {}
      57             : 
      58             :     // pure virtual methods of SfxPoolItem
      59             :     virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
      60             : 
      61             :     // pure virtual methods of SfxEnumItem
      62             :     virtual sal_uInt16          GetValueCount() const SAL_OVERRIDE;
      63             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
      64             :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
      65             :                                     SfxMapUnit eCoreMetric,
      66             :                                     SfxMapUnit ePresMetric,
      67             :                                     OUString &rText,
      68             :                                     const IntlWrapper*    pIntl = 0 ) const SAL_OVERRIDE;
      69             : 
      70             :     virtual bool             QueryValue( com::sun::star::uno::Any& rVal,
      71             :                                         sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
      72             :     virtual bool             PutValue( const com::sun::star::uno::Any& rVal,
      73             :                                         sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
      74             : 
      75             :     inline SwMirrorGrf& operator=( const SwMirrorGrf& rMirrorGrf )
      76             :         {
      77             :             SfxEnumItem::SetValue( rMirrorGrf.GetValue() );
      78             :             bGrfToggle = rMirrorGrf.IsGrfToggle();
      79             :             return *this;
      80             :         }
      81             : 
      82           0 :     inline sal_Bool IsGrfToggle() const         { return bGrfToggle; }
      83           0 :     inline void SetGrfToggle( sal_Bool bNew )   { bGrfToggle = bNew; }
      84             : };
      85             : 
      86             : /******************************************************************************
      87             :  *  class SwAttrCropGrf
      88             :  ******************************************************************************/
      89             : 
      90           0 : class SW_DLLPUBLIC SwCropGrf : public SvxGrfCrop
      91             : {
      92             : public:
      93             :     TYPEINFO_OVERRIDE();
      94             :     SwCropGrf();
      95             :     SwCropGrf(  sal_Int32 nLeft,    sal_Int32 nRight,
      96             :                 sal_Int32 nTop,     sal_Int32 nBottom );
      97             : 
      98             :     // "pure virtual methods" of SfxPoolItem
      99             :     virtual SfxPoolItem*        Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     100             : };
     101             : 
     102           0 : class SwRotationGrf : public SfxUInt16Item
     103             : {
     104             :     Size aUnrotatedSize;
     105             : public:
     106           0 :     SwRotationGrf( sal_Int16 nVal = 0 )
     107           0 :         : SfxUInt16Item( RES_GRFATR_ROTATION, nVal )
     108           0 :     {}
     109           0 :     SwRotationGrf( sal_Int16 nVal, const Size& rSz )
     110           0 :         : SfxUInt16Item( RES_GRFATR_ROTATION, nVal ), aUnrotatedSize( rSz )
     111           0 :     {}
     112             : 
     113             :     // pure virtual methods from SfxInt16Item
     114             :     virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     115             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
     116             :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
     117             :                                     SfxMapUnit eCoreMetric,
     118             :                                     SfxMapUnit ePresMetric,
     119             :                                     OUString &rText,
     120             :                                     const IntlWrapper* pIntl = 0 ) const SAL_OVERRIDE;
     121             :     virtual bool             QueryValue( com::sun::star::uno::Any& rVal,
     122             :                                             sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
     123             :     virtual bool             PutValue( const com::sun::star::uno::Any& rVal,
     124             :                                             sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
     125             : 
     126             :     void SetUnrotatedSize( const Size& rSz )        { aUnrotatedSize = rSz; }
     127           0 :     const Size& GetUnrotatedSize() const            { return aUnrotatedSize; }
     128             : };
     129             : 
     130           0 : class SW_DLLPUBLIC SwLuminanceGrf : public SfxInt16Item
     131             : {
     132             : public:
     133           0 :     SwLuminanceGrf( sal_Int16 nVal = 0 )
     134           0 :         : SfxInt16Item( RES_GRFATR_LUMINANCE, nVal )
     135           0 :     {}
     136             : 
     137             :     // pure virtual methods from SfxInt16Item
     138             :     virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     139             :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
     140             :                                     SfxMapUnit eCoreMetric,
     141             :                                     SfxMapUnit ePresMetric,
     142             :                                     OUString &rText,
     143             :                                     const IntlWrapper* pIntl = 0 ) const SAL_OVERRIDE;
     144             : };
     145             : 
     146           0 : class SW_DLLPUBLIC SwContrastGrf : public SfxInt16Item
     147             : {
     148             : public:
     149           0 :     SwContrastGrf( sal_Int16 nVal = 0 )
     150           0 :         : SfxInt16Item( RES_GRFATR_CONTRAST, nVal )
     151           0 :     {}
     152             : 
     153             :     // pure virtual methods from SfxInt16Item
     154             :     virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     155             :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
     156             :                                     SfxMapUnit eCoreMetric,
     157             :                                     SfxMapUnit ePresMetric,
     158             :                                     OUString &rText,
     159             :                                     const IntlWrapper* pIntl = 0 ) const SAL_OVERRIDE;
     160             : };
     161             : 
     162           0 : class SwChannelGrf : public SfxInt16Item
     163             : {
     164             : protected:
     165           0 :     SwChannelGrf( sal_Int16 nVal, sal_uInt16 nWhichL )
     166           0 :         : SfxInt16Item( nWhichL, nVal )
     167           0 :     {}
     168             : 
     169             : public:
     170             :     // pure virtual methods from SfxInt16Item
     171             :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
     172             :                                     SfxMapUnit eCoreMetric,
     173             :                                     SfxMapUnit ePresMetric,
     174             :                                     OUString &rText,
     175             :                                     const IntlWrapper* pIntl = 0 ) const SAL_OVERRIDE;
     176             : };
     177             : 
     178           0 : class SwChannelRGrf : public SwChannelGrf
     179             : {
     180             : public:
     181           0 :     SwChannelRGrf( sal_Int16 nVal = 0 )
     182           0 :         : SwChannelGrf( nVal, RES_GRFATR_CHANNELR )
     183           0 :     {}
     184             :     virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     185             : };
     186           0 : class SwChannelGGrf : public SwChannelGrf
     187             : {
     188             : public:
     189           0 :     SwChannelGGrf( sal_Int16 nVal = 0 )
     190           0 :         : SwChannelGrf( nVal, RES_GRFATR_CHANNELG )
     191           0 :     {}
     192             :     virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     193             : };
     194           0 : class SwChannelBGrf : public SwChannelGrf
     195             : {
     196             : public:
     197           0 :     SwChannelBGrf( sal_Int16 nVal = 0 )
     198           0 :         : SwChannelGrf( nVal, RES_GRFATR_CHANNELB )
     199           0 :     {}
     200             :     virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     201             : };
     202             : 
     203           0 : class SW_DLLPUBLIC SwGammaGrf : public SfxPoolItem
     204             : {
     205             :     double nValue;
     206             : public:
     207             :     TYPEINFO_OVERRIDE();
     208           0 :     SwGammaGrf() : SfxPoolItem( RES_GRFATR_GAMMA ), nValue( 1.0 )
     209           0 :     {}
     210             : 
     211           0 :     SwGammaGrf( const double& rVal )
     212           0 :         : SfxPoolItem( RES_GRFATR_GAMMA ), nValue( rVal )
     213           0 :     {}
     214             : 
     215             :     inline SwGammaGrf& operator=( const SwGammaGrf& rCopy )
     216             :         {
     217             :             SetValue( rCopy.GetValue() );
     218             :             return *this;
     219             :         }
     220             : 
     221             :     // pure virtual methods from SfxEnumItem
     222             :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     223             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
     224             :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
     225             :                                     SfxMapUnit eCoreMetric,
     226             :                                     SfxMapUnit ePresMetric,
     227             :                                     OUString &rText,
     228             :                                     const IntlWrapper* pIntl = 0 ) const SAL_OVERRIDE;
     229             : 
     230             :     virtual bool             QueryValue( com::sun::star::uno::Any& rVal,
     231             :                                             sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
     232             :     virtual bool             PutValue( const com::sun::star::uno::Any& rVal,
     233             :                                             sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
     234             : 
     235           0 :     const double& GetValue() const              { return nValue; }
     236             :     void SetValue( const double& rVal )         { nValue = rVal; }
     237             : };
     238             : 
     239           0 : class SwInvertGrf: public SfxBoolItem
     240             : {
     241             : public:
     242           0 :     SwInvertGrf( sal_Bool bVal = sal_False )
     243           0 :         : SfxBoolItem( RES_GRFATR_INVERT, bVal )
     244           0 :     {}
     245             : 
     246             :     // pure virtual methods from SfxInt16Item
     247             :     virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     248             :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
     249             :                                     SfxMapUnit eCoreMetric,
     250             :                                     SfxMapUnit ePresMetric,
     251             :                                     OUString &rText,
     252             :                                     const IntlWrapper* pIntl = 0 ) const SAL_OVERRIDE;
     253             : };
     254             : 
     255           0 : class SwTransparencyGrf : public SfxByteItem
     256             : {
     257             : public:
     258           0 :     SwTransparencyGrf( sal_Int8 nVal = 0 )
     259           0 :         : SfxByteItem( RES_GRFATR_TRANSPARENCY, nVal )
     260           0 :     {}
     261             : 
     262             :     // pure virtual methods from SfxInt16Item
     263             :     virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     264             :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
     265             :                                     SfxMapUnit eCoreMetric,
     266             :                                     SfxMapUnit ePresMetric,
     267             :                                     OUString &rText,
     268             :                                     const IntlWrapper* pIntl = 0 ) const SAL_OVERRIDE;
     269             :     virtual bool            QueryValue( com::sun::star::uno::Any& rVal,
     270             :                                         sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
     271             :     virtual bool            PutValue( const com::sun::star::uno::Any& rVal,
     272             :                                         sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
     273             : };
     274             : 
     275           0 : class SW_DLLPUBLIC SwDrawModeGrf : public SfxEnumItem
     276             : {
     277             : public:
     278           0 :     SwDrawModeGrf( sal_uInt16 nMode = 0 )
     279           0 :         : SfxEnumItem( RES_GRFATR_DRAWMODE, nMode )
     280           0 :     {}
     281             : 
     282             :     // pure virtual methods of SfxPoolItem
     283             :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     284             : 
     285             :     // pure virtual methods of SfxEnumItem
     286             :     virtual sal_uInt16          GetValueCount() const SAL_OVERRIDE;
     287             :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
     288             :                                     SfxMapUnit eCoreMetric,
     289             :                                     SfxMapUnit ePresMetric,
     290             :                                     OUString &rText,
     291             :                                     const IntlWrapper*    pIntl = 0 ) const SAL_OVERRIDE;
     292             : 
     293             :     virtual bool            QueryValue( com::sun::star::uno::Any& rVal,
     294             :                                         sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
     295             :     virtual bool            PutValue( const com::sun::star::uno::Any& rVal,
     296             :                                         sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
     297             : };
     298             : 
     299             : /******************************************************************************
     300             :  *  Implementation of graphics attributes methods of SwAttr
     301             :  ******************************************************************************/
     302             : 
     303           0 : inline const SwMirrorGrf &SwAttrSet::GetMirrorGrf(sal_Bool bInP) const
     304           0 :     { return (const SwMirrorGrf&)Get( RES_GRFATR_MIRRORGRF,bInP); }
     305           0 : inline const SwCropGrf   &SwAttrSet::GetCropGrf(sal_Bool bInP) const
     306           0 :     { return (const SwCropGrf&)Get( RES_GRFATR_CROPGRF,bInP); }
     307           0 : inline const SwRotationGrf &SwAttrSet::GetRotationGrf(sal_Bool bInP) const
     308           0 :     { return (const SwRotationGrf&)Get( RES_GRFATR_ROTATION,bInP); }
     309           0 : inline const SwLuminanceGrf &SwAttrSet::GetLuminanceGrf(sal_Bool bInP) const
     310           0 :     { return (const SwLuminanceGrf&)Get( RES_GRFATR_LUMINANCE,bInP); }
     311           0 : inline const SwContrastGrf &SwAttrSet::GetContrastGrf(sal_Bool bInP) const
     312           0 :     { return (const SwContrastGrf&)Get( RES_GRFATR_CONTRAST,bInP); }
     313           0 : inline const SwChannelRGrf &SwAttrSet::GetChannelRGrf(sal_Bool bInP) const
     314           0 :     { return (const SwChannelRGrf&)Get( RES_GRFATR_CHANNELR,bInP); }
     315           0 : inline const SwChannelGGrf &SwAttrSet::GetChannelGGrf(sal_Bool bInP) const
     316           0 :     { return (const SwChannelGGrf&)Get( RES_GRFATR_CHANNELG,bInP); }
     317           0 : inline const SwChannelBGrf &SwAttrSet::GetChannelBGrf(sal_Bool bInP) const
     318           0 :     { return (const SwChannelBGrf&)Get( RES_GRFATR_CHANNELB,bInP); }
     319           0 : inline const SwGammaGrf &SwAttrSet::GetGammaGrf(sal_Bool bInP) const
     320           0 :     { return (const SwGammaGrf&)Get( RES_GRFATR_GAMMA,bInP); }
     321           0 : inline const SwInvertGrf &SwAttrSet::GetInvertGrf(sal_Bool bInP) const
     322           0 :     { return (const SwInvertGrf&)Get( RES_GRFATR_INVERT,bInP); }
     323           0 : inline const SwTransparencyGrf &SwAttrSet::GetTransparencyGrf(sal_Bool bInP) const
     324           0 :     { return (const SwTransparencyGrf&)Get( RES_GRFATR_TRANSPARENCY,bInP); }
     325           0 : inline const SwDrawModeGrf      &SwAttrSet::GetDrawModeGrf(sal_Bool bInP) const
     326           0 :     { return (const SwDrawModeGrf&)Get( RES_GRFATR_DRAWMODE,bInP); }
     327             : 
     328             : /******************************************************************************
     329             :  *  Implementation of graphics attributes methods of SwFmt
     330             :  ******************************************************************************/
     331             : 
     332             : inline const SwMirrorGrf &SwFmt::GetMirrorGrf(sal_Bool bInP) const
     333             :     { return aSet.GetMirrorGrf(bInP); }
     334             : inline const SwCropGrf   &SwFmt::GetCropGrf(sal_Bool bInP) const
     335             :     { return aSet.GetCropGrf(bInP); }
     336             : inline const SwRotationGrf &SwFmt::GetRotationGrf(sal_Bool bInP) const
     337             :     { return aSet.GetRotationGrf(bInP); }
     338             : inline const SwLuminanceGrf &SwFmt::GetLuminanceGrf(sal_Bool bInP) const
     339             :     { return aSet.GetLuminanceGrf( bInP); }
     340             : inline const SwContrastGrf &SwFmt::GetContrastGrf(sal_Bool bInP) const
     341             :     { return aSet.GetContrastGrf( bInP); }
     342             : inline const SwChannelRGrf &SwFmt::GetChannelRGrf(sal_Bool bInP) const
     343             :     { return aSet.GetChannelRGrf( bInP); }
     344             : inline const SwChannelGGrf &SwFmt::GetChannelGGrf(sal_Bool bInP) const
     345             :     { return aSet.GetChannelGGrf( bInP); }
     346             : inline const SwChannelBGrf &SwFmt::GetChannelBGrf(sal_Bool bInP) const
     347             :     { return aSet.GetChannelBGrf( bInP); }
     348             : inline const SwGammaGrf &SwFmt::GetGammaGrf(sal_Bool bInP) const
     349             :     { return aSet.GetGammaGrf( bInP); }
     350             : inline const SwInvertGrf &SwFmt::GetInvertGrf(sal_Bool bInP) const
     351             :     { return aSet.GetInvertGrf( bInP); }
     352             : inline const SwTransparencyGrf &SwFmt::GetTransparencyGrf(sal_Bool bInP) const
     353             :     { return aSet.GetTransparencyGrf( bInP); }
     354             : inline const SwDrawModeGrf &SwFmt::GetDrawModeGrf(sal_Bool bInP) const
     355             :     { return aSet.GetDrawModeGrf(bInP); }
     356             : 
     357             : #endif // INCLUDED_SW_INC_GRFATR_HXX
     358             : 
     359             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10