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

Generated by: LCOV version 1.10