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 .
22 #include <unotools/configitem.hxx>
23 #include <sfx2/module.hxx>
24 #include <svx/optgrid.hxx>
25 #include <tools/degree.hxx>
35 class SdOptionsGeneric
;
37 class SD_DLLPUBLIC SdOptionsItem final
: 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 final
: public SfxPoolItem
152 explicit SdOptionsLayoutItem();
153 SdOptionsLayoutItem( SdOptions
const * pOpts
, ::sd::FrameView
const * pView
);
155 virtual SdOptionsLayoutItem
* 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 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_Int32 nDefaultObjectSizeWidth
;
186 sal_Int32 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/EnablePresenterScreen
200 bool bPresenterScreenFullScreen
: 1; // Misc/Start/PresenterScreenFullScreen
201 bool bSolidDragging
: 1; // Misc/ModifyWithAttributes
202 bool bSummationOfParagraphs
: 1; // misc/SummationOfParagraphs
203 bool bTabBarVisible
: 1; // Misc/TabBarVisible
204 bool bShowUndoDeleteWarning
: 1; // Misc/ShowUndoDeleteWarning
206 bool bSlideshowRespectZOrder
: 1; // Misc/SlideshowRespectZOrder
207 bool bShowComments
: 1; // Misc/ShowComments
209 bool bPreviewNewEffects
;
210 bool bPreviewChangedEffects
;
211 bool bPreviewTransitions
;
216 sal_Int32 mnPenColor
;
219 /** This value controls the device to use for formatting documents.
220 The currently supported values are 0 for the current printer or 1
221 for the printer independent virtual device the can be retrieved from
224 sal_uInt16 mnPrinterIndependentLayout
; // Misc/Compatibility/PrinterIndependentLayout
229 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const override
;
230 virtual bool ReadData( const css::uno::Any
* pValues
) override
;
231 virtual bool WriteData( css::uno::Any
* pValues
) const override
;
235 SdOptionsMisc(bool bImpress
, bool bUseConfig
);
237 bool operator==( const SdOptionsMisc
& rOpt
) const;
239 bool IsStartWithTemplate() const { Init(); return bStartWithTemplate
; }
240 bool IsMarkedHitMovesAlways() const { Init(); return bMarkedHitMovesAlways
; }
241 bool IsMoveOnlyDragging() const { Init(); return bMoveOnlyDragging
; }
242 bool IsCrookNoContortion() const { Init(); return bCrookNoContortion
; }
243 bool IsQuickEdit() const { Init(); return bQuickEdit
; }
244 bool IsMasterPagePaintCaching() const { Init(); return bMasterPageCache
; }
245 bool IsDragWithCopy() const { Init(); return bDragWithCopy
; }
246 bool IsPickThrough() const { Init(); return bPickThrough
; }
247 bool IsDoubleClickTextEdit() const { Init(); return bDoubleClickTextEdit
; }
248 bool IsClickChangeRotation() const { Init(); return bClickChangeRotation
; }
249 bool IsEnableSdremote() const { Init(); return bEnableSdremote
; }
250 bool IsEnablePresenterScreen() const { Init(); return bEnablePresenterScreen
; }
251 bool IsPresenterScreenFullScreen() const { Init(); return bPresenterScreenFullScreen
; }
252 bool IsSolidDragging() const { Init(); return bSolidDragging
; }
253 bool IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs
; };
254 bool IsTabBarVisible() const { Init(); return bTabBarVisible
; };
256 /** Return the currently selected printer independent layout mode.
258 Returns 1 for printer independent layout enabled and 0 when it
259 is disabled. Other values are reserved for future use.
261 sal_uInt16
GetPrinterIndependentLayout() const { Init(); return mnPrinterIndependentLayout
; };
262 bool IsShowUndoDeleteWarning() const { Init(); return bShowUndoDeleteWarning
; }
263 bool IsSlideshowRespectZOrder() const { Init(); return bSlideshowRespectZOrder
; }
264 sal_Int32
GetDefaultObjectSizeWidth() const { Init(); return nDefaultObjectSizeWidth
; }
265 sal_Int32
GetDefaultObjectSizeHeight() const { Init(); return nDefaultObjectSizeHeight
; }
267 bool IsPreviewNewEffects() const { Init(); return bPreviewNewEffects
; }
268 bool IsPreviewChangedEffects() const { Init(); return bPreviewChangedEffects
; }
269 bool IsPreviewTransitions() const { Init(); return bPreviewTransitions
; }
271 sal_Int32
GetDisplay() const;
272 void SetDisplay( sal_Int32 nDisplay
);
274 sal_Int32
GetPresentationPenColor() const { Init(); return mnPenColor
; }
275 void SetPresentationPenColor( sal_Int32 nPenColor
) { if( mnPenColor
!= nPenColor
) { OptionsChanged(); mnPenColor
= nPenColor
; } }
277 double GetPresentationPenWidth() const { Init(); return mnPenWidth
; }
278 void SetPresentationPenWidth( double nPenWidth
) { if( mnPenWidth
!= nPenWidth
) { OptionsChanged(); mnPenWidth
= nPenWidth
; } }
280 void SetStartWithTemplate( bool bOn
) { if( bStartWithTemplate
!= bOn
) { OptionsChanged(); bStartWithTemplate
= bOn
; } }
281 void SetMarkedHitMovesAlways( bool bOn
) { if( bMarkedHitMovesAlways
!= bOn
) { OptionsChanged(); bMarkedHitMovesAlways
= bOn
; } }
282 void SetMoveOnlyDragging( bool bOn
) { if( bMoveOnlyDragging
!= bOn
) { OptionsChanged(); bMoveOnlyDragging
= bOn
; } }
283 void SetCrookNoContortion( bool bOn
) { if( bCrookNoContortion
!= bOn
) { OptionsChanged(); bCrookNoContortion
= bOn
; } }
284 void SetQuickEdit( bool bOn
) { if( bQuickEdit
!= bOn
) { OptionsChanged(); bQuickEdit
= bOn
; } }
285 void SetMasterPagePaintCaching( bool bOn
) { if( bMasterPageCache
!= bOn
) { OptionsChanged(); bMasterPageCache
= bOn
; } }
286 void SetDragWithCopy( bool bOn
) { if( bDragWithCopy
!= bOn
) { OptionsChanged(); bDragWithCopy
= bOn
; } }
287 void SetPickThrough( bool bOn
) { if( bPickThrough
!= bOn
) { OptionsChanged(); bPickThrough
= bOn
; } }
288 void SetDoubleClickTextEdit( bool bOn
) { if( bDoubleClickTextEdit
!= bOn
) { OptionsChanged(); bDoubleClickTextEdit
= bOn
; } }
289 void SetClickChangeRotation( bool bOn
) { if( bClickChangeRotation
!= bOn
) { OptionsChanged(); bClickChangeRotation
= bOn
; } }
290 void SetEnableSdremote( bool bOn
) { if( bEnableSdremote
!= bOn
) { OptionsChanged(); bEnableSdremote
= bOn
; } }
291 void SetEnablePresenterScreen( bool bOn
) { if( bEnablePresenterScreen
!= bOn
) { OptionsChanged(); bEnablePresenterScreen
= bOn
; } }
292 void SetPresenterScreenFullScreen( bool bOn
) { if ( bPresenterScreenFullScreen
!= bOn
) { OptionsChanged(); bPresenterScreenFullScreen
= bOn
; } }
293 void SetSummationOfParagraphs( bool bOn
){ if ( bOn
!= bSummationOfParagraphs
) { OptionsChanged(); bSummationOfParagraphs
= bOn
; } }
294 void SetTabBarVisible( bool bOn
){ if ( bOn
!= bTabBarVisible
) { OptionsChanged(); bTabBarVisible
= bOn
; } }
295 /** Set the printer independent layout mode.
297 The default value is to switch printer independent layout on,
298 hence the parameters name. Use 0 for turning it off. Other
299 values are reserved for future use.
301 void SetPrinterIndependentLayout (sal_uInt16 nOn
){ if ( nOn
!= mnPrinterIndependentLayout
) { OptionsChanged(); mnPrinterIndependentLayout
= nOn
; } }
302 void SetSolidDragging( bool bOn
) { if( bSolidDragging
!= bOn
) { OptionsChanged(); bSolidDragging
= bOn
; } }
303 void SetShowUndoDeleteWarning( bool bOn
) { if( bShowUndoDeleteWarning
!= bOn
) { OptionsChanged(); bShowUndoDeleteWarning
= bOn
; } }
304 void SetSlideshowRespectZOrder( bool bOn
) { if( bSlideshowRespectZOrder
!= bOn
) { OptionsChanged(); bSlideshowRespectZOrder
= bOn
; } }
305 void SetDefaultObjectSizeWidth( sal_Int32 nWidth
) { if( nDefaultObjectSizeWidth
!= nWidth
) { OptionsChanged(); nDefaultObjectSizeWidth
= nWidth
; } }
306 void SetDefaultObjectSizeHeight( sal_Int32 nHeight
) { if( nDefaultObjectSizeHeight
!= nHeight
) { OptionsChanged(); nDefaultObjectSizeHeight
= nHeight
; } }
308 void SetPreviewNewEffects( bool bOn
) { if( bPreviewNewEffects
!= bOn
) { OptionsChanged(); bPreviewNewEffects
= bOn
; } }
309 void SetPreviewChangedEffects( bool bOn
) { if( bPreviewChangedEffects
!= bOn
) { OptionsChanged(); bPreviewChangedEffects
= bOn
; } }
310 void SetPreviewTransitions( bool bOn
) { if( bPreviewTransitions
!= bOn
) { OptionsChanged(); bPreviewTransitions
= bOn
; } }
312 bool IsShowComments() const { Init(); return bShowComments
; }
313 void SetShowComments( bool bShow
) { if( bShowComments
!= bShow
) { OptionsChanged(); bShowComments
= bShow
; } }
316 class SD_DLLPUBLIC SdOptionsMiscItem final
: public SfxPoolItem
320 explicit SdOptionsMiscItem();
321 SdOptionsMiscItem( SdOptions
const * pOpts
, ::sd::FrameView
const * pView
);
323 virtual SdOptionsMiscItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
324 virtual bool operator==( const SfxPoolItem
& ) const override
;
326 void SetOptions( SdOptions
* pOpts
) const;
328 SdOptionsMisc
& GetOptionsMisc() { return maOptionsMisc
; }
329 const SdOptionsMisc
& GetOptionsMisc() const { return maOptionsMisc
; }
331 SdOptionsMisc maOptionsMisc
;
334 class SD_DLLPUBLIC SdOptionsSnap
: public SdOptionsGeneric
338 bool bSnapHelplines
: 1; // Snap/Object/SnapLine
339 bool bSnapBorder
: 1; // Snap/Object/PageMargin
340 bool bSnapFrame
: 1; // Snap/Object/ObjectFrame
341 bool bSnapPoints
: 1; // Snap/Object/ObjectPoint
342 bool bOrtho
: 1; // Snap/Position/CreatingMoving
343 bool bBigOrtho
: 1; // Snap/Position/ExtendEdges
344 bool bRotate
: 1; // Snap/Position/Rotating
345 sal_Int16 nSnapArea
; // Snap/Object/Range
346 Degree100 nAngle
; // Snap/Position/RotatingValue
347 Degree100 nBezAngle
; // Snap/Position/PointReduction
351 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const override
;
352 virtual bool ReadData( const css::uno::Any
* pValues
) override
;
353 virtual bool WriteData( css::uno::Any
* pValues
) const override
;
357 SdOptionsSnap(bool bImpress
, bool bUseConfig
);
359 bool operator==( const SdOptionsSnap
& rOpt
) const;
361 bool IsSnapHelplines() const { Init(); return bSnapHelplines
; }
362 bool IsSnapBorder() const { Init(); return bSnapBorder
; }
363 bool IsSnapFrame() const { Init(); return bSnapFrame
; }
364 bool IsSnapPoints() const { Init(); return bSnapPoints
; }
365 bool IsOrtho() const { Init(); return bOrtho
; }
366 bool IsBigOrtho() const { Init(); return bBigOrtho
; }
367 bool IsRotate() const { Init(); return bRotate
; }
368 sal_Int16
GetSnapArea() const { Init(); return nSnapArea
; }
369 Degree100
GetAngle() const { Init(); return nAngle
; }
370 Degree100
GetEliminatePolyPointLimitAngle() const { Init(); return nBezAngle
; }
372 void SetSnapHelplines( bool bOn
) { if( bSnapHelplines
!= bOn
) { OptionsChanged(); bSnapHelplines
= bOn
; } }
373 void SetSnapBorder( bool bOn
) { if( bSnapBorder
!= bOn
) { OptionsChanged(); bSnapBorder
= bOn
; } }
374 void SetSnapFrame( bool bOn
) { if( bSnapFrame
!= bOn
) { OptionsChanged(); bSnapFrame
= bOn
; } }
375 void SetSnapPoints( bool bOn
) { if( bSnapPoints
!= bOn
) { OptionsChanged(); bSnapPoints
= bOn
; } }
376 void SetOrtho( bool bOn
) { if( bOrtho
!= bOn
) { OptionsChanged(); bOrtho
= bOn
; } }
377 void SetBigOrtho( bool bOn
) { if( bBigOrtho
!= bOn
) { OptionsChanged(); bBigOrtho
= bOn
; } }
378 void SetRotate( bool bOn
) { if( bRotate
!= bOn
) { OptionsChanged(); bRotate
= bOn
; } }
379 void SetSnapArea( sal_Int16 nIn
) { if( nSnapArea
!= nIn
) { OptionsChanged(); nSnapArea
= nIn
; } }
380 void SetAngle( Degree100 nIn
) { if( nAngle
!= nIn
) { OptionsChanged(); nAngle
= nIn
; } }
381 void SetEliminatePolyPointLimitAngle( Degree100 nIn
) { if( nBezAngle
!= nIn
) { OptionsChanged(); nBezAngle
= nIn
; } }
384 class SD_DLLPUBLIC SdOptionsSnapItem final
: public SfxPoolItem
388 explicit SdOptionsSnapItem();
389 SdOptionsSnapItem( SdOptions
const * pOpts
, ::sd::FrameView
const * pView
);
391 virtual SdOptionsSnapItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
392 virtual bool operator==( const SfxPoolItem
& ) const override
;
394 void SetOptions( SdOptions
* pOpts
) const;
396 SdOptionsSnap
& GetOptionsSnap() { return maOptionsSnap
; }
398 SdOptionsSnap maOptionsSnap
;
401 class SdOptionsZoom
: public SdOptionsGeneric
405 sal_Int32 nX
; // Zoom/ScaleX
406 sal_Int32 nY
; // Zoom/ScaleY
410 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const override
;
411 virtual bool ReadData( const css::uno::Any
* pValues
) override
;
412 virtual bool WriteData( css::uno::Any
* pValues
) const override
;
416 explicit SdOptionsZoom(bool bImpress
);
418 void GetScale( sal_Int32
& rX
, sal_Int32
& rY
) const { Init(); rX
= nX
; rY
= nY
; }
419 void SetScale( sal_Int32 nInX
, sal_Int32 nInY
) { if( nX
!= nInX
|| nY
!= nInY
) { OptionsChanged(); nX
= nInX
; nY
= nInY
; } }
422 class SdOptionsGrid
: public SdOptionsGeneric
, public SvxOptionsGrid
426 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const override
;
427 virtual bool ReadData( const css::uno::Any
* pValues
) override
;
428 virtual bool WriteData( css::uno::Any
* pValues
) const override
;
432 explicit SdOptionsGrid(bool bImpress
);
433 virtual ~SdOptionsGrid() override
;
437 sal_uInt32
GetFieldDrawX() const { Init(); return SvxOptionsGrid::GetFieldDrawX(); }
438 sal_uInt32
GetFieldDivisionX() const { Init(); return SvxOptionsGrid::GetFieldDivisionX(); }
439 sal_uInt32
GetFieldDrawY() const { Init(); return SvxOptionsGrid::GetFieldDrawY(); }
440 sal_uInt32
GetFieldDivisionY() const { Init(); return SvxOptionsGrid::GetFieldDivisionY(); }
441 sal_uInt32
GetFieldSnapX() const { Init(); return SvxOptionsGrid::GetFieldSnapX(); }
442 sal_uInt32
GetFieldSnapY() const { Init(); return SvxOptionsGrid::GetFieldSnapY(); }
443 bool IsUseGridSnap() const { Init(); return SvxOptionsGrid::GetUseGridSnap(); }
444 bool IsSynchronize() const { Init(); return SvxOptionsGrid::GetSynchronize(); }
445 bool IsGridVisible() const { Init(); return SvxOptionsGrid::GetGridVisible(); }
446 bool IsEqualGrid() const { Init(); return SvxOptionsGrid::GetEqualGrid(); }
448 void SetFieldDrawX( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldDrawX() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDrawX( nSet
); } }
449 void SetFieldDivisionX( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldDivisionX() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDivisionX( nSet
); } }
450 void SetFieldDrawY( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldDrawY() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDrawY( nSet
); } }
451 void SetFieldDivisionY( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldDivisionY() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDivisionY( nSet
); } }
452 void SetFieldSnapX( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldSnapX() ) { OptionsChanged(); SvxOptionsGrid::SetFieldSnapX( nSet
); } }
453 void SetFieldSnapY( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldSnapY() ) { OptionsChanged(); SvxOptionsGrid::SetFieldSnapY( nSet
); } }
454 void SetUseGridSnap( bool bSet
) { if( bSet
!= SvxOptionsGrid::GetUseGridSnap() ) { OptionsChanged(); SvxOptionsGrid::SetUseGridSnap( bSet
); } }
455 void SetSynchronize( bool bSet
) { if( bSet
!= SvxOptionsGrid::GetSynchronize() ) { OptionsChanged(); SvxOptionsGrid::SetSynchronize( bSet
); } }
456 void SetGridVisible( bool bSet
) { if( bSet
!= SvxOptionsGrid::GetGridVisible() ) { OptionsChanged(); SvxOptionsGrid::SetGridVisible( bSet
); } }
457 void SetEqualGrid( bool bSet
) { if( bSet
!= SvxOptionsGrid::GetEqualGrid() ) { OptionsChanged(); SvxOptionsGrid::SetEqualGrid( bSet
); } }
460 class SdOptionsGridItem final
: public SvxGridItem
464 explicit SdOptionsGridItem( SdOptions
const * pOpts
);
466 void SetOptions( SdOptions
* pOpts
) const;
469 class SD_DLLPUBLIC SdOptionsPrint
: public SdOptionsGeneric
473 bool bDraw
: 1; // Print/Content/Drawing
474 bool bNotes
: 1; // Print/Content/Note
475 bool bHandout
: 1; // Print/Content/Handout
476 bool bOutline
: 1; // Print/Content/Outline
477 bool bDate
: 1; // Print/Other/Date
478 bool bTime
: 1; // Print/Other/Time
479 bool bPagename
: 1; // Print/Other/PageName
480 bool bHiddenPages
: 1; // Print/Other/HiddenPage
481 bool bPagesize
: 1; // Print/Page/PageSize
482 bool bPagetile
: 1; // Print/Page/PageTile
483 bool bWarningPrinter
: 1; // These flags you get
484 bool bWarningSize
: 1; // from the common options,
485 bool bWarningOrientation
: 1; // currently org.openoffice.Office.Common.xml (class OfaMiscCfg ; sfx2/misccfg.hxx )
486 bool bBooklet
: 1; // Print/Page/Booklet
487 bool bFront
: 1; // Print/Page/BookletFront
488 bool bBack
: 1; // Print/Page/BookletFront
489 bool bCutPage
: 1; // NOT persistent !!!
490 bool bPaperbin
: 1; // Print/Other/FromPrinterSetup
491 bool mbHandoutHorizontal
: 1; // Order Page previews on Handout Pages horizontal
492 sal_uInt16 mnHandoutPages
; // Number of page previews on handout page (only 1/2/4/6/9 are supported)
493 sal_uInt16 nQuality
; // Print/Other/Quality
497 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const override
;
498 virtual bool ReadData( const css::uno::Any
* pValues
) override
;
499 virtual bool WriteData( css::uno::Any
* pValues
) const override
;
503 SdOptionsPrint(bool bImpress
, bool bUseConfig
);
505 bool operator==( const SdOptionsPrint
& rOpt
) const;
507 bool IsDraw() const { Init(); return bDraw
; }
508 bool IsNotes() const { Init(); return bNotes
; }
509 bool IsHandout() const { Init(); return bHandout
; }
510 bool IsOutline() const { Init(); return bOutline
; }
511 bool IsDate() const { Init(); return bDate
; }
512 bool IsTime() const { Init(); return bTime
; }
513 bool IsPagename() const { Init(); return bPagename
; }
514 bool IsHiddenPages() const { Init(); return bHiddenPages
; }
515 bool IsPagesize() const { Init(); return bPagesize
; }
516 bool IsPagetile() const { Init(); return bPagetile
; }
517 bool IsWarningPrinter() const { Init(); return bWarningPrinter
; }
518 bool IsWarningSize() const { Init(); return bWarningSize
; }
519 bool IsWarningOrientation() const { Init(); return bWarningOrientation
; }
520 bool IsBooklet() const { Init(); return bBooklet
; }
521 bool IsFrontPage() const { Init(); return bFront
; }
522 bool IsBackPage() const { Init(); return bBack
; }
523 bool IsCutPage() const { Init(); return bCutPage
; }
524 bool IsPaperbin() const { Init(); return bPaperbin
; }
525 sal_uInt16
GetOutputQuality() const { Init(); return nQuality
; }
526 bool IsHandoutHorizontal() const { Init(); return mbHandoutHorizontal
; }
527 sal_uInt16
GetHandoutPages() const { Init(); return mnHandoutPages
; }
529 void SetDraw( bool bOn
) { if( bDraw
!= bOn
) { OptionsChanged(); bDraw
= bOn
; } }
530 void SetNotes( bool bOn
) { if( bNotes
!= bOn
) { OptionsChanged(); bNotes
= bOn
; } }
531 void SetHandout( bool bOn
) { if( bHandout
!= bOn
) { OptionsChanged(); bHandout
= bOn
; } }
532 void SetOutline( bool bOn
) { if( bOutline
!= bOn
) { OptionsChanged(); bOutline
= bOn
; } }
533 void SetDate( bool bOn
) { if( bDate
!= bOn
) { OptionsChanged(); bDate
= bOn
; } }
534 void SetTime( bool bOn
) { if( bTime
!= bOn
) { OptionsChanged(); bTime
= bOn
; } }
535 void SetPagename( bool bOn
) { if( bPagename
!= bOn
) { OptionsChanged(); bPagename
= bOn
; } }
536 void SetHiddenPages( bool bOn
) { if( bHiddenPages
!= bOn
) { OptionsChanged(); bHiddenPages
= bOn
; } }
537 void SetPagesize( bool bOn
) { if( bPagesize
!= bOn
) { OptionsChanged(); bPagesize
= bOn
; } }
538 void SetPagetile( bool bOn
) { if( bPagetile
!= bOn
) { OptionsChanged(); bPagetile
= bOn
; } }
539 void SetWarningPrinter( bool bOn
) { if( bWarningPrinter
!= bOn
) { OptionsChanged(); bWarningPrinter
= bOn
; } }
540 void SetWarningSize( bool bOn
) { if( bWarningSize
!= bOn
) { OptionsChanged(); bWarningSize
= bOn
; } }
541 void SetWarningOrientation( bool bOn
) { if( bWarningOrientation
!= bOn
) { OptionsChanged(); bWarningOrientation
= bOn
; } }
542 void SetBooklet( bool bOn
) { if( bBooklet
!= bOn
) { OptionsChanged(); bBooklet
= bOn
; } }
543 void SetFrontPage( bool bOn
) { if( bFront
!= bOn
) { OptionsChanged(); bFront
= bOn
; } }
544 void SetBackPage( bool bOn
) { if( bBack
!= bOn
) { OptionsChanged(); bBack
= bOn
; } }
545 void SetCutPage( bool bOn
) { if( bCutPage
!= bOn
) { OptionsChanged(); bCutPage
= bOn
; } }
546 void SetPaperbin( bool bOn
) { if( bPaperbin
!= bOn
) { OptionsChanged(); bPaperbin
= bOn
; } }
547 void SetOutputQuality( sal_uInt16 nInQuality
) { if( nQuality
!= nInQuality
) { OptionsChanged(); nQuality
= nInQuality
; } }
548 void SetHandoutHorizontal( bool bHandoutHorizontal
) { if( mbHandoutHorizontal
!= bHandoutHorizontal
) { OptionsChanged(); mbHandoutHorizontal
= bHandoutHorizontal
; } }
549 void SetHandoutPages( sal_uInt16 nHandoutPages
) { if( nHandoutPages
!= mnHandoutPages
) { OptionsChanged(); mnHandoutPages
= nHandoutPages
; } }
552 class SD_DLLPUBLIC SdOptionsPrintItem final
: public SfxPoolItem
556 explicit SdOptionsPrintItem();
557 explicit SdOptionsPrintItem( SdOptions
const * pOpts
);
559 virtual SdOptionsPrintItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
560 virtual bool operator==( const SfxPoolItem
& ) const override
;
562 void SetOptions( SdOptions
* pOpts
) const;
564 SdOptionsPrint
& GetOptionsPrint() { return maOptionsPrint
; }
565 const SdOptionsPrint
& GetOptionsPrint() const { return maOptionsPrint
; }
567 SdOptionsPrint maOptionsPrint
;
570 class SdOptions final
: public SdOptionsLayout
, public SdOptionsContents
,
571 public SdOptionsMisc
, public SdOptionsSnap
,
572 public SdOptionsZoom
, public SdOptionsGrid
,
573 public SdOptionsPrint
577 explicit SdOptions(bool bImpress
);
578 virtual ~SdOptions() override
;
583 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */