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

Generated by: LCOV version 1.10