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

Generated by: LCOV version 1.10