1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SD_SOURCE_UI_INC_OPTSITEM_HXX
21 #define INCLUDED_SD_SOURCE_UI_INC_OPTSITEM_HXX
23 #include <unotools/configitem.hxx>
24 #include <sfx2/module.hxx>
25 #include <svx/optgrid.hxx>
35 class SdOptionsGeneric
;
37 class SD_DLLPUBLIC SdOptionsItem
: public ::utl::ConfigItem
42 const SdOptionsGeneric
& mrParent
;
44 virtual void ImplCommit() override
;
48 SdOptionsItem( const SdOptionsGeneric
& rParent
, const OUString
& rSubTree
);
49 virtual ~SdOptionsItem() override
;
51 SdOptionsItem(SdOptionsItem
const &) = default;
52 SdOptionsItem(SdOptionsItem
&&) = default;
53 SdOptionsItem
& operator =(SdOptionsItem
const &) = delete; // due to ConfigItem
54 SdOptionsItem
& operator =(SdOptionsItem
&&) = delete; // due to ConfigItem
56 virtual void Notify( const css::uno::Sequence
<OUString
>& aPropertyNames
) override
;
58 css::uno::Sequence
< css::uno::Any
> GetProperties( const css::uno::Sequence
< OUString
>& rNames
);
59 bool PutProperties( const css::uno::Sequence
< OUString
>& rNames
,
60 const css::uno::Sequence
< css::uno::Any
>& rValues
);
61 using ConfigItem::SetModified
;
64 class SD_DLLPUBLIC SdOptionsGeneric
66 friend class SdOptionsItem
;
71 std::unique_ptr
<SdOptionsItem
>
75 bool mbEnableModify
: 1;
77 SAL_DLLPRIVATE
void Commit( SdOptionsItem
& rCfgItem
) const;
78 SAL_DLLPRIVATE
css::uno::Sequence
< OUString
> GetPropertyNames() const;
83 void OptionsChanged() { if( mpCfgItem
&& mbEnableModify
) mpCfgItem
->SetModified(); }
87 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const = 0;
88 virtual bool ReadData( const css::uno::Any
* pValues
) = 0;
89 virtual bool WriteData( css::uno::Any
* pValues
) const = 0;
93 SdOptionsGeneric(bool bImpress
, const OUString
& rSubTree
);
94 SdOptionsGeneric(SdOptionsGeneric
const &);
95 virtual ~SdOptionsGeneric();
97 SdOptionsGeneric
& operator=( SdOptionsGeneric
const & );
99 bool IsImpress() const { return mbImpress
; }
101 void EnableModify( bool bModify
) { mbEnableModify
= bModify
; }
105 static bool isMetricSystem();
108 class SD_DLLPUBLIC SdOptionsLayout
: public SdOptionsGeneric
112 bool bRuler
; // Layout/Display/Ruler
113 bool bMoveOutline
; // Layout/Display/Contour
114 bool bDragStripes
; // Layout/Display/Guide
115 bool bHandlesBezier
; // Layout/Display/Bezier
116 bool bHelplines
; // Layout/Display/Helpline
117 sal_uInt16 nMetric
; // Layout/Other/MeasureUnit
118 sal_uInt16 nDefTab
; // Layout/Other/TabStop
122 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const override
;
123 virtual bool ReadData( const css::uno::Any
* pValues
) override
;
124 virtual bool WriteData( css::uno::Any
* pValues
) const override
;
127 SdOptionsLayout(bool bImpress
, bool bUseConfig
);
129 bool operator==( const SdOptionsLayout
& rOpt
) const;
131 bool IsRulerVisible() const { Init(); return bRuler
; }
132 bool IsMoveOutline() const { Init(); return bMoveOutline
; }
133 bool IsDragStripes() const { Init(); return bDragStripes
; }
134 bool IsHandlesBezier() const { Init(); return bHandlesBezier
; }
135 bool IsHelplines() const { Init(); return bHelplines
; }
136 sal_uInt16
GetMetric() const { Init(); return( ( 0xffff == nMetric
) ? static_cast<sal_uInt16
>(SfxModule::GetCurrentFieldUnit()) : nMetric
); }
137 sal_uInt16
GetDefTab() const { Init(); return nDefTab
; }
139 void SetRulerVisible( bool bOn
) { if( bRuler
!= bOn
) { OptionsChanged(); bRuler
= bOn
; } }
140 void SetMoveOutline( bool bOn
) { if( bMoveOutline
!= bOn
) { OptionsChanged(); bMoveOutline
= bOn
; } }
141 void SetDragStripes( bool bOn
) { if( bDragStripes
!= bOn
) { OptionsChanged(); bDragStripes
= bOn
; } }
142 void SetHandlesBezier( bool bOn
) { if( bHandlesBezier
!= bOn
) { OptionsChanged(); bHandlesBezier
= bOn
; } }
143 void SetHelplines( bool bOn
) { if( bHelplines
!= bOn
) { OptionsChanged(); bHelplines
= bOn
; } }
144 void SetMetric( sal_uInt16 nInMetric
) { if( nMetric
!= nInMetric
) { OptionsChanged(); nMetric
= nInMetric
; } }
145 void SetDefTab( sal_uInt16 nTab
) { if( nDefTab
!= nTab
) { OptionsChanged(); nDefTab
= nTab
; } }
148 class SD_DLLPUBLIC SdOptionsLayoutItem
: public SfxPoolItem
152 explicit SdOptionsLayoutItem();
153 SdOptionsLayoutItem( SdOptions
const * pOpts
, ::sd::FrameView
const * pView
);
155 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
156 virtual bool operator==( const SfxPoolItem
& ) const override
;
158 void SetOptions( SdOptions
* pOpts
) const;
160 SdOptionsLayout
& GetOptionsLayout() { return maOptionsLayout
; }
162 SdOptionsLayout maOptionsLayout
;
165 class SD_DLLPUBLIC SdOptionsContents
: public SdOptionsGeneric
170 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const override
;
171 virtual bool ReadData( const css::uno::Any
* pValues
) override
;
172 virtual bool WriteData( css::uno::Any
* pValues
) const override
;
176 SdOptionsContents(bool bImpress
);
178 bool operator==( const SdOptionsContents
& rOpt
) const;
181 class SD_DLLPUBLIC SdOptionsMisc
: public SdOptionsGeneric
185 sal_uLong nDefaultObjectSizeWidth
;
186 sal_uLong nDefaultObjectSizeHeight
;
188 bool bStartWithTemplate
: 1; // Misc/NewDoc/AutoPilot
189 bool bMarkedHitMovesAlways
: 1; // Misc/ObjectMoveable
190 bool bMoveOnlyDragging
: 1; // Currently, not in use !!!
191 bool bCrookNoContortion
: 1; // Misc/NoDistort
192 bool bQuickEdit
: 1; // Misc/TextObject/QuickEditing
193 bool bMasterPageCache
: 1; // Misc/BackgroundCache
194 bool bDragWithCopy
: 1; // Misc/CopyWhileMoving
195 bool bPickThrough
: 1; // Misc/TextObject/Selectable
196 bool bDoubleClickTextEdit
: 1; // Misc/DclickTextedit
197 bool bClickChangeRotation
: 1; // Misc/RotateClick
198 bool bEnableSdremote
: 1; // Misc/Start/EnableSdremote
199 bool bEnablePresenterScreen
: 1; // Misc/Start/EnablePresenterDisplay
200 bool bSolidDragging
: 1; // Misc/ModifyWithAttributes
201 bool bSummationOfParagraphs
: 1; // misc/SummationOfParagraphs
202 bool bTabBarVisible
: 1; // Misc/TabBarVisible
203 bool bShowUndoDeleteWarning
: 1; // Misc/ShowUndoDeleteWarning
205 bool bSlideshowRespectZOrder
: 1; // Misc/SlideshowRespectZOrder
206 bool bShowComments
: 1; // Misc/ShowComments
208 bool bPreviewNewEffects
;
209 bool bPreviewChangedEffects
;
210 bool bPreviewTransitions
;
215 sal_Int32 mnPenColor
;
218 /** This value controls the device to use for formatting documents.
219 The currently supported values are 0 for the current printer or 1
220 for the printer independent virtual device the can be retrieved from
223 sal_uInt16 mnPrinterIndependentLayout
; // Misc/Compatibility/PrinterIndependentLayout
228 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const override
;
229 virtual bool ReadData( const css::uno::Any
* pValues
) override
;
230 virtual bool WriteData( css::uno::Any
* pValues
) const override
;
234 SdOptionsMisc(bool bImpress
, bool bUseConfig
);
236 bool operator==( const SdOptionsMisc
& rOpt
) const;
238 bool IsStartWithTemplate() const { Init(); return bStartWithTemplate
; }
239 bool IsMarkedHitMovesAlways() const { Init(); return bMarkedHitMovesAlways
; }
240 bool IsMoveOnlyDragging() const { Init(); return bMoveOnlyDragging
; }
241 bool IsCrookNoContortion() const { Init(); return bCrookNoContortion
; }
242 bool IsQuickEdit() const { Init(); return bQuickEdit
; }
243 bool IsMasterPagePaintCaching() const { Init(); return bMasterPageCache
; }
244 bool IsDragWithCopy() const { Init(); return bDragWithCopy
; }
245 bool IsPickThrough() const { Init(); return bPickThrough
; }
246 bool IsDoubleClickTextEdit() const { Init(); return bDoubleClickTextEdit
; }
247 bool IsClickChangeRotation() const { Init(); return bClickChangeRotation
; }
248 bool IsEnableSdremote() const { Init(); return bEnableSdremote
; }
249 bool IsEnablePresenterScreen() const { Init(); return bEnablePresenterScreen
; }
250 bool IsSolidDragging() const { Init(); return bSolidDragging
; }
251 bool IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs
; };
252 bool IsTabBarVisible() const { Init(); return bTabBarVisible
; };
254 /** Return the currently selected printer independent layout mode.
256 Returns 1 for printer independent layout enabled and 0 when it
257 is disabled. Other values are reserved for future use.
259 sal_uInt16
GetPrinterIndependentLayout() const { Init(); return mnPrinterIndependentLayout
; };
260 bool IsShowUndoDeleteWarning() const { Init(); return bShowUndoDeleteWarning
; }
261 bool IsSlideshowRespectZOrder() const { Init(); return bSlideshowRespectZOrder
; }
262 sal_uLong
GetDefaultObjectSizeWidth() const { Init(); return nDefaultObjectSizeWidth
; }
263 sal_uLong
GetDefaultObjectSizeHeight() const { Init(); return nDefaultObjectSizeHeight
; }
265 bool IsPreviewNewEffects() const { Init(); return bPreviewNewEffects
; }
266 bool IsPreviewChangedEffects() const { Init(); return bPreviewChangedEffects
; }
267 bool IsPreviewTransitions() const { Init(); return bPreviewTransitions
; }
269 sal_Int32
GetDisplay() const;
270 void SetDisplay( sal_Int32 nDisplay
);
272 sal_Int32
GetPresentationPenColor() const { Init(); return mnPenColor
; }
273 void SetPresentationPenColor( sal_Int32 nPenColor
) { if( mnPenColor
!= nPenColor
) { OptionsChanged(); mnPenColor
= nPenColor
; } }
275 double GetPresentationPenWidth() const { Init(); return mnPenWidth
; }
276 void SetPresentationPenWidth( double nPenWidth
) { if( mnPenWidth
!= nPenWidth
) { OptionsChanged(); mnPenWidth
= nPenWidth
; } }
278 void SetStartWithTemplate( bool bOn
) { if( bStartWithTemplate
!= bOn
) { OptionsChanged(); bStartWithTemplate
= bOn
; } }
279 void SetMarkedHitMovesAlways( bool bOn
) { if( bMarkedHitMovesAlways
!= bOn
) { OptionsChanged(); bMarkedHitMovesAlways
= bOn
; } }
280 void SetMoveOnlyDragging( bool bOn
) { if( bMoveOnlyDragging
!= bOn
) { OptionsChanged(); bMoveOnlyDragging
= bOn
; } }
281 void SetCrookNoContortion( bool bOn
) { if( bCrookNoContortion
!= bOn
) { OptionsChanged(); bCrookNoContortion
= bOn
; } }
282 void SetQuickEdit( bool bOn
) { if( bQuickEdit
!= bOn
) { OptionsChanged(); bQuickEdit
= bOn
; } }
283 void SetMasterPagePaintCaching( bool bOn
) { if( bMasterPageCache
!= bOn
) { OptionsChanged(); bMasterPageCache
= bOn
; } }
284 void SetDragWithCopy( bool bOn
) { if( bDragWithCopy
!= bOn
) { OptionsChanged(); bDragWithCopy
= bOn
; } }
285 void SetPickThrough( bool bOn
) { if( bPickThrough
!= bOn
) { OptionsChanged(); bPickThrough
= bOn
; } }
286 void SetDoubleClickTextEdit( bool bOn
) { if( bDoubleClickTextEdit
!= bOn
) { OptionsChanged(); bDoubleClickTextEdit
= bOn
; } }
287 void SetClickChangeRotation( bool bOn
) { if( bClickChangeRotation
!= bOn
) { OptionsChanged(); bClickChangeRotation
= bOn
; } }
288 void SetEnableSdremote( bool bOn
) { if( bEnableSdremote
!= bOn
) { OptionsChanged(); bEnableSdremote
= bOn
; } }
289 void SetEnablePresenterScreen( bool bOn
) { if( bEnablePresenterScreen
!= bOn
) { OptionsChanged(); bEnablePresenterScreen
= bOn
; } }
290 void SetSummationOfParagraphs( bool bOn
){ if ( bOn
!= bSummationOfParagraphs
) { OptionsChanged(); bSummationOfParagraphs
= bOn
; } }
291 void SetTabBarVisible( bool bOn
){ if ( bOn
!= bTabBarVisible
) { OptionsChanged(); bTabBarVisible
= bOn
; } }
292 /** Set the printer independent layout mode.
294 The default value is to switch printer independent layout on,
295 hence the parameters name. Use 0 for turning it off. Other
296 values are reserved for future use.
298 void SetPrinterIndependentLayout (sal_uInt16 nOn
){ if ( nOn
!= mnPrinterIndependentLayout
) { OptionsChanged(); mnPrinterIndependentLayout
= nOn
; } }
299 void SetSolidDragging( bool bOn
) { if( bSolidDragging
!= bOn
) { OptionsChanged(); bSolidDragging
= bOn
; } }
300 void SetShowUndoDeleteWarning( bool bOn
) { if( bShowUndoDeleteWarning
!= bOn
) { OptionsChanged(); bShowUndoDeleteWarning
= bOn
; } }
301 void SetSlideshowRespectZOrder( bool bOn
) { if( bSlideshowRespectZOrder
!= bOn
) { OptionsChanged(); bSlideshowRespectZOrder
= bOn
; } }
302 void SetDefaultObjectSizeWidth( sal_uLong nWidth
) { if( nDefaultObjectSizeWidth
!= nWidth
) { OptionsChanged(); nDefaultObjectSizeWidth
= nWidth
; } }
303 void SetDefaultObjectSizeHeight( sal_uLong nHeight
) { if( nDefaultObjectSizeHeight
!= nHeight
) { OptionsChanged(); nDefaultObjectSizeHeight
= nHeight
; } }
305 void SetPreviewNewEffects( bool bOn
) { if( bPreviewNewEffects
!= bOn
) { OptionsChanged(); bPreviewNewEffects
= bOn
; } }
306 void SetPreviewChangedEffects( bool bOn
) { if( bPreviewChangedEffects
!= bOn
) { OptionsChanged(); bPreviewChangedEffects
= bOn
; } }
307 void SetPreviewTransitions( bool bOn
) { if( bPreviewTransitions
!= bOn
) { OptionsChanged(); bPreviewTransitions
= bOn
; } }
309 bool IsShowComments() const { Init(); return bShowComments
; }
310 void SetShowComments( bool bShow
) { if( bShowComments
!= bShow
) { OptionsChanged(); bShowComments
= bShow
; } }
313 class SD_DLLPUBLIC SdOptionsMiscItem
: public SfxPoolItem
317 explicit SdOptionsMiscItem();
318 SdOptionsMiscItem( SdOptions
const * pOpts
, ::sd::FrameView
const * pView
);
320 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
321 virtual bool operator==( const SfxPoolItem
& ) const override
;
323 void SetOptions( SdOptions
* pOpts
) const;
325 SdOptionsMisc
& GetOptionsMisc() { return maOptionsMisc
; }
326 const SdOptionsMisc
& GetOptionsMisc() const { return maOptionsMisc
; }
328 SdOptionsMisc maOptionsMisc
;
331 class SD_DLLPUBLIC SdOptionsSnap
: public SdOptionsGeneric
335 bool bSnapHelplines
: 1; // Snap/Object/SnapLine
336 bool bSnapBorder
: 1; // Snap/Object/PageMargin
337 bool bSnapFrame
: 1; // Snap/Object/ObjectFrame
338 bool bSnapPoints
: 1; // Snap/Object/ObjectPoint
339 bool bOrtho
: 1; // Snap/Position/CreatingMoving
340 bool bBigOrtho
: 1; // Snap/Position/ExtendEdges
341 bool bRotate
: 1; // Snap/Position/Rotating
342 sal_Int16 nSnapArea
; // Snap/Object/Range
343 sal_Int16 nAngle
; // Snap/Position/RotatingValue
344 sal_Int16 nBezAngle
; // Snap/Position/PointReduction
348 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const override
;
349 virtual bool ReadData( const css::uno::Any
* pValues
) override
;
350 virtual bool WriteData( css::uno::Any
* pValues
) const override
;
354 SdOptionsSnap(bool bImpress
, bool bUseConfig
);
356 bool operator==( const SdOptionsSnap
& rOpt
) const;
358 bool IsSnapHelplines() const { Init(); return bSnapHelplines
; }
359 bool IsSnapBorder() const { Init(); return bSnapBorder
; }
360 bool IsSnapFrame() const { Init(); return bSnapFrame
; }
361 bool IsSnapPoints() const { Init(); return bSnapPoints
; }
362 bool IsOrtho() const { Init(); return bOrtho
; }
363 bool IsBigOrtho() const { Init(); return bBigOrtho
; }
364 bool IsRotate() const { Init(); return bRotate
; }
365 sal_Int16
GetSnapArea() const { Init(); return nSnapArea
; }
366 sal_Int16
GetAngle() const { Init(); return nAngle
; }
367 sal_Int16
GetEliminatePolyPointLimitAngle() const { Init(); return nBezAngle
; }
369 void SetSnapHelplines( bool bOn
) { if( bSnapHelplines
!= bOn
) { OptionsChanged(); bSnapHelplines
= bOn
; } }
370 void SetSnapBorder( bool bOn
) { if( bSnapBorder
!= bOn
) { OptionsChanged(); bSnapBorder
= bOn
; } }
371 void SetSnapFrame( bool bOn
) { if( bSnapFrame
!= bOn
) { OptionsChanged(); bSnapFrame
= bOn
; } }
372 void SetSnapPoints( bool bOn
) { if( bSnapPoints
!= bOn
) { OptionsChanged(); bSnapPoints
= bOn
; } }
373 void SetOrtho( bool bOn
) { if( bOrtho
!= bOn
) { OptionsChanged(); bOrtho
= bOn
; } }
374 void SetBigOrtho( bool bOn
) { if( bBigOrtho
!= bOn
) { OptionsChanged(); bBigOrtho
= bOn
; } }
375 void SetRotate( bool bOn
) { if( bRotate
!= bOn
) { OptionsChanged(); bRotate
= bOn
; } }
376 void SetSnapArea( sal_Int16 nIn
) { if( nSnapArea
!= nIn
) { OptionsChanged(); nSnapArea
= nIn
; } }
377 void SetAngle( sal_Int16 nIn
) { if( nAngle
!= nIn
) { OptionsChanged(); nAngle
= nIn
; } }
378 void SetEliminatePolyPointLimitAngle( sal_Int16 nIn
) { if( nBezAngle
!= nIn
) { OptionsChanged(); nBezAngle
= nIn
; } }
381 class SD_DLLPUBLIC SdOptionsSnapItem
: public SfxPoolItem
385 explicit SdOptionsSnapItem();
386 SdOptionsSnapItem( SdOptions
const * pOpts
, ::sd::FrameView
const * pView
);
388 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
389 virtual bool operator==( const SfxPoolItem
& ) const override
;
391 void SetOptions( SdOptions
* pOpts
) const;
393 SdOptionsSnap
& GetOptionsSnap() { return maOptionsSnap
; }
395 SdOptionsSnap maOptionsSnap
;
398 class SdOptionsZoom
: public SdOptionsGeneric
402 sal_Int32 nX
; // Zoom/ScaleX
403 sal_Int32 nY
; // Zoom/ScaleY
407 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const override
;
408 virtual bool ReadData( const css::uno::Any
* pValues
) override
;
409 virtual bool WriteData( css::uno::Any
* pValues
) const override
;
413 explicit SdOptionsZoom(bool bImpress
);
415 void GetScale( sal_Int32
& rX
, sal_Int32
& rY
) const { Init(); rX
= nX
; rY
= nY
; }
416 void SetScale( sal_Int32 nInX
, sal_Int32 nInY
) { if( nX
!= nInX
|| nY
!= nInY
) { OptionsChanged(); nX
= nInX
; nY
= nInY
; } }
419 class SdOptionsGrid
: public SdOptionsGeneric
, public SvxOptionsGrid
423 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const override
;
424 virtual bool ReadData( const css::uno::Any
* pValues
) override
;
425 virtual bool WriteData( css::uno::Any
* pValues
) const override
;
429 explicit SdOptionsGrid(bool bImpress
);
430 virtual ~SdOptionsGrid() override
;
434 sal_uInt32
GetFieldDrawX() const { Init(); return SvxOptionsGrid::GetFieldDrawX(); }
435 sal_uInt32
GetFieldDivisionX() const { Init(); return SvxOptionsGrid::GetFieldDivisionX(); }
436 sal_uInt32
GetFieldDrawY() const { Init(); return SvxOptionsGrid::GetFieldDrawY(); }
437 sal_uInt32
GetFieldDivisionY() const { Init(); return SvxOptionsGrid::GetFieldDivisionY(); }
438 sal_uInt32
GetFieldSnapX() const { Init(); return SvxOptionsGrid::GetFieldSnapX(); }
439 sal_uInt32
GetFieldSnapY() const { Init(); return SvxOptionsGrid::GetFieldSnapY(); }
440 bool IsUseGridSnap() const { Init(); return SvxOptionsGrid::GetUseGridSnap(); }
441 bool IsSynchronize() const { Init(); return SvxOptionsGrid::GetSynchronize(); }
442 bool IsGridVisible() const { Init(); return SvxOptionsGrid::GetGridVisible(); }
443 bool IsEqualGrid() const { Init(); return SvxOptionsGrid::GetEqualGrid(); }
445 void SetFieldDrawX( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldDrawX() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDrawX( nSet
); } }
446 void SetFieldDivisionX( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldDivisionX() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDivisionX( nSet
); } }
447 void SetFieldDrawY( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldDrawY() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDrawY( nSet
); } }
448 void SetFieldDivisionY( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldDivisionY() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDivisionY( nSet
); } }
449 void SetFieldSnapX( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldSnapX() ) { OptionsChanged(); SvxOptionsGrid::SetFieldSnapX( nSet
); } }
450 void SetFieldSnapY( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldSnapY() ) { OptionsChanged(); SvxOptionsGrid::SetFieldSnapY( nSet
); } }
451 void SetUseGridSnap( bool bSet
) { if( bSet
!= SvxOptionsGrid::GetUseGridSnap() ) { OptionsChanged(); SvxOptionsGrid::SetUseGridSnap( bSet
); } }
452 void SetSynchronize( bool bSet
) { if( bSet
!= SvxOptionsGrid::GetSynchronize() ) { OptionsChanged(); SvxOptionsGrid::SetSynchronize( bSet
); } }
453 void SetGridVisible( bool bSet
) { if( bSet
!= SvxOptionsGrid::GetGridVisible() ) { OptionsChanged(); SvxOptionsGrid::SetGridVisible( bSet
); } }
454 void SetEqualGrid( bool bSet
) { if( bSet
!= SvxOptionsGrid::GetEqualGrid() ) { OptionsChanged(); SvxOptionsGrid::SetEqualGrid( bSet
); } }
457 class SdOptionsGridItem
: public SvxGridItem
461 explicit SdOptionsGridItem( SdOptions
const * pOpts
);
463 void SetOptions( SdOptions
* pOpts
) const;
466 class SD_DLLPUBLIC SdOptionsPrint
: public SdOptionsGeneric
470 bool bDraw
: 1; // Print/Content/Drawing
471 bool bNotes
: 1; // Print/Content/Note
472 bool bHandout
: 1; // Print/Content/Handout
473 bool bOutline
: 1; // Print/Content/Outline
474 bool bDate
: 1; // Print/Other/Date
475 bool bTime
: 1; // Print/Other/Time
476 bool bPagename
: 1; // Print/Other/PageName
477 bool bHiddenPages
: 1; // Print/Other/HiddenPage
478 bool bPagesize
: 1; // Print/Page/PageSize
479 bool bPagetile
: 1; // Print/Page/PageTile
480 bool bWarningPrinter
: 1; // These flags you get
481 bool bWarningSize
: 1; // from the common options,
482 bool bWarningOrientation
: 1; // currently org.openoffice.Office.Common.xml (class OfaMiscCfg ; sfx2/misccfg.hxx )
483 bool bBooklet
: 1; // Print/Page/Booklet
484 bool bFront
: 1; // Print/Page/BookletFront
485 bool bBack
: 1; // Print/Page/BookletFront
486 bool bCutPage
: 1; // NOT persistent !!!
487 bool bPaperbin
: 1; // Print/Other/FromPrinterSetup
488 bool mbHandoutHorizontal
: 1; // Order Page previews on Handout Pages horizontal
489 sal_uInt16 mnHandoutPages
; // Number of page previews on handout page (only 1/2/4/6/9 are supported)
490 sal_uInt16 nQuality
; // Print/Other/Quality
494 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const override
;
495 virtual bool ReadData( const css::uno::Any
* pValues
) override
;
496 virtual bool WriteData( css::uno::Any
* pValues
) const override
;
500 SdOptionsPrint(bool bImpress
, bool bUseConfig
);
502 bool operator==( const SdOptionsPrint
& rOpt
) const;
504 bool IsDraw() const { Init(); return bDraw
; }
505 bool IsNotes() const { Init(); return bNotes
; }
506 bool IsHandout() const { Init(); return bHandout
; }
507 bool IsOutline() const { Init(); return bOutline
; }
508 bool IsDate() const { Init(); return bDate
; }
509 bool IsTime() const { Init(); return bTime
; }
510 bool IsPagename() const { Init(); return bPagename
; }
511 bool IsHiddenPages() const { Init(); return bHiddenPages
; }
512 bool IsPagesize() const { Init(); return bPagesize
; }
513 bool IsPagetile() const { Init(); return bPagetile
; }
514 bool IsWarningPrinter() const { Init(); return bWarningPrinter
; }
515 bool IsWarningSize() const { Init(); return bWarningSize
; }
516 bool IsWarningOrientation() const { Init(); return bWarningOrientation
; }
517 bool IsBooklet() const { Init(); return bBooklet
; }
518 bool IsFrontPage() const { Init(); return bFront
; }
519 bool IsBackPage() const { Init(); return bBack
; }
520 bool IsCutPage() const { Init(); return bCutPage
; }
521 bool IsPaperbin() const { Init(); return bPaperbin
; }
522 sal_uInt16
GetOutputQuality() const { Init(); return nQuality
; }
523 bool IsHandoutHorizontal() const { Init(); return mbHandoutHorizontal
; }
524 sal_uInt16
GetHandoutPages() const { Init(); return mnHandoutPages
; }
526 void SetDraw( bool bOn
) { if( bDraw
!= bOn
) { OptionsChanged(); bDraw
= bOn
; } }
527 void SetNotes( bool bOn
) { if( bNotes
!= bOn
) { OptionsChanged(); bNotes
= bOn
; } }
528 void SetHandout( bool bOn
) { if( bHandout
!= bOn
) { OptionsChanged(); bHandout
= bOn
; } }
529 void SetOutline( bool bOn
) { if( bOutline
!= bOn
) { OptionsChanged(); bOutline
= bOn
; } }
530 void SetDate( bool bOn
) { if( bDate
!= bOn
) { OptionsChanged(); bDate
= bOn
; } }
531 void SetTime( bool bOn
) { if( bTime
!= bOn
) { OptionsChanged(); bTime
= bOn
; } }
532 void SetPagename( bool bOn
) { if( bPagename
!= bOn
) { OptionsChanged(); bPagename
= bOn
; } }
533 void SetHiddenPages( bool bOn
) { if( bHiddenPages
!= bOn
) { OptionsChanged(); bHiddenPages
= bOn
; } }
534 void SetPagesize( bool bOn
) { if( bPagesize
!= bOn
) { OptionsChanged(); bPagesize
= bOn
; } }
535 void SetPagetile( bool bOn
) { if( bPagetile
!= bOn
) { OptionsChanged(); bPagetile
= bOn
; } }
536 void SetWarningPrinter( bool bOn
) { if( bWarningPrinter
!= bOn
) { OptionsChanged(); bWarningPrinter
= bOn
; } }
537 void SetWarningSize( bool bOn
) { if( bWarningSize
!= bOn
) { OptionsChanged(); bWarningSize
= bOn
; } }
538 void SetWarningOrientation( bool bOn
) { if( bWarningOrientation
!= bOn
) { OptionsChanged(); bWarningOrientation
= bOn
; } }
539 void SetBooklet( bool bOn
) { if( bBooklet
!= bOn
) { OptionsChanged(); bBooklet
= bOn
; } }
540 void SetFrontPage( bool bOn
) { if( bFront
!= bOn
) { OptionsChanged(); bFront
= bOn
; } }
541 void SetBackPage( bool bOn
) { if( bBack
!= bOn
) { OptionsChanged(); bBack
= bOn
; } }
542 void SetCutPage( bool bOn
) { if( bCutPage
!= bOn
) { OptionsChanged(); bCutPage
= bOn
; } }
543 void SetPaperbin( bool bOn
) { if( bPaperbin
!= bOn
) { OptionsChanged(); bPaperbin
= bOn
; } }
544 void SetOutputQuality( sal_uInt16 nInQuality
) { if( nQuality
!= nInQuality
) { OptionsChanged(); nQuality
= nInQuality
; } }
545 void SetHandoutHorizontal( bool bHandoutHorizontal
) { if( mbHandoutHorizontal
!= bHandoutHorizontal
) { OptionsChanged(); mbHandoutHorizontal
= bHandoutHorizontal
; } }
546 void SetHandoutPages( sal_uInt16 nHandoutPages
) { if( nHandoutPages
!= mnHandoutPages
) { OptionsChanged(); mnHandoutPages
= nHandoutPages
; } }
549 class SD_DLLPUBLIC SdOptionsPrintItem
: public SfxPoolItem
553 explicit SdOptionsPrintItem();
554 explicit SdOptionsPrintItem( SdOptions
const * pOpts
);
556 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
557 virtual bool operator==( const SfxPoolItem
& ) const override
;
559 void SetOptions( SdOptions
* pOpts
) const;
561 SdOptionsPrint
& GetOptionsPrint() { return maOptionsPrint
; }
562 const SdOptionsPrint
& GetOptionsPrint() const { return maOptionsPrint
; }
564 SdOptionsPrint maOptionsPrint
;
567 class SdOptions
: public SdOptionsLayout
, public SdOptionsContents
,
568 public SdOptionsMisc
, public SdOptionsSnap
,
569 public SdOptionsZoom
, public SdOptionsGrid
,
570 public SdOptionsPrint
574 explicit SdOptions(bool bImpress
);
575 virtual ~SdOptions() override
;
580 #endif // INCLUDED_SD_SOURCE_UI_INC_OPTSITEM_HXX
582 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */