LCOV - code coverage report
Current view: top level - sd/source/ui/inc - optsitem.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 140 175 80.0 %
Date: 2015-06-13 12:38:46 Functions: 140 194 72.2 %
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             : 
      20             : #ifndef INCLUDED_SD_SOURCE_UI_INC_OPTSITEM_HXX
      21             : #define INCLUDED_SD_SOURCE_UI_INC_OPTSITEM_HXX
      22             : 
      23             : #include <unotools/configitem.hxx>
      24             : #include <sfx2/module.hxx>
      25             : #include <sfx2/app.hxx>
      26             : #include <sfx2/sfxsids.hrc>
      27             : #include <svx/optgrid.hxx>
      28             : #include <svx/dlgutil.hxx>
      29             : #include "sddllapi.h"
      30             : 
      31             : // Option ranges
      32             : 
      33             : #define SD_OPTIONS_ALL      0xffffffff
      34             : 
      35             : #define SD_OPTIONS_LAYOUT   0x00000001
      36             : #define SD_OPTIONS_CONTENTS 0x00000002
      37             : #define SD_OPTIONS_MISC     0x00000004
      38             : #define SD_OPTIONS_SNAP     0x00000008
      39             : #define SD_OPTIONS_ZOOM     0x00000010
      40             : #define SD_OPTIONS_GRID     0x00000020
      41             : #define SD_OPTIONS_PRINT    0x00000040
      42             : 
      43             : class SdOptions;
      44             : 
      45             : namespace sd {
      46             : class FrameView;
      47             : }
      48             : 
      49             : class SdOptionsGeneric;
      50             : 
      51             : class SD_DLLPUBLIC SdOptionsItem : public ::utl::ConfigItem
      52             : {
      53             : 
      54             : private:
      55             : 
      56             :     const SdOptionsGeneric& mrParent;
      57             : 
      58             :     virtual void            ImplCommit() SAL_OVERRIDE;
      59             : 
      60             : public:
      61             : 
      62             :     SdOptionsItem( const SdOptionsGeneric& rParent, const OUString& rSubTree );
      63             :     virtual ~SdOptionsItem();
      64             : 
      65             :     virtual void            Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames) SAL_OVERRIDE;
      66             : 
      67             :     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetProperties(
      68             :                                 const ::com::sun::star::uno::Sequence< OUString >& rNames );
      69             :     bool                    PutProperties( const com::sun::star::uno::Sequence< OUString >& rNames,
      70             :                                            const com::sun::star::uno::Sequence< com::sun::star::uno::Any>& rValues );
      71             :     void                    SetModified();
      72             : };
      73             : 
      74           0 : class SD_DLLPUBLIC SdOptionsGeneric
      75             : {
      76             : friend class SdOptionsItem;
      77             : 
      78             : private:
      79             : 
      80             :     OUString         maSubTree;
      81             :     SdOptionsItem*          mpCfgItem;
      82             :     sal_uInt16                  mnConfigId;
      83             :     bool                    mbInit          : 1;
      84             :     bool                    mbEnableModify  : 1;
      85             : 
      86             :     SAL_DLLPRIVATE void Commit( SdOptionsItem& rCfgItem ) const;
      87             :     SAL_DLLPRIVATE ::com::sun::star::uno::Sequence< OUString > GetPropertyNames() const;
      88             : 
      89             : protected:
      90             : 
      91             :     void                    Init() const;
      92         524 :     void                    OptionsChanged() { if( mpCfgItem && mbEnableModify ) mpCfgItem->SetModified(); }
      93             : 
      94             : protected:
      95             : 
      96             :     virtual void            GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const = 0;
      97             :     virtual bool            ReadData( const ::com::sun::star::uno::Any* pValues ) = 0;
      98             :     virtual bool            WriteData( ::com::sun::star::uno::Any* pValues ) const = 0;
      99             : 
     100             : public:
     101             : 
     102             :                             SdOptionsGeneric( sal_uInt16 nConfigId, const OUString& rSubTree );
     103             :                             virtual ~SdOptionsGeneric();
     104             : 
     105             :     const OUString&  GetSubTree() const { return maSubTree; }
     106          90 :     sal_uInt16                  GetConfigId() const { return mnConfigId; }
     107             : 
     108        2324 :     void                    EnableModify( bool bModify ) { mbEnableModify = bModify; }
     109             : 
     110             :     void                    Store();
     111             : 
     112             :     static bool             isMetricSystem();
     113             : };
     114             : 
     115           0 : class SD_DLLPUBLIC SdOptionsLayout : public SdOptionsGeneric
     116             : {
     117             : private:
     118             : 
     119             :     bool    bRuler; // Layout/Display/Ruler
     120             :     bool    bMoveOutline;   // Layout/Display/Contur
     121             :     bool    bDragStripes;   // Layout/Display/Guide
     122             :     bool    bHandlesBezier; // Layout/Display/Bezier
     123             :     bool    bHelplines; // Layout/Display/Helpline
     124             :     sal_uInt16  nMetric;                    // Layout/Other/MeasureUnit
     125             :     sal_uInt16  nDefTab;                    // Layout/Other/TabStop
     126             : 
     127             : protected:
     128             : 
     129             :     virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const SAL_OVERRIDE;
     130             :     virtual bool ReadData( const ::com::sun::star::uno::Any* pValues ) SAL_OVERRIDE;
     131             :     virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const SAL_OVERRIDE;
     132             : 
     133             : public:
     134             :             SdOptionsLayout( sal_uInt16 nConfigId, bool bUseConfig );
     135          15 :             virtual ~SdOptionsLayout() {}
     136             : 
     137             :     bool    operator==( const SdOptionsLayout& rOpt ) const;
     138             : 
     139         233 :     bool    IsRulerVisible() const { Init(); return bRuler; }
     140         233 :     bool    IsMoveOutline() const { Init(); return bMoveOutline; }
     141         233 :     bool    IsDragStripes() const { Init(); return bDragStripes; }
     142         233 :     bool    IsHandlesBezier() const { Init(); return bHandlesBezier; }
     143         233 :     bool    IsHelplines() const { Init(); return bHelplines; }
     144        3213 :     sal_uInt16  GetMetric() const { Init(); return( ( 0xffff == nMetric ) ? (sal_uInt16)SfxModule::GetCurrentFieldUnit() : nMetric ); }
     145         320 :     sal_uInt16  GetDefTab() const { Init(); return nDefTab; }
     146             : 
     147          26 :     void    SetRulerVisible( bool bOn = true ) { if( bRuler != bOn ) { OptionsChanged(); bRuler = bOn; } }
     148          26 :     void    SetMoveOutline( bool bOn = true ) { if( bMoveOutline != bOn ) { OptionsChanged(); bMoveOutline = bOn; } }
     149          26 :     void    SetDragStripes( bool bOn = true ) { if( bDragStripes != bOn ) { OptionsChanged(); bDragStripes = bOn; } }
     150          26 :     void    SetHandlesBezier( bool bOn = true ) { if( bHandlesBezier != bOn ) { OptionsChanged(); bHandlesBezier = bOn; } }
     151          26 :     void    SetHelplines( bool bOn = true ) { if( bHelplines != bOn ) { OptionsChanged(); bHelplines = bOn; } }
     152          26 :     void    SetMetric( sal_uInt16 nInMetric ) { if( nMetric != nInMetric ) { OptionsChanged(); nMetric = nInMetric; } }
     153          26 :     void    SetDefTab( sal_uInt16 nTab ) { if( nDefTab != nTab ) { OptionsChanged(); nDefTab = nTab; } }
     154             : };
     155             : 
     156           0 : class SD_DLLPUBLIC SdOptionsLayoutItem : public SfxPoolItem
     157             : {
     158             : public:
     159             : 
     160             :                             SdOptionsLayoutItem( sal_uInt16 nWhich);
     161             :                             SdOptionsLayoutItem( sal_uInt16 nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
     162             : 
     163             :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     164             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
     165             : 
     166             :     void                    SetOptions( SdOptions* pOpts ) const;
     167             : 
     168           0 :     SdOptionsLayout&        GetOptionsLayout() { return maOptionsLayout; }
     169             : private:
     170             :     SdOptionsLayout maOptionsLayout;
     171             : };
     172             : 
     173           0 : class SD_DLLPUBLIC SdOptionsContents : public SdOptionsGeneric
     174             : {
     175             : private:
     176             : protected:
     177             : 
     178             :     virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const SAL_OVERRIDE;
     179             :     virtual bool ReadData( const ::com::sun::star::uno::Any* pValues ) SAL_OVERRIDE;
     180             :     virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const SAL_OVERRIDE;
     181             : 
     182             : public:
     183             : 
     184             :             SdOptionsContents( sal_uInt16 nConfigId, bool bUseConfig );
     185          15 :             virtual ~SdOptionsContents() {}
     186             : 
     187             :     bool    operator==( const SdOptionsContents& rOpt ) const;
     188             : };
     189             : 
     190           0 : class SD_DLLPUBLIC SdOptionsContentsItem : public SfxPoolItem
     191             : {
     192             : public:
     193             : 
     194             :                             SdOptionsContentsItem( sal_uInt16 nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
     195             : 
     196             :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     197             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
     198             : 
     199             :     SdOptionsContents&      GetOptionsContents() { return maOptionsContents; }
     200             : private:
     201             :     SdOptionsContents       maOptionsContents;
     202             : };
     203             : 
     204           0 : class SD_DLLPUBLIC SdOptionsMisc : public SdOptionsGeneric
     205             : {
     206             : private:
     207             : 
     208             :     sal_uLong   nDefaultObjectSizeWidth;
     209             :     sal_uLong   nDefaultObjectSizeHeight;
     210             : 
     211             :     bool    bStartWithTemplate      : 1;    // Misc/NewDoc/AutoPilot
     212             :     bool    bMarkedHitMovesAlways   : 1;    // Misc/ObjectMoveable
     213             :     bool    bMoveOnlyDragging       : 1;    // Currently, not in use !!!
     214             :     bool    bCrookNoContortion      : 1;    // Misc/NoDistort
     215             :     bool    bQuickEdit              : 1;    // Misc/TextObject/QuickEditing
     216             :     bool    bMasterPageCache        : 1;    // Misc/BackgroundCache
     217             :     bool    bDragWithCopy           : 1;    // Misc/CopyWhileMoving
     218             :     bool    bPickThrough            : 1;    // Misc/TextObject/Selectable
     219             :     bool    bDoubleClickTextEdit    : 1;    // Misc/DclickTextedit
     220             :     bool    bClickChangeRotation    : 1;    // Misc/RotateClick
     221             :     bool    bEnableSdremote         : 1;    // Misc/Start/EnableSdremote
     222             :     bool    bEnablePresenterScreen : 1;    // Misc/Start/EnablePresenterDisplay
     223             :     bool    bSolidDragging          : 1;    // Misc/ModifyWithAttributes
     224             :     bool    bSummationOfParagraphs  : 1;    // misc/SummationOfParagraphs
     225             :     bool    bShowUndoDeleteWarning  : 1;    // Misc/ShowUndoDeleteWarning
     226             :     // #i75315#
     227             :     bool    bSlideshowRespectZOrder : 1;    // Misc/SlideshowRespectZOrder
     228             :     bool    bShowComments           : 1;    // Misc/ShowComments
     229             : 
     230             :     bool    bPreviewNewEffects;
     231             :     bool    bPreviewChangedEffects;
     232             :     bool    bPreviewTransitions;
     233             : 
     234             :     sal_Int32   mnDisplay;
     235             : 
     236             :     sal_Int32 mnPenColor;
     237             :     double mnPenWidth;
     238             : 
     239             :     /** This value controls the device to use for formatting documents.
     240             :         The currently supported values are 0 for the current printer or 1
     241             :         for the printer independent virtual device the can be retrieved from
     242             :         the modules.
     243             :     */
     244             :     sal_uInt16  mnPrinterIndependentLayout;     // Misc/Compatibility/PrinterIndependentLayout
     245             : // Misc
     246             : 
     247             : protected:
     248             : 
     249             :     virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const SAL_OVERRIDE;
     250             :     virtual bool ReadData( const ::com::sun::star::uno::Any* pValues ) SAL_OVERRIDE;
     251             :     virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const SAL_OVERRIDE;
     252             : 
     253             : public:
     254             : 
     255             :             SdOptionsMisc( sal_uInt16 nConfigId, bool bUseConfig );
     256          15 :             virtual ~SdOptionsMisc() {}
     257             : 
     258             :     bool    operator==( const SdOptionsMisc& rOpt ) const;
     259             : 
     260           0 :     bool    IsStartWithTemplate() const { Init(); return bStartWithTemplate; }
     261         233 :     bool    IsMarkedHitMovesAlways() const { Init(); return bMarkedHitMovesAlways; }
     262         466 :     bool    IsMoveOnlyDragging() const { Init(); return bMoveOnlyDragging; }
     263         233 :     bool    IsCrookNoContortion() const { Init(); return bCrookNoContortion; }
     264         233 :     bool    IsQuickEdit() const { Init(); return bQuickEdit; }
     265         233 :     bool    IsMasterPagePaintCaching() const { Init(); return bMasterPageCache; }
     266         233 :     bool    IsDragWithCopy() const { Init(); return bDragWithCopy; }
     267         694 :     bool    IsPickThrough() const { Init(); return bPickThrough; }
     268         233 :     bool    IsDoubleClickTextEdit() const { Init(); return bDoubleClickTextEdit; }
     269         233 :     bool    IsClickChangeRotation() const { Init(); return bClickChangeRotation; }
     270           0 :     bool    IsEnableSdremote() const { Init(); return bEnableSdremote; }
     271           0 :     bool    IsEnablePresenterScreen() const { Init(); return bEnablePresenterScreen; }
     272         233 :     bool    IsSolidDragging() const { Init(); return bSolidDragging; }
     273         776 :     bool    IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs; };
     274             : 
     275             :     /** Return the currently selected printer independent layout mode.
     276             :         @return
     277             :             Returns 1 for printer independent layout enabled and 0 when it
     278             :             is disabled.  Other values are reserved for future use.
     279             :     */
     280         320 :     sal_uInt16  GetPrinterIndependentLayout() const { Init(); return mnPrinterIndependentLayout; };
     281           0 :     bool    IsShowUndoDeleteWarning() const { Init(); return bShowUndoDeleteWarning; }
     282           0 :     bool    IsSlideshowRespectZOrder() const { Init(); return bSlideshowRespectZOrder; }
     283           0 :     sal_uLong   GetDefaultObjectSizeWidth() const { Init(); return nDefaultObjectSizeWidth; }
     284           0 :     sal_uLong   GetDefaultObjectSizeHeight() const { Init(); return nDefaultObjectSizeHeight; }
     285             : 
     286           0 :     bool    IsPreviewNewEffects() const { Init(); return bPreviewNewEffects; }
     287           0 :     bool    IsPreviewChangedEffects() const { Init(); return bPreviewChangedEffects; }
     288           0 :     bool    IsPreviewTransitions() const { Init(); return bPreviewTransitions; }
     289             : 
     290             :     sal_Int32   GetDisplay() const;
     291             :     void        SetDisplay( sal_Int32 nDisplay = 0 );
     292             : 
     293           0 :     sal_Int32 GetPresentationPenColor() const { Init(); return mnPenColor; }
     294          14 :     void      SetPresentationPenColor( sal_Int32 nPenColor ) { if( mnPenColor != nPenColor ) { OptionsChanged(); mnPenColor = nPenColor; } }
     295             : 
     296           0 :     double    GetPresentationPenWidth() const { Init(); return mnPenWidth; }
     297          14 :     void      SetPresentationPenWidth( double nPenWidth ) { if( mnPenWidth != nPenWidth ) { OptionsChanged(); mnPenWidth = nPenWidth; } }
     298             : 
     299          14 :     void    SetStartWithTemplate( bool bOn = true ) { if( bStartWithTemplate != bOn ) { OptionsChanged(); bStartWithTemplate = bOn; } }
     300          26 :     void    SetMarkedHitMovesAlways( bool bOn = true ) { if( bMarkedHitMovesAlways != bOn ) { OptionsChanged(); bMarkedHitMovesAlways = bOn; } }
     301           0 :     void    SetMoveOnlyDragging( bool bOn = true ) { if( bMoveOnlyDragging != bOn ) { OptionsChanged(); bMoveOnlyDragging = bOn; } }
     302          26 :     void    SetCrookNoContortion( bool bOn = true ) { if( bCrookNoContortion != bOn ) { OptionsChanged(); bCrookNoContortion = bOn; } }
     303          26 :     void    SetQuickEdit( bool bOn = true ) { if( bQuickEdit != bOn ) { OptionsChanged(); bQuickEdit = bOn; } }
     304          26 :     void    SetMasterPagePaintCaching( bool bOn = true ) { if( bMasterPageCache != bOn ) { OptionsChanged(); bMasterPageCache = bOn; } }
     305          26 :     void    SetDragWithCopy( bool bOn = true ) { if( bDragWithCopy != bOn ) { OptionsChanged(); bDragWithCopy = bOn; } }
     306          26 :     void    SetPickThrough( bool bOn = true ) { if( bPickThrough != bOn ) { OptionsChanged(); bPickThrough = bOn; } }
     307          26 :     void    SetDoubleClickTextEdit( bool bOn = true ) { if( bDoubleClickTextEdit != bOn ) { OptionsChanged(); bDoubleClickTextEdit = bOn; } }
     308          26 :     void    SetClickChangeRotation( bool bOn = true ) { if( bClickChangeRotation != bOn ) { OptionsChanged(); bClickChangeRotation = bOn; } }
     309          14 :     void    SetEnableSdremote( bool bOn = true ) { if( bEnableSdremote != bOn ) { OptionsChanged(); bEnableSdremote = bOn; } }
     310          14 :     void    SetEnablePresenterScreen( bool bOn = true ) { if( bEnablePresenterScreen != bOn ) { OptionsChanged(); bEnablePresenterScreen = bOn; } }
     311          14 :     void    SetSummationOfParagraphs( bool bOn = true ){ if ( bOn != bSummationOfParagraphs ) { OptionsChanged(); bSummationOfParagraphs = bOn; } }
     312             :     /** Set the printer independent layout mode.
     313             :         @param nOn
     314             :             The default value is to switch printer independent layout on,
     315             :             hence the parameters name.  Use 0 for turning it off.  Other
     316             :             values are reserved for future use.
     317             :     */
     318          26 :     void    SetPrinterIndependentLayout (sal_uInt16 nOn = 1 ){ if ( nOn != mnPrinterIndependentLayout ) { OptionsChanged(); mnPrinterIndependentLayout = nOn; } }
     319          26 :     void    SetSolidDragging( bool bOn = true ) { if( bSolidDragging != bOn ) { OptionsChanged(); bSolidDragging = bOn; } }
     320          14 :     void    SetShowUndoDeleteWarning( bool bOn = true ) { if( bShowUndoDeleteWarning != bOn ) { OptionsChanged(); bShowUndoDeleteWarning = bOn; } }
     321          14 :     void    SetSlideshowRespectZOrder( bool bOn = true ) { if( bSlideshowRespectZOrder != bOn ) { OptionsChanged(); bSlideshowRespectZOrder = bOn; } }
     322          26 :     void    SetDefaultObjectSizeWidth( sal_uLong nWidth ) { if( nDefaultObjectSizeWidth != nWidth ) { OptionsChanged(); nDefaultObjectSizeWidth = nWidth; } }
     323          26 :     void    SetDefaultObjectSizeHeight( sal_uLong nHeight ) { if( nDefaultObjectSizeHeight != nHeight ) { OptionsChanged(); nDefaultObjectSizeHeight = nHeight; } }
     324             : 
     325          14 :     void    SetPreviewNewEffects( bool bOn )  { if( bPreviewNewEffects != bOn ) { OptionsChanged(); bPreviewNewEffects = bOn; } }
     326          14 :     void    SetPreviewChangedEffects( bool bOn )  { if( bPreviewChangedEffects != bOn ) { OptionsChanged(); bPreviewChangedEffects = bOn; } }
     327          14 :     void    SetPreviewTransitions( bool bOn )  { if( bPreviewTransitions != bOn ) { OptionsChanged(); bPreviewTransitions = bOn; } }
     328             : 
     329         133 :     bool    IsShowComments() const { Init(); return bShowComments; }
     330          26 :     void    SetShowComments( bool bShow )  { if( bShowComments != bShow ) { OptionsChanged(); bShowComments = bShow; } }
     331             : };
     332             : 
     333           0 : class SD_DLLPUBLIC SdOptionsMiscItem : public SfxPoolItem
     334             : {
     335             : public:
     336             : 
     337             :                             SdOptionsMiscItem( sal_uInt16 nWhich);
     338             :                             SdOptionsMiscItem( sal_uInt16 nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
     339             : 
     340             :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     341             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
     342             : 
     343             :     void                    SetOptions( SdOptions* pOpts ) const;
     344             : 
     345           0 :     SdOptionsMisc&          GetOptionsMisc() { return maOptionsMisc; }
     346           0 :     const SdOptionsMisc&    GetOptionsMisc() const { return maOptionsMisc; }
     347             : private:
     348             :     SdOptionsMisc           maOptionsMisc;
     349             : };
     350             : 
     351           0 : class SD_DLLPUBLIC SdOptionsSnap : public SdOptionsGeneric
     352             : {
     353             : private:
     354             : 
     355             :     bool    bSnapHelplines  : 1;    // Snap/Object/SnapLine
     356             :     bool    bSnapBorder     : 1;    // Snap/Object/PageMargin
     357             :     bool    bSnapFrame      : 1;    // Snap/Object/ObjectFrame
     358             :     bool    bSnapPoints     : 1;    // Snap/Object/ObjectPoint
     359             :     bool    bOrtho          : 1;    // Snap/Position/CreatingMoving
     360             :     bool    bBigOrtho       : 1;    // Snap/Position/ExtendEdges
     361             :     bool    bRotate         : 1;    // Snap/Position/Rotating
     362             :     sal_Int16   nSnapArea;              // Snap/Object/Range
     363             :     sal_Int16   nAngle;                 // Snap/Position/RotatingValue
     364             :     sal_Int16   nBezAngle;              // Snap/Position/PointReduction
     365             : 
     366             : protected:
     367             : 
     368             :     virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const SAL_OVERRIDE;
     369             :     virtual bool ReadData( const ::com::sun::star::uno::Any* pValues ) SAL_OVERRIDE;
     370             :     virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const SAL_OVERRIDE;
     371             : 
     372             : public:
     373             : 
     374             :             SdOptionsSnap( sal_uInt16 nConfigId, bool bUseConfig );
     375          15 :             virtual ~SdOptionsSnap() {}
     376             : 
     377             :     bool    operator==( const SdOptionsSnap& rOpt ) const;
     378             : 
     379         233 :     bool    IsSnapHelplines() const { Init(); return bSnapHelplines; }
     380         233 :     bool    IsSnapBorder() const { Init(); return bSnapBorder; }
     381         233 :     bool    IsSnapFrame() const { Init(); return bSnapFrame; }
     382         233 :     bool    IsSnapPoints() const { Init(); return bSnapPoints; }
     383         233 :     bool    IsOrtho() const { Init(); return bOrtho; }
     384         233 :     bool    IsBigOrtho() const { Init(); return bBigOrtho; }
     385         233 :     bool    IsRotate() const { Init(); return bRotate; }
     386         233 :     sal_Int16   GetSnapArea() const { Init(); return nSnapArea; }
     387         233 :     sal_Int16   GetAngle() const { Init(); return nAngle; }
     388         233 :     sal_Int16   GetEliminatePolyPointLimitAngle() const { Init(); return nBezAngle; }
     389             : 
     390          22 :     void    SetSnapHelplines( bool bOn = true ) { if( bSnapHelplines != bOn ) { OptionsChanged(); bSnapHelplines = bOn; } }
     391          22 :     void    SetSnapBorder( bool bOn = true ) { if( bSnapBorder != bOn ) { OptionsChanged(); bSnapBorder = bOn; } }
     392          22 :     void    SetSnapFrame( bool bOn = true ) { if( bSnapFrame != bOn ) { OptionsChanged(); bSnapFrame = bOn; } }
     393          22 :     void    SetSnapPoints( bool bOn = true ) { if( bSnapPoints != bOn ) { OptionsChanged(); bSnapPoints = bOn; } }
     394          22 :     void    SetOrtho( bool bOn = true ) { if( bOrtho != bOn ) { OptionsChanged(); bOrtho = bOn; } }
     395          22 :     void    SetBigOrtho( bool bOn = true ) { if( bBigOrtho != bOn ) { OptionsChanged(); bBigOrtho = bOn; } }
     396          22 :     void    SetRotate( bool bOn = true ) { if( bRotate != bOn ) { OptionsChanged(); bRotate = bOn; } }
     397          22 :     void    SetSnapArea( sal_Int16 nIn ) { if( nSnapArea != nIn ) { OptionsChanged(); nSnapArea = nIn; } }
     398          22 :     void    SetAngle( sal_Int16 nIn ) { if( nAngle != nIn ) { OptionsChanged(); nAngle = nIn; } }
     399          22 :     void    SetEliminatePolyPointLimitAngle( sal_Int16 nIn ) { if( nBezAngle != nIn ) { OptionsChanged(); nBezAngle = nIn; } }
     400             : };
     401             : 
     402           0 : class SD_DLLPUBLIC SdOptionsSnapItem : public SfxPoolItem
     403             : {
     404             : public:
     405             : 
     406             :                             SdOptionsSnapItem( sal_uInt16 nWhich);
     407             :                             SdOptionsSnapItem( sal_uInt16 nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
     408             : 
     409             :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     410             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
     411             : 
     412             :     void                    SetOptions( SdOptions* pOpts ) const;
     413             : 
     414           0 :     SdOptionsSnap&          GetOptionsSnap() { return maOptionsSnap; }
     415             : private:
     416             :     SdOptionsSnap           maOptionsSnap;
     417             : };
     418             : 
     419             : class SdOptionsZoom : public SdOptionsGeneric
     420             : {
     421             : private:
     422             : 
     423             :     sal_Int32   nX; // Zoom/ScaleX
     424             :     sal_Int32   nY; // Zoom/ScaleY
     425             : 
     426             : protected:
     427             : 
     428             :     virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const SAL_OVERRIDE;
     429             :     virtual bool ReadData( const ::com::sun::star::uno::Any* pValues ) SAL_OVERRIDE;
     430             :     virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const SAL_OVERRIDE;
     431             : 
     432             : public:
     433             : 
     434             :             SdOptionsZoom( sal_uInt16 nConfigId, bool bUseConfig );
     435          15 :             virtual ~SdOptionsZoom() {}
     436             : 
     437             :     bool    operator==( const SdOptionsZoom& rOpt ) const;
     438             : 
     439         320 :     void    GetScale( sal_Int32& rX, sal_Int32& rY ) const { Init(); rX = nX; rY = nY; }
     440          12 :     void    SetScale( sal_Int32 nInX, sal_Int32 nInY ) { if( nX != nInX || nY != nInY ) { OptionsChanged(); nX = nInX; nY = nInY; } }
     441             : };
     442             : 
     443             : class SdOptionsGrid : public SdOptionsGeneric, public SvxOptionsGrid
     444             : {
     445             : protected:
     446             : 
     447             :     virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const SAL_OVERRIDE;
     448             :     virtual bool ReadData( const ::com::sun::star::uno::Any* pValues ) SAL_OVERRIDE;
     449             :     virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const SAL_OVERRIDE;
     450             : 
     451             : public:
     452             : 
     453             :             SdOptionsGrid( sal_uInt16 nConfigId, bool bUseConfig );
     454             :             virtual ~SdOptionsGrid();
     455             : 
     456             :     void    SetDefaults();
     457             :     bool    operator==( const SdOptionsGrid& rOpt ) const;
     458             : 
     459         699 :     sal_uInt32  GetFieldDrawX() const { Init(); return SvxOptionsGrid::GetFieldDrawX(); }
     460         699 :     sal_uInt32  GetFieldDivisionX() const { Init(); return SvxOptionsGrid::GetFieldDivisionX(); }
     461         699 :     sal_uInt32  GetFieldDrawY() const { Init(); return SvxOptionsGrid::GetFieldDrawY(); }
     462         699 :     sal_uInt32  GetFieldDivisionY() const { Init(); return SvxOptionsGrid::GetFieldDivisionY(); }
     463           0 :     sal_uInt32  GetFieldSnapX() const { Init(); return SvxOptionsGrid::GetFieldSnapX(); }
     464           0 :     sal_uInt32  GetFieldSnapY() const { Init(); return SvxOptionsGrid::GetFieldSnapY(); }
     465         233 :     bool    IsUseGridSnap() const { Init(); return SvxOptionsGrid::GetUseGridSnap(); }
     466           0 :     bool    IsSynchronize() const { Init(); return SvxOptionsGrid::GetSynchronize(); }
     467         233 :     bool    IsGridVisible() const { Init(); return SvxOptionsGrid::GetGridVisible(); }
     468           0 :     bool    IsEqualGrid() const { Init(); return SvxOptionsGrid::GetEqualGrid(); }
     469             : 
     470          48 :     void    SetFieldDrawX( sal_uInt32 nSet ) { if( nSet != SvxOptionsGrid::GetFieldDrawX() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDrawX( nSet ); } }
     471          48 :     void    SetFieldDivisionX( sal_uInt32 nSet ) { if( nSet != SvxOptionsGrid::GetFieldDivisionX() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDivisionX( nSet ); } }
     472          48 :     void    SetFieldDrawY( sal_uInt32 nSet ) { if( nSet != SvxOptionsGrid::GetFieldDrawY() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDrawY( nSet ); } }
     473          48 :     void    SetFieldDivisionY( sal_uInt32 nSet ) { if( nSet != SvxOptionsGrid::GetFieldDivisionY() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDivisionY( nSet ); } }
     474          48 :     void    SetFieldSnapX( sal_uInt32 nSet ) { if( nSet != SvxOptionsGrid::GetFieldSnapX() ) { OptionsChanged(); SvxOptionsGrid::SetFieldSnapX( nSet ); } }
     475          48 :     void    SetFieldSnapY( sal_uInt32 nSet ) { if( nSet != SvxOptionsGrid::GetFieldSnapY() ) { OptionsChanged(); SvxOptionsGrid::SetFieldSnapY( nSet ); } }
     476          48 :     void    SetUseGridSnap( bool bSet ) { if( bSet != SvxOptionsGrid::GetUseGridSnap() ) { OptionsChanged(); SvxOptionsGrid::SetUseGridSnap( bSet ); } }
     477          48 :     void    SetSynchronize( bool bSet ) { if( bSet != SvxOptionsGrid::GetSynchronize() ) { OptionsChanged(); SvxOptionsGrid::SetSynchronize( bSet ); } }
     478          48 :     void    SetGridVisible( bool bSet ) { if( bSet != SvxOptionsGrid::GetGridVisible() ) { OptionsChanged(); SvxOptionsGrid::SetGridVisible( bSet ); } }
     479          48 :     void    SetEqualGrid( bool bSet ) { if( bSet != SvxOptionsGrid::GetEqualGrid() ) { OptionsChanged(); SvxOptionsGrid::SetEqualGrid( bSet ); } }
     480             : };
     481             : 
     482           0 : class SdOptionsGridItem : public SvxGridItem
     483             : {
     484             : 
     485             : public:
     486             :                             SdOptionsGridItem( sal_uInt16 nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
     487             : 
     488             :     void                    SetOptions( SdOptions* pOpts ) const;
     489             : };
     490             : 
     491           0 : class SD_DLLPUBLIC SdOptionsPrint : public SdOptionsGeneric
     492             : {
     493             : private:
     494             : 
     495             :     bool    bDraw               : 1;    // Print/Content/Drawing
     496             :     bool    bNotes              : 1;    // Print/Content/Note
     497             :     bool    bHandout            : 1;    // Print/Content/Handout
     498             :     bool    bOutline            : 1;    // Print/Content/Outline
     499             :     bool    bDate               : 1;    // Print/Other/Date
     500             :     bool    bTime               : 1;    // Print/Other/Time
     501             :     bool    bPagename           : 1;    // Print/Other/PageName
     502             :     bool    bHiddenPages        : 1;    // Print/Other/HiddenPage
     503             :     bool    bPagesize           : 1;    // Print/Page/PageSize
     504             :     bool    bPagetile           : 1;    // Print/Page/PageTile
     505             :     bool    bWarningPrinter     : 1;    //  These flags you get
     506             :     bool    bWarningSize        : 1;    //  from the common options,
     507             :     bool    bWarningOrientation : 1;    //  currently org.openoffice.Office.Common.xml (class OfaMiscCfg ; sfx2/misccfg.hxx )
     508             :     bool    bBooklet            : 1;    // Print/Page/Booklet
     509             :     bool    bFront              : 1;    // Print/Page/BookletFront
     510             :     bool    bBack               : 1;    // Print/Page/BookletFront
     511             :     bool    bCutPage            : 1;    // NOT persistent !!!
     512             :     bool    bPaperbin           : 1;    // Print/Other/FromPrinterSetup
     513             :     bool    mbHandoutHorizontal : 1;    // Order Page previews on Handout Pages horizontal
     514             :     sal_uInt16  mnHandoutPages;             // Number of page previews on handout page (only 1/2/4/6/9 are supported)
     515             :     sal_uInt16  nQuality;                   // Print/Other/Quality
     516             : 
     517             : protected:
     518             : 
     519             :     virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const SAL_OVERRIDE;
     520             :     virtual bool ReadData( const ::com::sun::star::uno::Any* pValues ) SAL_OVERRIDE;
     521             :     virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const SAL_OVERRIDE;
     522             : 
     523             : public:
     524             : 
     525             :             SdOptionsPrint( sal_uInt16 nConfigId, bool bUseConfig );
     526        1915 :             virtual ~SdOptionsPrint() {}
     527             : 
     528             :     bool    operator==( const SdOptionsPrint& rOpt ) const;
     529             : 
     530        1791 :     bool    IsDraw() const { Init(); return bDraw; }
     531        1791 :     bool    IsNotes() const { Init(); return bNotes; }
     532        1791 :     bool    IsHandout() const { Init(); return bHandout; }
     533        1791 :     bool    IsOutline() const { Init(); return bOutline; }
     534        1845 :     bool    IsDate() const { Init(); return bDate; }
     535        1757 :     bool    IsTime() const { Init(); return bTime; }
     536        1801 :     bool    IsPagename() const { Init(); return bPagename; }
     537        1801 :     bool    IsHiddenPages() const { Init(); return bHiddenPages; }
     538        1801 :     bool    IsPagesize() const { Init(); return bPagesize; }
     539        1801 :     bool    IsPagetile() const { Init(); return bPagetile; }
     540        1742 :     bool    IsWarningPrinter() const { Init(); return bWarningPrinter; }
     541        1742 :     bool    IsWarningSize() const { Init(); return bWarningSize; }
     542        1742 :     bool    IsWarningOrientation() const { Init(); return bWarningOrientation; }
     543        1801 :     bool    IsBooklet() const { Init(); return bBooklet; }
     544        1801 :     bool    IsFrontPage() const { Init(); return bFront; }
     545        1801 :     bool    IsBackPage() const { Init(); return bBack; }
     546        1742 :     bool    IsCutPage() const { Init(); return bCutPage; }
     547        1742 :     bool    IsPaperbin() const { Init(); return bPaperbin; }
     548        1801 :     sal_uInt16  GetOutputQuality() const { Init(); return nQuality; }
     549          49 :     bool    IsHandoutHorizontal() const { Init(); return mbHandoutHorizontal; }
     550          49 :     sal_uInt16  GetHandoutPages() const { Init(); return mnHandoutPages; }
     551             : 
     552        1742 :     void    SetDraw( bool bOn = true ) { if( bDraw != bOn ) { OptionsChanged(); bDraw = bOn; } }
     553        1742 :     void    SetNotes( bool bOn = true ) { if( bNotes != bOn ) { OptionsChanged(); bNotes = bOn; } }
     554        1742 :     void    SetHandout( bool bOn = true ) { if( bHandout != bOn ) { OptionsChanged(); bHandout = bOn; } }
     555        1742 :     void    SetOutline( bool bOn = true ) { if( bOutline != bOn ) { OptionsChanged(); bOutline = bOn; } }
     556        1742 :     void    SetDate( bool bOn = true ) { if( bDate != bOn ) { OptionsChanged(); bDate = bOn; } }
     557        1742 :     void    SetTime( bool bOn = true ) { if( bTime != bOn ) { OptionsChanged(); bTime = bOn; } }
     558        1742 :     void    SetPagename( bool bOn = true ) { if( bPagename != bOn ) { OptionsChanged(); bPagename = bOn; } }
     559        1742 :     void    SetHiddenPages( bool bOn = true ) { if( bHiddenPages != bOn ) { OptionsChanged(); bHiddenPages = bOn; } }
     560        1742 :     void    SetPagesize( bool bOn = true ) { if( bPagesize != bOn ) { OptionsChanged(); bPagesize = bOn; } }
     561        1742 :     void    SetPagetile( bool bOn = true ) { if( bPagetile != bOn ) { OptionsChanged(); bPagetile = bOn; } }
     562        1742 :     void    SetWarningPrinter( bool bOn = true ) { if( bWarningPrinter != bOn ) { OptionsChanged(); bWarningPrinter = bOn; } }
     563        1742 :     void    SetWarningSize( bool bOn = true ) { if( bWarningSize != bOn ) { OptionsChanged(); bWarningSize = bOn; } }
     564        1742 :     void    SetWarningOrientation( bool bOn = true ) { if( bWarningOrientation != bOn ) { OptionsChanged(); bWarningOrientation = bOn; } }
     565        1742 :     void    SetBooklet( bool bOn = true ) { if( bBooklet != bOn ) { OptionsChanged(); bBooklet = bOn; } }
     566        1742 :     void    SetFrontPage( bool bOn = true ) { if( bFront != bOn ) { OptionsChanged(); bFront = bOn; } }
     567        1742 :     void    SetBackPage( bool bOn = true ) { if( bBack != bOn ) { OptionsChanged(); bBack = bOn; } }
     568        1742 :     void    SetCutPage( bool bOn = true ) { if( bCutPage != bOn ) { OptionsChanged(); bCutPage = bOn; } }
     569        1742 :     void    SetPaperbin( bool bOn = true ) { if( bPaperbin != bOn ) { OptionsChanged(); bPaperbin = bOn; } }
     570        1742 :     void    SetOutputQuality( sal_uInt16 nInQuality ) { if( nQuality != nInQuality ) { OptionsChanged(); nQuality = nInQuality; } }
     571           0 :     void    SetHandoutHorizontal( bool bHandoutHorizontal ) { if( mbHandoutHorizontal != bHandoutHorizontal ) { OptionsChanged(); mbHandoutHorizontal = bHandoutHorizontal; } }
     572           0 :     void    SetHandoutPages( sal_uInt16 nHandoutPages ) { if( nHandoutPages != mnHandoutPages ) { OptionsChanged(); mnHandoutPages = nHandoutPages; } }
     573             : };
     574             : 
     575        1900 : class SD_DLLPUBLIC SdOptionsPrintItem : public SfxPoolItem
     576             : {
     577             : public:
     578             : 
     579             :                             SdOptionsPrintItem( sal_uInt16 nWhich);
     580             :                             SdOptionsPrintItem( sal_uInt16 nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
     581             : 
     582             :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     583             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
     584             : 
     585             :     void                    SetOptions( SdOptions* pOpts ) const;
     586             : 
     587        1900 :     SdOptionsPrint&         GetOptionsPrint() { return maOptionsPrint; }
     588           0 :     const SdOptionsPrint&   GetOptionsPrint() const { return maOptionsPrint; }
     589             : private:
     590             :     SdOptionsPrint  maOptionsPrint;
     591             : };
     592             : 
     593             : class SdOptions : public SdOptionsLayout, public SdOptionsContents,
     594             :                   public SdOptionsMisc, public SdOptionsSnap,
     595             :                   public SdOptionsZoom, public SdOptionsGrid,
     596             :                   public SdOptionsPrint
     597             : {
     598             : public:
     599             : 
     600             :                         SdOptions( sal_uInt16 nConfigId );
     601             :                         virtual ~SdOptions();
     602             : 
     603             :     void                StoreConfig( sal_uLong nOptionRange = SD_OPTIONS_ALL );
     604             : };
     605             : 
     606             : #endif // INCLUDED_SD_SOURCE_UI_INC_OPTSITEM_HXX
     607             : 
     608             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11