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 <sfx2/app.hxx>
26 #include <sfx2/sfxsids.hrc>
27 #include <svx/optgrid.hxx>
28 #include <svx/dlgutil.hxx>
33 #define SD_OPTIONS_ALL 0xffffffff
35 #define SD_OPTIONS_LAYOUT 0x00000001
36 #define SD_OPTIONS_CONTENTS 0x00000002
37 #define SD_OPTIONS_MISC 0x00000004
38 #define SD_OPTIONS_SNAP 0x00000008
39 #define SD_OPTIONS_ZOOM 0x00000010
40 #define SD_OPTIONS_GRID 0x00000020
41 #define SD_OPTIONS_PRINT 0x00000040
49 class SdOptionsGeneric
;
51 class SD_DLLPUBLIC SdOptionsItem
: public ::utl::ConfigItem
56 const SdOptionsGeneric
& mrParent
;
58 virtual void ImplCommit() SAL_OVERRIDE
;
62 SdOptionsItem( const SdOptionsGeneric
& rParent
, const OUString
& rSubTree
);
63 virtual ~SdOptionsItem();
65 virtual void Notify( const com::sun::star::uno::Sequence
<OUString
>& aPropertyNames
) SAL_OVERRIDE
;
67 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> GetProperties(
68 const ::com::sun::star::uno::Sequence
< OUString
>& rNames
);
69 bool PutProperties( const com::sun::star::uno::Sequence
< OUString
>& rNames
,
70 const com::sun::star::uno::Sequence
< com::sun::star::uno::Any
>& rValues
);
74 class SD_DLLPUBLIC SdOptionsGeneric
76 friend class SdOptionsItem
;
81 SdOptionsItem
* mpCfgItem
;
82 sal_uInt16 mnConfigId
;
84 bool mbEnableModify
: 1;
86 SAL_DLLPRIVATE
void Commit( SdOptionsItem
& rCfgItem
) const;
87 SAL_DLLPRIVATE ::com::sun::star::uno::Sequence
< OUString
> GetPropertyNames() const;
92 void OptionsChanged() { if( mpCfgItem
&& mbEnableModify
) mpCfgItem
->SetModified(); }
96 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const = 0;
97 virtual bool ReadData( const ::com::sun::star::uno::Any
* pValues
) = 0;
98 virtual bool WriteData( ::com::sun::star::uno::Any
* pValues
) const = 0;
102 SdOptionsGeneric( sal_uInt16 nConfigId
, const OUString
& rSubTree
);
103 virtual ~SdOptionsGeneric();
105 const OUString
& GetSubTree() const { return maSubTree
; }
106 sal_uInt16
GetConfigId() const { return mnConfigId
; }
108 void EnableModify( bool bModify
) { mbEnableModify
= bModify
; }
112 static bool isMetricSystem();
115 class SD_DLLPUBLIC SdOptionsLayout
: public SdOptionsGeneric
119 bool bRuler
; // Layout/Display/Ruler
120 bool bMoveOutline
; // Layout/Display/Contur
121 bool bDragStripes
; // Layout/Display/Guide
122 bool bHandlesBezier
; // Layout/Display/Bezier
123 bool bHelplines
; // Layout/Display/Helpline
124 sal_uInt16 nMetric
; // Layout/Other/MeasureUnit
125 sal_uInt16 nDefTab
; // Layout/Other/TabStop
129 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const SAL_OVERRIDE
;
130 virtual bool ReadData( const ::com::sun::star::uno::Any
* pValues
) SAL_OVERRIDE
;
131 virtual bool WriteData( ::com::sun::star::uno::Any
* pValues
) const SAL_OVERRIDE
;
134 SdOptionsLayout( sal_uInt16 nConfigId
, bool bUseConfig
);
135 virtual ~SdOptionsLayout() {}
137 bool operator==( const SdOptionsLayout
& rOpt
) const;
139 bool IsRulerVisible() const { Init(); return bRuler
; }
140 bool IsMoveOutline() const { Init(); return bMoveOutline
; }
141 bool IsDragStripes() const { Init(); return bDragStripes
; }
142 bool IsHandlesBezier() const { Init(); return bHandlesBezier
; }
143 bool IsHelplines() const { Init(); return bHelplines
; }
144 sal_uInt16
GetMetric() const { Init(); return( ( 0xffff == nMetric
) ? (sal_uInt16
)SfxModule::GetCurrentFieldUnit() : nMetric
); }
145 sal_uInt16
GetDefTab() const { Init(); return nDefTab
; }
147 void SetRulerVisible( bool bOn
= true ) { if( bRuler
!= bOn
) { OptionsChanged(); bRuler
= bOn
; } }
148 void SetMoveOutline( bool bOn
= true ) { if( bMoveOutline
!= bOn
) { OptionsChanged(); bMoveOutline
= bOn
; } }
149 void SetDragStripes( bool bOn
= true ) { if( bDragStripes
!= bOn
) { OptionsChanged(); bDragStripes
= bOn
; } }
150 void SetHandlesBezier( bool bOn
= true ) { if( bHandlesBezier
!= bOn
) { OptionsChanged(); bHandlesBezier
= bOn
; } }
151 void SetHelplines( bool bOn
= true ) { if( bHelplines
!= bOn
) { OptionsChanged(); bHelplines
= bOn
; } }
152 void SetMetric( sal_uInt16 nInMetric
) { if( nMetric
!= nInMetric
) { OptionsChanged(); nMetric
= nInMetric
; } }
153 void SetDefTab( sal_uInt16 nTab
) { if( nDefTab
!= nTab
) { OptionsChanged(); nDefTab
= nTab
; } }
156 class SD_DLLPUBLIC SdOptionsLayoutItem
: public SfxPoolItem
160 SdOptionsLayoutItem( sal_uInt16 nWhich
);
161 SdOptionsLayoutItem( sal_uInt16 nWhich
, SdOptions
* pOpts
, ::sd::FrameView
* pView
= NULL
);
163 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
164 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
166 void SetOptions( SdOptions
* pOpts
) const;
168 SdOptionsLayout
& GetOptionsLayout() { return maOptionsLayout
; }
170 SdOptionsLayout maOptionsLayout
;
173 class SD_DLLPUBLIC SdOptionsContents
: public SdOptionsGeneric
178 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const SAL_OVERRIDE
;
179 virtual bool ReadData( const ::com::sun::star::uno::Any
* pValues
) SAL_OVERRIDE
;
180 virtual bool WriteData( ::com::sun::star::uno::Any
* pValues
) const SAL_OVERRIDE
;
184 SdOptionsContents( sal_uInt16 nConfigId
, bool bUseConfig
);
185 virtual ~SdOptionsContents() {}
187 bool operator==( const SdOptionsContents
& rOpt
) const;
190 class SD_DLLPUBLIC SdOptionsContentsItem
: public SfxPoolItem
194 SdOptionsContentsItem( sal_uInt16 nWhich
, SdOptions
* pOpts
, ::sd::FrameView
* pView
= NULL
);
196 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
197 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
199 SdOptionsContents
& GetOptionsContents() { return maOptionsContents
; }
201 SdOptionsContents maOptionsContents
;
204 class SD_DLLPUBLIC SdOptionsMisc
: public SdOptionsGeneric
208 sal_uLong nDefaultObjectSizeWidth
;
209 sal_uLong nDefaultObjectSizeHeight
;
211 bool bStartWithTemplate
: 1; // Misc/NewDoc/AutoPilot
212 bool bMarkedHitMovesAlways
: 1; // Misc/ObjectMoveable
213 bool bMoveOnlyDragging
: 1; // Currently, not in use !!!
214 bool bCrookNoContortion
: 1; // Misc/NoDistort
215 bool bQuickEdit
: 1; // Misc/TextObject/QuickEditing
216 bool bMasterPageCache
: 1; // Misc/BackgroundCache
217 bool bDragWithCopy
: 1; // Misc/CopyWhileMoving
218 bool bPickThrough
: 1; // Misc/TextObject/Selectable
219 bool bDoubleClickTextEdit
: 1; // Misc/DclickTextedit
220 bool bClickChangeRotation
: 1; // Misc/RotateClick
221 bool bEnableSdremote
: 1; // Misc/Start/EnableSdremote
222 bool bEnablePresenterScreen
: 1; // Misc/Start/EnablePresenterDisplay
223 bool bSolidDragging
: 1; // Misc/ModifyWithAttributes
224 bool bSummationOfParagraphs
: 1; // misc/SummationOfParagraphs
225 bool bShowUndoDeleteWarning
: 1; // Misc/ShowUndoDeleteWarning
227 bool bSlideshowRespectZOrder
: 1; // Misc/SlideshowRespectZOrder
228 bool bShowComments
: 1; // Misc/ShowComments
230 bool bPreviewNewEffects
;
231 bool bPreviewChangedEffects
;
232 bool bPreviewTransitions
;
236 sal_Int32 mnPenColor
;
239 /** This value controls the device to use for formatting documents.
240 The currently supported values are 0 for the current printer or 1
241 for the printer independent virtual device the can be retrieved from
244 sal_uInt16 mnPrinterIndependentLayout
; // Misc/Compatibility/PrinterIndependentLayout
249 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const SAL_OVERRIDE
;
250 virtual bool ReadData( const ::com::sun::star::uno::Any
* pValues
) SAL_OVERRIDE
;
251 virtual bool WriteData( ::com::sun::star::uno::Any
* pValues
) const SAL_OVERRIDE
;
255 SdOptionsMisc( sal_uInt16 nConfigId
, bool bUseConfig
);
256 virtual ~SdOptionsMisc() {}
258 bool operator==( const SdOptionsMisc
& rOpt
) const;
260 bool IsStartWithTemplate() const { Init(); return bStartWithTemplate
; }
261 bool IsMarkedHitMovesAlways() const { Init(); return bMarkedHitMovesAlways
; }
262 bool IsMoveOnlyDragging() const { Init(); return bMoveOnlyDragging
; }
263 bool IsCrookNoContortion() const { Init(); return bCrookNoContortion
; }
264 bool IsQuickEdit() const { Init(); return bQuickEdit
; }
265 bool IsMasterPagePaintCaching() const { Init(); return bMasterPageCache
; }
266 bool IsDragWithCopy() const { Init(); return bDragWithCopy
; }
267 bool IsPickThrough() const { Init(); return bPickThrough
; }
268 bool IsDoubleClickTextEdit() const { Init(); return bDoubleClickTextEdit
; }
269 bool IsClickChangeRotation() const { Init(); return bClickChangeRotation
; }
270 bool IsEnableSdremote() const { Init(); return bEnableSdremote
; }
271 bool IsEnablePresenterScreen() const { Init(); return bEnablePresenterScreen
; }
272 bool IsSolidDragging() const { Init(); return bSolidDragging
; }
273 bool IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs
; };
275 /** Return the currently selected printer independent layout mode.
277 Returns 1 for printer independent layout enabled and 0 when it
278 is disabled. Other values are reserved for future use.
280 sal_uInt16
GetPrinterIndependentLayout() const { Init(); return mnPrinterIndependentLayout
; };
281 bool IsShowUndoDeleteWarning() const { Init(); return bShowUndoDeleteWarning
; }
282 bool IsSlideshowRespectZOrder() const { Init(); return bSlideshowRespectZOrder
; }
283 sal_uLong
GetDefaultObjectSizeWidth() const { Init(); return nDefaultObjectSizeWidth
; }
284 sal_uLong
GetDefaultObjectSizeHeight() const { Init(); return nDefaultObjectSizeHeight
; }
286 bool IsPreviewNewEffects() const { Init(); return bPreviewNewEffects
; }
287 bool IsPreviewChangedEffects() const { Init(); return bPreviewChangedEffects
; }
288 bool IsPreviewTransitions() const { Init(); return bPreviewTransitions
; }
290 sal_Int32
GetDisplay() const;
291 void SetDisplay( sal_Int32 nDisplay
= 0 );
293 sal_Int32
GetPresentationPenColor() const { Init(); return mnPenColor
; }
294 void SetPresentationPenColor( sal_Int32 nPenColor
) { if( mnPenColor
!= nPenColor
) { OptionsChanged(); mnPenColor
= nPenColor
; } }
296 double GetPresentationPenWidth() const { Init(); return mnPenWidth
; }
297 void SetPresentationPenWidth( double nPenWidth
) { if( mnPenWidth
!= nPenWidth
) { OptionsChanged(); mnPenWidth
= nPenWidth
; } }
299 void SetStartWithTemplate( bool bOn
= true ) { if( bStartWithTemplate
!= bOn
) { OptionsChanged(); bStartWithTemplate
= bOn
; } }
300 void SetMarkedHitMovesAlways( bool bOn
= true ) { if( bMarkedHitMovesAlways
!= bOn
) { OptionsChanged(); bMarkedHitMovesAlways
= bOn
; } }
301 void SetMoveOnlyDragging( bool bOn
= true ) { if( bMoveOnlyDragging
!= bOn
) { OptionsChanged(); bMoveOnlyDragging
= bOn
; } }
302 void SetCrookNoContortion( bool bOn
= true ) { if( bCrookNoContortion
!= bOn
) { OptionsChanged(); bCrookNoContortion
= bOn
; } }
303 void SetQuickEdit( bool bOn
= true ) { if( bQuickEdit
!= bOn
) { OptionsChanged(); bQuickEdit
= bOn
; } }
304 void SetMasterPagePaintCaching( bool bOn
= true ) { if( bMasterPageCache
!= bOn
) { OptionsChanged(); bMasterPageCache
= bOn
; } }
305 void SetDragWithCopy( bool bOn
= true ) { if( bDragWithCopy
!= bOn
) { OptionsChanged(); bDragWithCopy
= bOn
; } }
306 void SetPickThrough( bool bOn
= true ) { if( bPickThrough
!= bOn
) { OptionsChanged(); bPickThrough
= bOn
; } }
307 void SetDoubleClickTextEdit( bool bOn
= true ) { if( bDoubleClickTextEdit
!= bOn
) { OptionsChanged(); bDoubleClickTextEdit
= bOn
; } }
308 void SetClickChangeRotation( bool bOn
= true ) { if( bClickChangeRotation
!= bOn
) { OptionsChanged(); bClickChangeRotation
= bOn
; } }
309 void SetEnableSdremote( bool bOn
= true ) { if( bEnableSdremote
!= bOn
) { OptionsChanged(); bEnableSdremote
= bOn
; } }
310 void SetEnablePresenterScreen( bool bOn
= true ) { if( bEnablePresenterScreen
!= bOn
) { OptionsChanged(); bEnablePresenterScreen
= bOn
; } }
311 void SetSummationOfParagraphs( bool bOn
= true ){ if ( bOn
!= bSummationOfParagraphs
) { OptionsChanged(); bSummationOfParagraphs
= bOn
; } }
312 /** Set the printer independent layout mode.
314 The default value is to switch printer independent layout on,
315 hence the parameters name. Use 0 for turning it off. Other
316 values are reserved for future use.
318 void SetPrinterIndependentLayout (sal_uInt16 nOn
= 1 ){ if ( nOn
!= mnPrinterIndependentLayout
) { OptionsChanged(); mnPrinterIndependentLayout
= nOn
; } }
319 void SetSolidDragging( bool bOn
= true ) { if( bSolidDragging
!= bOn
) { OptionsChanged(); bSolidDragging
= bOn
; } }
320 void SetShowUndoDeleteWarning( bool bOn
= true ) { if( bShowUndoDeleteWarning
!= bOn
) { OptionsChanged(); bShowUndoDeleteWarning
= bOn
; } }
321 void SetSlideshowRespectZOrder( bool bOn
= true ) { if( bSlideshowRespectZOrder
!= bOn
) { OptionsChanged(); bSlideshowRespectZOrder
= bOn
; } }
322 void SetDefaultObjectSizeWidth( sal_uLong nWidth
) { if( nDefaultObjectSizeWidth
!= nWidth
) { OptionsChanged(); nDefaultObjectSizeWidth
= nWidth
; } }
323 void SetDefaultObjectSizeHeight( sal_uLong nHeight
) { if( nDefaultObjectSizeHeight
!= nHeight
) { OptionsChanged(); nDefaultObjectSizeHeight
= nHeight
; } }
325 void SetPreviewNewEffects( bool bOn
) { if( bPreviewNewEffects
!= bOn
) { OptionsChanged(); bPreviewNewEffects
= bOn
; } }
326 void SetPreviewChangedEffects( bool bOn
) { if( bPreviewChangedEffects
!= bOn
) { OptionsChanged(); bPreviewChangedEffects
= bOn
; } }
327 void SetPreviewTransitions( bool bOn
) { if( bPreviewTransitions
!= bOn
) { OptionsChanged(); bPreviewTransitions
= bOn
; } }
329 bool IsShowComments() const { Init(); return bShowComments
; }
330 void SetShowComments( bool bShow
) { if( bShowComments
!= bShow
) { OptionsChanged(); bShowComments
= bShow
; } }
333 class SD_DLLPUBLIC SdOptionsMiscItem
: public SfxPoolItem
337 SdOptionsMiscItem( sal_uInt16 nWhich
);
338 SdOptionsMiscItem( sal_uInt16 nWhich
, SdOptions
* pOpts
, ::sd::FrameView
* pView
= NULL
);
340 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
341 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
343 void SetOptions( SdOptions
* pOpts
) const;
345 SdOptionsMisc
& GetOptionsMisc() { return maOptionsMisc
; }
346 const SdOptionsMisc
& GetOptionsMisc() const { return maOptionsMisc
; }
348 SdOptionsMisc maOptionsMisc
;
351 class SD_DLLPUBLIC SdOptionsSnap
: public SdOptionsGeneric
355 bool bSnapHelplines
: 1; // Snap/Object/SnapLine
356 bool bSnapBorder
: 1; // Snap/Object/PageMargin
357 bool bSnapFrame
: 1; // Snap/Object/ObjectFrame
358 bool bSnapPoints
: 1; // Snap/Object/ObjectPoint
359 bool bOrtho
: 1; // Snap/Position/CreatingMoving
360 bool bBigOrtho
: 1; // Snap/Position/ExtendEdges
361 bool bRotate
: 1; // Snap/Position/Rotating
362 sal_Int16 nSnapArea
; // Snap/Object/Range
363 sal_Int16 nAngle
; // Snap/Position/RotatingValue
364 sal_Int16 nBezAngle
; // Snap/Position/PointReduction
368 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const SAL_OVERRIDE
;
369 virtual bool ReadData( const ::com::sun::star::uno::Any
* pValues
) SAL_OVERRIDE
;
370 virtual bool WriteData( ::com::sun::star::uno::Any
* pValues
) const SAL_OVERRIDE
;
374 SdOptionsSnap( sal_uInt16 nConfigId
, bool bUseConfig
);
375 virtual ~SdOptionsSnap() {}
377 bool operator==( const SdOptionsSnap
& rOpt
) const;
379 bool IsSnapHelplines() const { Init(); return bSnapHelplines
; }
380 bool IsSnapBorder() const { Init(); return bSnapBorder
; }
381 bool IsSnapFrame() const { Init(); return bSnapFrame
; }
382 bool IsSnapPoints() const { Init(); return bSnapPoints
; }
383 bool IsOrtho() const { Init(); return bOrtho
; }
384 bool IsBigOrtho() const { Init(); return bBigOrtho
; }
385 bool IsRotate() const { Init(); return bRotate
; }
386 sal_Int16
GetSnapArea() const { Init(); return nSnapArea
; }
387 sal_Int16
GetAngle() const { Init(); return nAngle
; }
388 sal_Int16
GetEliminatePolyPointLimitAngle() const { Init(); return nBezAngle
; }
390 void SetSnapHelplines( bool bOn
= true ) { if( bSnapHelplines
!= bOn
) { OptionsChanged(); bSnapHelplines
= bOn
; } }
391 void SetSnapBorder( bool bOn
= true ) { if( bSnapBorder
!= bOn
) { OptionsChanged(); bSnapBorder
= bOn
; } }
392 void SetSnapFrame( bool bOn
= true ) { if( bSnapFrame
!= bOn
) { OptionsChanged(); bSnapFrame
= bOn
; } }
393 void SetSnapPoints( bool bOn
= true ) { if( bSnapPoints
!= bOn
) { OptionsChanged(); bSnapPoints
= bOn
; } }
394 void SetOrtho( bool bOn
= true ) { if( bOrtho
!= bOn
) { OptionsChanged(); bOrtho
= bOn
; } }
395 void SetBigOrtho( bool bOn
= true ) { if( bBigOrtho
!= bOn
) { OptionsChanged(); bBigOrtho
= bOn
; } }
396 void SetRotate( bool bOn
= true ) { if( bRotate
!= bOn
) { OptionsChanged(); bRotate
= bOn
; } }
397 void SetSnapArea( sal_Int16 nIn
) { if( nSnapArea
!= nIn
) { OptionsChanged(); nSnapArea
= nIn
; } }
398 void SetAngle( sal_Int16 nIn
) { if( nAngle
!= nIn
) { OptionsChanged(); nAngle
= nIn
; } }
399 void SetEliminatePolyPointLimitAngle( sal_Int16 nIn
) { if( nBezAngle
!= nIn
) { OptionsChanged(); nBezAngle
= nIn
; } }
402 class SD_DLLPUBLIC SdOptionsSnapItem
: public SfxPoolItem
406 SdOptionsSnapItem( sal_uInt16 nWhich
);
407 SdOptionsSnapItem( sal_uInt16 nWhich
, SdOptions
* pOpts
, ::sd::FrameView
* pView
= NULL
);
409 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
410 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
412 void SetOptions( SdOptions
* pOpts
) const;
414 SdOptionsSnap
& GetOptionsSnap() { return maOptionsSnap
; }
416 SdOptionsSnap maOptionsSnap
;
419 class SdOptionsZoom
: public SdOptionsGeneric
423 sal_Int32 nX
; // Zoom/ScaleX
424 sal_Int32 nY
; // Zoom/ScaleY
428 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const SAL_OVERRIDE
;
429 virtual bool ReadData( const ::com::sun::star::uno::Any
* pValues
) SAL_OVERRIDE
;
430 virtual bool WriteData( ::com::sun::star::uno::Any
* pValues
) const SAL_OVERRIDE
;
434 SdOptionsZoom( sal_uInt16 nConfigId
, bool bUseConfig
);
435 virtual ~SdOptionsZoom() {}
437 bool operator==( const SdOptionsZoom
& rOpt
) const;
439 void GetScale( sal_Int32
& rX
, sal_Int32
& rY
) const { Init(); rX
= nX
; rY
= nY
; }
440 void SetScale( sal_Int32 nInX
, sal_Int32 nInY
) { if( nX
!= nInX
|| nY
!= nInY
) { OptionsChanged(); nX
= nInX
; nY
= nInY
; } }
443 class SdOptionsGrid
: public SdOptionsGeneric
, public SvxOptionsGrid
447 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const SAL_OVERRIDE
;
448 virtual bool ReadData( const ::com::sun::star::uno::Any
* pValues
) SAL_OVERRIDE
;
449 virtual bool WriteData( ::com::sun::star::uno::Any
* pValues
) const SAL_OVERRIDE
;
453 SdOptionsGrid( sal_uInt16 nConfigId
, bool bUseConfig
);
454 virtual ~SdOptionsGrid();
457 bool operator==( const SdOptionsGrid
& rOpt
) const;
459 sal_uInt32
GetFieldDrawX() const { Init(); return SvxOptionsGrid::GetFieldDrawX(); }
460 sal_uInt32
GetFieldDivisionX() const { Init(); return SvxOptionsGrid::GetFieldDivisionX(); }
461 sal_uInt32
GetFieldDrawY() const { Init(); return SvxOptionsGrid::GetFieldDrawY(); }
462 sal_uInt32
GetFieldDivisionY() const { Init(); return SvxOptionsGrid::GetFieldDivisionY(); }
463 sal_uInt32
GetFieldSnapX() const { Init(); return SvxOptionsGrid::GetFieldSnapX(); }
464 sal_uInt32
GetFieldSnapY() const { Init(); return SvxOptionsGrid::GetFieldSnapY(); }
465 bool IsUseGridSnap() const { Init(); return SvxOptionsGrid::GetUseGridSnap(); }
466 bool IsSynchronize() const { Init(); return SvxOptionsGrid::GetSynchronize(); }
467 bool IsGridVisible() const { Init(); return SvxOptionsGrid::GetGridVisible(); }
468 bool IsEqualGrid() const { Init(); return SvxOptionsGrid::GetEqualGrid(); }
470 void SetFieldDrawX( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldDrawX() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDrawX( nSet
); } }
471 void SetFieldDivisionX( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldDivisionX() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDivisionX( nSet
); } }
472 void SetFieldDrawY( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldDrawY() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDrawY( nSet
); } }
473 void SetFieldDivisionY( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldDivisionY() ) { OptionsChanged(); SvxOptionsGrid::SetFieldDivisionY( nSet
); } }
474 void SetFieldSnapX( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldSnapX() ) { OptionsChanged(); SvxOptionsGrid::SetFieldSnapX( nSet
); } }
475 void SetFieldSnapY( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFieldSnapY() ) { OptionsChanged(); SvxOptionsGrid::SetFieldSnapY( nSet
); } }
476 void SetUseGridSnap( bool bSet
) { if( bSet
!= SvxOptionsGrid::GetUseGridSnap() ) { OptionsChanged(); SvxOptionsGrid::SetUseGridSnap( bSet
); } }
477 void SetSynchronize( bool bSet
) { if( bSet
!= SvxOptionsGrid::GetSynchronize() ) { OptionsChanged(); SvxOptionsGrid::SetSynchronize( bSet
); } }
478 void SetGridVisible( bool bSet
) { if( bSet
!= SvxOptionsGrid::GetGridVisible() ) { OptionsChanged(); SvxOptionsGrid::SetGridVisible( bSet
); } }
479 void SetEqualGrid( bool bSet
) { if( bSet
!= SvxOptionsGrid::GetEqualGrid() ) { OptionsChanged(); SvxOptionsGrid::SetEqualGrid( bSet
); } }
482 class SdOptionsGridItem
: public SvxGridItem
486 SdOptionsGridItem( sal_uInt16 nWhich
, SdOptions
* pOpts
, ::sd::FrameView
* pView
= NULL
);
488 void SetOptions( SdOptions
* pOpts
) const;
491 class SD_DLLPUBLIC SdOptionsPrint
: public SdOptionsGeneric
495 bool bDraw
: 1; // Print/Content/Drawing
496 bool bNotes
: 1; // Print/Content/Note
497 bool bHandout
: 1; // Print/Content/Handout
498 bool bOutline
: 1; // Print/Content/Outline
499 bool bDate
: 1; // Print/Other/Date
500 bool bTime
: 1; // Print/Other/Time
501 bool bPagename
: 1; // Print/Other/PageName
502 bool bHiddenPages
: 1; // Print/Other/HiddenPage
503 bool bPagesize
: 1; // Print/Page/PageSize
504 bool bPagetile
: 1; // Print/Page/PageTile
505 bool bWarningPrinter
: 1; // These flags you get
506 bool bWarningSize
: 1; // from the common options,
507 bool bWarningOrientation
: 1; // currently org.openoffice.Office.Common.xml (class OfaMiscCfg ; sfx2/misccfg.hxx )
508 bool bBooklet
: 1; // Print/Page/Booklet
509 bool bFront
: 1; // Print/Page/BookletFront
510 bool bBack
: 1; // Print/Page/BookletFront
511 bool bCutPage
: 1; // NOT persistent !!!
512 bool bPaperbin
: 1; // Print/Other/FromPrinterSetup
513 bool mbHandoutHorizontal
: 1; // Order Page previews on Handout Pages horizontal
514 sal_uInt16 mnHandoutPages
; // Number of page previews on handout page (only 1/2/4/6/9 are supported)
515 sal_uInt16 nQuality
; // Print/Other/Quality
519 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const SAL_OVERRIDE
;
520 virtual bool ReadData( const ::com::sun::star::uno::Any
* pValues
) SAL_OVERRIDE
;
521 virtual bool WriteData( ::com::sun::star::uno::Any
* pValues
) const SAL_OVERRIDE
;
525 SdOptionsPrint( sal_uInt16 nConfigId
, bool bUseConfig
);
526 virtual ~SdOptionsPrint() {}
528 bool operator==( const SdOptionsPrint
& rOpt
) const;
530 bool IsDraw() const { Init(); return bDraw
; }
531 bool IsNotes() const { Init(); return bNotes
; }
532 bool IsHandout() const { Init(); return bHandout
; }
533 bool IsOutline() const { Init(); return bOutline
; }
534 bool IsDate() const { Init(); return bDate
; }
535 bool IsTime() const { Init(); return bTime
; }
536 bool IsPagename() const { Init(); return bPagename
; }
537 bool IsHiddenPages() const { Init(); return bHiddenPages
; }
538 bool IsPagesize() const { Init(); return bPagesize
; }
539 bool IsPagetile() const { Init(); return bPagetile
; }
540 bool IsWarningPrinter() const { Init(); return bWarningPrinter
; }
541 bool IsWarningSize() const { Init(); return bWarningSize
; }
542 bool IsWarningOrientation() const { Init(); return bWarningOrientation
; }
543 bool IsBooklet() const { Init(); return bBooklet
; }
544 bool IsFrontPage() const { Init(); return bFront
; }
545 bool IsBackPage() const { Init(); return bBack
; }
546 bool IsCutPage() const { Init(); return bCutPage
; }
547 bool IsPaperbin() const { Init(); return bPaperbin
; }
548 sal_uInt16
GetOutputQuality() const { Init(); return nQuality
; }
549 bool IsHandoutHorizontal() const { Init(); return mbHandoutHorizontal
; }
550 sal_uInt16
GetHandoutPages() const { Init(); return mnHandoutPages
; }
552 void SetDraw( bool bOn
= true ) { if( bDraw
!= bOn
) { OptionsChanged(); bDraw
= bOn
; } }
553 void SetNotes( bool bOn
= true ) { if( bNotes
!= bOn
) { OptionsChanged(); bNotes
= bOn
; } }
554 void SetHandout( bool bOn
= true ) { if( bHandout
!= bOn
) { OptionsChanged(); bHandout
= bOn
; } }
555 void SetOutline( bool bOn
= true ) { if( bOutline
!= bOn
) { OptionsChanged(); bOutline
= bOn
; } }
556 void SetDate( bool bOn
= true ) { if( bDate
!= bOn
) { OptionsChanged(); bDate
= bOn
; } }
557 void SetTime( bool bOn
= true ) { if( bTime
!= bOn
) { OptionsChanged(); bTime
= bOn
; } }
558 void SetPagename( bool bOn
= true ) { if( bPagename
!= bOn
) { OptionsChanged(); bPagename
= bOn
; } }
559 void SetHiddenPages( bool bOn
= true ) { if( bHiddenPages
!= bOn
) { OptionsChanged(); bHiddenPages
= bOn
; } }
560 void SetPagesize( bool bOn
= true ) { if( bPagesize
!= bOn
) { OptionsChanged(); bPagesize
= bOn
; } }
561 void SetPagetile( bool bOn
= true ) { if( bPagetile
!= bOn
) { OptionsChanged(); bPagetile
= bOn
; } }
562 void SetWarningPrinter( bool bOn
= true ) { if( bWarningPrinter
!= bOn
) { OptionsChanged(); bWarningPrinter
= bOn
; } }
563 void SetWarningSize( bool bOn
= true ) { if( bWarningSize
!= bOn
) { OptionsChanged(); bWarningSize
= bOn
; } }
564 void SetWarningOrientation( bool bOn
= true ) { if( bWarningOrientation
!= bOn
) { OptionsChanged(); bWarningOrientation
= bOn
; } }
565 void SetBooklet( bool bOn
= true ) { if( bBooklet
!= bOn
) { OptionsChanged(); bBooklet
= bOn
; } }
566 void SetFrontPage( bool bOn
= true ) { if( bFront
!= bOn
) { OptionsChanged(); bFront
= bOn
; } }
567 void SetBackPage( bool bOn
= true ) { if( bBack
!= bOn
) { OptionsChanged(); bBack
= bOn
; } }
568 void SetCutPage( bool bOn
= true ) { if( bCutPage
!= bOn
) { OptionsChanged(); bCutPage
= bOn
; } }
569 void SetPaperbin( bool bOn
= true ) { if( bPaperbin
!= bOn
) { OptionsChanged(); bPaperbin
= bOn
; } }
570 void SetOutputQuality( sal_uInt16 nInQuality
) { if( nQuality
!= nInQuality
) { OptionsChanged(); nQuality
= nInQuality
; } }
571 void SetHandoutHorizontal( bool bHandoutHorizontal
) { if( mbHandoutHorizontal
!= bHandoutHorizontal
) { OptionsChanged(); mbHandoutHorizontal
= bHandoutHorizontal
; } }
572 void SetHandoutPages( sal_uInt16 nHandoutPages
) { if( nHandoutPages
!= mnHandoutPages
) { OptionsChanged(); mnHandoutPages
= nHandoutPages
; } }
575 class SD_DLLPUBLIC SdOptionsPrintItem
: public SfxPoolItem
579 SdOptionsPrintItem( sal_uInt16 nWhich
);
580 SdOptionsPrintItem( sal_uInt16 nWhich
, SdOptions
* pOpts
, ::sd::FrameView
* pView
= NULL
);
582 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
583 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
585 void SetOptions( SdOptions
* pOpts
) const;
587 SdOptionsPrint
& GetOptionsPrint() { return maOptionsPrint
; }
588 const SdOptionsPrint
& GetOptionsPrint() const { return maOptionsPrint
; }
590 SdOptionsPrint maOptionsPrint
;
593 class SdOptions
: public SdOptionsLayout
, public SdOptionsContents
,
594 public SdOptionsMisc
, public SdOptionsSnap
,
595 public SdOptionsZoom
, public SdOptionsGrid
,
596 public SdOptionsPrint
600 SdOptions( sal_uInt16 nConfigId
);
601 virtual ~SdOptions();
603 void StoreConfig( sal_uLong nOptionRange
= SD_OPTIONS_ALL
);
606 #endif // INCLUDED_SD_SOURCE_UI_INC_OPTSITEM_HXX
608 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */