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 _SD_OPTSITEM_HXX
21 #define _SD_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_NONE 0x00000000
34 #define SD_OPTIONS_ALL 0xffffffff
36 #define SD_OPTIONS_LAYOUT 0x00000001
37 #define SD_OPTIONS_CONTENTS 0x00000002
38 #define SD_OPTIONS_MISC 0x00000004
39 #define SD_OPTIONS_SNAP 0x00000008
40 #define SD_OPTIONS_ZOOM 0x00000010
41 #define SD_OPTIONS_GRID 0x00000020
42 #define SD_OPTIONS_PRINT 0x00000040
50 class SdOptionsGeneric
;
52 class SD_DLLPUBLIC SdOptionsItem
: public ::utl::ConfigItem
57 const SdOptionsGeneric
& mrParent
;
62 SdOptionsItem( const SdOptionsGeneric
& rParent
, const OUString rSubTree
);
63 virtual ~SdOptionsItem();
65 virtual void Commit();
66 virtual void Notify( const com::sun::star::uno::Sequence
<OUString
>& aPropertyNames
);
68 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> GetProperties(
69 const ::com::sun::star::uno::Sequence
< OUString
>& rNames
);
70 sal_Bool
PutProperties( const com::sun::star::uno::Sequence
< OUString
>& rNames
,
71 const com::sun::star::uno::Sequence
< com::sun::star::uno::Any
>& rValues
);
75 class SD_DLLPUBLIC SdOptionsGeneric
77 friend class SdOptionsItem
;
82 SdOptionsItem
* mpCfgItem
;
83 sal_uInt16 mnConfigId
;
85 sal_Bool mbEnableModify
: 1;
87 SAL_DLLPRIVATE
void Commit( SdOptionsItem
& rCfgItem
) const;
88 SAL_DLLPRIVATE ::com::sun::star::uno::Sequence
< OUString
> GetPropertyNames() const;
93 void OptionsChanged() { if( mpCfgItem
&& mbEnableModify
) mpCfgItem
->SetModified(); }
97 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const = 0;
98 virtual sal_Bool
ReadData( const ::com::sun::star::uno::Any
* pValues
) = 0;
99 virtual sal_Bool
WriteData( ::com::sun::star::uno::Any
* pValues
) const = 0;
103 SdOptionsGeneric( sal_uInt16 nConfigId
, const OUString
& rSubTree
);
104 virtual ~SdOptionsGeneric();
106 const OUString
& GetSubTree() const { return maSubTree
; }
107 sal_uInt16
GetConfigId() const { return mnConfigId
; }
109 void EnableModify( sal_Bool bModify
) { mbEnableModify
= bModify
; }
114 static bool isMetricSystem();
117 class SD_DLLPUBLIC SdOptionsLayout
: public SdOptionsGeneric
121 sal_Bool bRuler
; // Layout/Display/Ruler
122 sal_Bool bMoveOutline
; // Layout/Display/Contur
123 sal_Bool bDragStripes
; // Layout/Display/Guide
124 sal_Bool bHandlesBezier
; // Layout/Display/Bezier
125 sal_Bool bHelplines
; // Layout/Display/Helpline
126 sal_uInt16 nMetric
; // Layout/Other/MeasureUnit
127 sal_uInt16 nDefTab
; // Layout/Other/TabStop
131 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const;
132 virtual sal_Bool
ReadData( const ::com::sun::star::uno::Any
* pValues
);
133 virtual sal_Bool
WriteData( ::com::sun::star::uno::Any
* pValues
) const;
136 SdOptionsLayout( sal_uInt16 nConfigId
, sal_Bool bUseConfig
);
137 virtual ~SdOptionsLayout() {}
139 sal_Bool
operator==( const SdOptionsLayout
& rOpt
) const;
141 sal_Bool
IsRulerVisible() const { Init(); return (sal_Bool
) bRuler
; }
142 sal_Bool
IsMoveOutline() const { Init(); return (sal_Bool
) bMoveOutline
; }
143 sal_Bool
IsDragStripes() const { Init(); return (sal_Bool
) bDragStripes
; }
144 sal_Bool
IsHandlesBezier() const { Init(); return (sal_Bool
) bHandlesBezier
; }
145 sal_Bool
IsHelplines() const { Init(); return (sal_Bool
) bHelplines
; }
146 sal_uInt16
GetMetric() const { Init(); return( ( 0xffff == nMetric
) ? (sal_uInt16
)SfxModule::GetCurrentFieldUnit() : nMetric
); }
147 sal_uInt16
GetDefTab() const { Init(); return nDefTab
; }
149 void SetRulerVisible( sal_Bool bOn
= sal_True
) { if( bRuler
!= bOn
) { OptionsChanged(); bRuler
= bOn
; } }
150 void SetMoveOutline( sal_Bool bOn
= sal_True
) { if( bMoveOutline
!= bOn
) { OptionsChanged(); bMoveOutline
= bOn
; } }
151 void SetDragStripes( sal_Bool bOn
= sal_True
) { if( bDragStripes
!= bOn
) { OptionsChanged(); bDragStripes
= bOn
; } }
152 void SetHandlesBezier( sal_Bool bOn
= sal_True
) { if( bHandlesBezier
!= bOn
) { OptionsChanged(); bHandlesBezier
= bOn
; } }
153 void SetHelplines( sal_Bool bOn
= sal_True
) { if( bHelplines
!= bOn
) { OptionsChanged(); bHelplines
= bOn
; } }
154 void SetMetric( sal_uInt16 nInMetric
) { if( nMetric
!= nInMetric
) { OptionsChanged(); nMetric
= nInMetric
; } }
155 void SetDefTab( sal_uInt16 nTab
) { if( nDefTab
!= nTab
) { OptionsChanged(); nDefTab
= nTab
; } }
158 class SD_DLLPUBLIC SdOptionsLayoutItem
: public SfxPoolItem
162 SdOptionsLayoutItem( sal_uInt16 nWhich
);
163 SdOptionsLayoutItem( sal_uInt16 nWhich
, SdOptions
* pOpts
, ::sd::FrameView
* pView
= NULL
);
165 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
166 virtual int operator==( const SfxPoolItem
& ) const;
168 void SetOptions( SdOptions
* pOpts
) const;
170 SdOptionsLayout
& GetOptionsLayout() { return maOptionsLayout
; }
172 SdOptionsLayout maOptionsLayout
;
175 class SD_DLLPUBLIC SdOptionsContents
: public SdOptionsGeneric
180 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const;
181 virtual sal_Bool
ReadData( const ::com::sun::star::uno::Any
* pValues
);
182 virtual sal_Bool
WriteData( ::com::sun::star::uno::Any
* pValues
) const;
186 SdOptionsContents( sal_uInt16 nConfigId
, sal_Bool bUseConfig
);
187 virtual ~SdOptionsContents() {}
189 sal_Bool
operator==( const SdOptionsContents
& rOpt
) const;
192 class SD_DLLPUBLIC SdOptionsContentsItem
: public SfxPoolItem
196 SdOptionsContentsItem( sal_uInt16 nWhich
, SdOptions
* pOpts
, ::sd::FrameView
* pView
= NULL
);
198 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
199 virtual int operator==( const SfxPoolItem
& ) const;
201 void SetOptions( SdOptions
* pOpts
) const;
203 SdOptionsContents
& GetOptionsContents() { return maOptionsContents
; }
205 SdOptionsContents maOptionsContents
;
208 class SD_DLLPUBLIC SdOptionsMisc
: public SdOptionsGeneric
212 sal_uLong nDefaultObjectSizeWidth
;
213 sal_uLong nDefaultObjectSizeHeight
;
215 sal_Bool bStartWithTemplate
: 1; // Misc/NewDoc/AutoPilot
216 sal_Bool bMarkedHitMovesAlways
: 1; // Misc/ObjectMoveable
217 sal_Bool bMoveOnlyDragging
: 1; // Currently, not in use !!!
218 sal_Bool bCrookNoContortion
: 1; // Misc/NoDistort
219 sal_Bool bQuickEdit
: 1; // Misc/TextObject/QuickEditing
220 sal_Bool bMasterPageCache
: 1; // Misc/BackgroundCache
221 sal_Bool bDragWithCopy
: 1; // Misc/CopyWhileMoving
222 sal_Bool bPickThrough
: 1; // Misc/TextObject/Selectable
223 sal_Bool bDoubleClickTextEdit
: 1; // Misc/DclickTextedit
224 sal_Bool bClickChangeRotation
: 1; // Misc/RotateClick
225 sal_Bool bStartWithActualPage
: 1; // Misc/Start/CurrentPage
226 sal_Bool bEnableSdremote
: 1; // Misc/Start/EnableSdremote
227 sal_Bool bEnablePresenterScreen
: 1; // Misc/Start/EnablePresenterDisplay
228 sal_Bool bSolidDragging
: 1; // Misc/ModifyWithAttributes
229 sal_Bool bSummationOfParagraphs
: 1; // misc/SummationOfParagraphs
230 sal_Bool bShowUndoDeleteWarning
: 1; // Misc/ShowUndoDeleteWarning
232 sal_Bool bSlideshowRespectZOrder
: 1; // Misc/SlideshowRespectZOrder
233 sal_Bool bShowComments
: 1; // Misc/ShowComments
235 sal_Bool bPreviewNewEffects
;
236 sal_Bool bPreviewChangedEffects
;
237 sal_Bool bPreviewTransitions
;
241 sal_Int32 mnPenColor
;
244 /** This value controls the device to use for formatting documents.
245 The currently supported values are 0 for the current printer or 1
246 for the printer independent virtual device the can be retrieved from
249 sal_uInt16 mnPrinterIndependentLayout
; // Misc/Compatibility/PrinterIndependentLayout
254 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const;
255 virtual sal_Bool
ReadData( const ::com::sun::star::uno::Any
* pValues
);
256 virtual sal_Bool
WriteData( ::com::sun::star::uno::Any
* pValues
) const;
260 SdOptionsMisc( sal_uInt16 nConfigId
, sal_Bool bUseConfig
);
261 virtual ~SdOptionsMisc() {}
263 sal_Bool
operator==( const SdOptionsMisc
& rOpt
) const;
265 sal_Bool
IsStartWithTemplate() const { Init(); return (sal_Bool
) bStartWithTemplate
; }
266 sal_Bool
IsMarkedHitMovesAlways() const { Init(); return (sal_Bool
) bMarkedHitMovesAlways
; }
267 sal_Bool
IsMoveOnlyDragging() const { Init(); return (sal_Bool
) bMoveOnlyDragging
; }
268 sal_Bool
IsCrookNoContortion() const { Init(); return (sal_Bool
) bCrookNoContortion
; }
269 sal_Bool
IsQuickEdit() const { Init(); return (sal_Bool
) bQuickEdit
; }
270 sal_Bool
IsMasterPagePaintCaching() const { Init(); return (sal_Bool
) bMasterPageCache
; }
271 sal_Bool
IsDragWithCopy() const { Init(); return (sal_Bool
) bDragWithCopy
; }
272 sal_Bool
IsPickThrough() const { Init(); return (sal_Bool
) bPickThrough
; }
273 sal_Bool
IsDoubleClickTextEdit() const { Init(); return (sal_Bool
) bDoubleClickTextEdit
; }
274 sal_Bool
IsClickChangeRotation() const { Init(); return (sal_Bool
) bClickChangeRotation
; }
275 sal_Bool
IsStartWithActualPage() const { Init(); return (sal_Bool
) bStartWithActualPage
; }
276 sal_Bool
IsEnableSdremote() const { Init(); return (sal_Bool
) bEnableSdremote
; }
277 sal_Bool
IsEnablePresenterScreen() const { Init(); return (sal_Bool
) bEnablePresenterScreen
; }
278 sal_Bool
IsSolidDragging() const { Init(); return (sal_Bool
) bSolidDragging
; }
279 sal_Bool
IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs
!= 0; };
281 /** Return the currently selected printer independent layout mode.
283 Returns 1 for printer independent layout enabled and 0 when it
284 is disabled. Other values are reserved for future use.
286 sal_uInt16
GetPrinterIndependentLayout() const { Init(); return mnPrinterIndependentLayout
; };
287 sal_Bool
IsShowUndoDeleteWarning() const { Init(); return (sal_Bool
) bShowUndoDeleteWarning
; }
288 sal_Bool
IsSlideshowRespectZOrder() const { Init(); return (sal_Bool
) bSlideshowRespectZOrder
; }
289 sal_uLong
GetDefaultObjectSizeWidth() const { Init(); return nDefaultObjectSizeWidth
; }
290 sal_uLong
GetDefaultObjectSizeHeight() const { Init(); return nDefaultObjectSizeHeight
; }
292 sal_Bool
IsPreviewNewEffects() const { Init(); return bPreviewNewEffects
; }
293 sal_Bool
IsPreviewChangedEffects() const { Init(); return bPreviewChangedEffects
; }
294 sal_Bool
IsPreviewTransitions() const { Init(); return bPreviewTransitions
; }
296 sal_Int32
GetDisplay() const;
297 void SetDisplay( sal_Int32 nDisplay
= 0 );
299 sal_Int32
GetPresentationPenColor() const { Init(); return mnPenColor
; }
300 void SetPresentationPenColor( sal_Int32 nPenColor
) { if( mnPenColor
!= nPenColor
) { OptionsChanged(); mnPenColor
= nPenColor
; } }
302 double GetPresentationPenWidth() const { Init(); return mnPenWidth
; }
303 void SetPresentationPenWidth( double nPenWidth
) { if( mnPenWidth
!= nPenWidth
) { OptionsChanged(); mnPenWidth
= nPenWidth
; } }
305 void SetStartWithTemplate( sal_Bool bOn
= sal_True
) { if( bStartWithTemplate
!= bOn
) { OptionsChanged(); bStartWithTemplate
= bOn
; } }
306 void SetMarkedHitMovesAlways( sal_Bool bOn
= sal_True
) { if( bMarkedHitMovesAlways
!= bOn
) { OptionsChanged(); bMarkedHitMovesAlways
= bOn
; } }
307 void SetMoveOnlyDragging( sal_Bool bOn
= sal_True
) { if( bMoveOnlyDragging
!= bOn
) { OptionsChanged(); bMoveOnlyDragging
= bOn
; } }
308 void SetCrookNoContortion( sal_Bool bOn
= sal_True
) { if( bCrookNoContortion
!= bOn
) { OptionsChanged(); bCrookNoContortion
= bOn
; } }
309 void SetQuickEdit( sal_Bool bOn
= sal_True
) { if( bQuickEdit
!= bOn
) { OptionsChanged(); bQuickEdit
= bOn
; } }
310 void SetMasterPagePaintCaching( sal_Bool bOn
= sal_True
) { if( bMasterPageCache
!= bOn
) { OptionsChanged(); bMasterPageCache
= bOn
; } }
311 void SetDragWithCopy( sal_Bool bOn
= sal_True
) { if( bDragWithCopy
!= bOn
) { OptionsChanged(); bDragWithCopy
= bOn
; } }
312 void SetPickThrough( sal_Bool bOn
= sal_True
) { if( bPickThrough
!= bOn
) { OptionsChanged(); bPickThrough
= bOn
; } }
313 void SetDoubleClickTextEdit( sal_Bool bOn
= sal_True
) { if( bDoubleClickTextEdit
!= bOn
) { OptionsChanged(); bDoubleClickTextEdit
= bOn
; } }
314 void SetClickChangeRotation( sal_Bool bOn
= sal_True
) { if( bClickChangeRotation
!= bOn
) { OptionsChanged(); bClickChangeRotation
= bOn
; } }
315 void SetStartWithActualPage( sal_Bool bOn
= sal_True
) { if( bStartWithActualPage
!= bOn
) { OptionsChanged(); bStartWithActualPage
= bOn
; } }
316 void SetEnableSdremote( sal_Bool bOn
= sal_True
) { if( bEnableSdremote
!= bOn
) { OptionsChanged(); bEnableSdremote
= bOn
; } }
317 void SetEnablePresenterScreen( sal_Bool bOn
= sal_True
) { if( bEnablePresenterScreen
!= bOn
) { OptionsChanged(); bEnablePresenterScreen
= bOn
; } }
318 void SetSummationOfParagraphs( sal_Bool bOn
= sal_True
){ if ( bOn
!= bSummationOfParagraphs
) { OptionsChanged(); bSummationOfParagraphs
= bOn
; } }
319 /** Set the printer independent layout mode.
321 The default value is to switch printer independent layout on,
322 hence the parameters name. Use 0 for turning it off. Other
323 values are reserved for future use.
325 void SetPrinterIndependentLayout (sal_uInt16 nOn
= 1 ){ if ( nOn
!= mnPrinterIndependentLayout
) { OptionsChanged(); mnPrinterIndependentLayout
= nOn
; } }
326 void SetSolidDragging( sal_Bool bOn
= sal_True
) { if( bSolidDragging
!= bOn
) { OptionsChanged(); bSolidDragging
= bOn
; } }
327 void SetShowUndoDeleteWarning( sal_Bool bOn
= sal_True
) { if( bShowUndoDeleteWarning
!= bOn
) { OptionsChanged(); bShowUndoDeleteWarning
= bOn
; } }
328 void SetSlideshowRespectZOrder( sal_Bool bOn
= sal_True
) { if( bSlideshowRespectZOrder
!= bOn
) { OptionsChanged(); bSlideshowRespectZOrder
= bOn
; } }
329 void SetDefaultObjectSizeWidth( sal_uLong nWidth
) { if( nDefaultObjectSizeWidth
!= nWidth
) { OptionsChanged(); nDefaultObjectSizeWidth
= nWidth
; } }
330 void SetDefaultObjectSizeHeight( sal_uLong nHeight
) { if( nDefaultObjectSizeHeight
!= nHeight
) { OptionsChanged(); nDefaultObjectSizeHeight
= nHeight
; } }
332 void SetPreviewNewEffects( sal_Bool bOn
) { if( bPreviewNewEffects
!= bOn
) { OptionsChanged(); bPreviewNewEffects
= bOn
; } }
333 void SetPreviewChangedEffects( sal_Bool bOn
) { if( bPreviewChangedEffects
!= bOn
) { OptionsChanged(); bPreviewChangedEffects
= bOn
; } }
334 void SetPreviewTransitions( sal_Bool bOn
) { if( bPreviewTransitions
!= bOn
) { OptionsChanged(); bPreviewTransitions
= bOn
; } }
336 sal_Bool
IsShowComments() const { Init(); return bShowComments
; }
337 void SetShowComments( sal_Bool bShow
) { if( bShowComments
!= bShow
) { OptionsChanged(); bShowComments
= bShow
; } }
340 class SD_DLLPUBLIC SdOptionsMiscItem
: public SfxPoolItem
344 SdOptionsMiscItem( sal_uInt16 nWhich
);
345 SdOptionsMiscItem( sal_uInt16 nWhich
, SdOptions
* pOpts
, ::sd::FrameView
* pView
= NULL
);
347 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
348 virtual int operator==( const SfxPoolItem
& ) const;
350 void SetOptions( SdOptions
* pOpts
) const;
352 SdOptionsMisc
& GetOptionsMisc() { return maOptionsMisc
; }
353 const SdOptionsMisc
& GetOptionsMisc() const { return maOptionsMisc
; }
355 SdOptionsMisc maOptionsMisc
;
358 class SD_DLLPUBLIC SdOptionsSnap
: public SdOptionsGeneric
362 sal_Bool bSnapHelplines
: 1; // Snap/Object/SnapLine
363 sal_Bool bSnapBorder
: 1; // Snap/Object/PageMargin
364 sal_Bool bSnapFrame
: 1; // Snap/Object/ObjectFrame
365 sal_Bool bSnapPoints
: 1; // Snap/Object/ObjectPoint
366 sal_Bool bOrtho
: 1; // Snap/Position/CreatingMoving
367 sal_Bool bBigOrtho
: 1; // Snap/Position/ExtendEdges
368 sal_Bool bRotate
: 1; // Snap/Position/Rotating
369 sal_Int16 nSnapArea
; // Snap/Object/Range
370 sal_Int16 nAngle
; // Snap/Position/RotatingValue
371 sal_Int16 nBezAngle
; // Snap/Position/PointReduction
375 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const;
376 virtual sal_Bool
ReadData( const ::com::sun::star::uno::Any
* pValues
);
377 virtual sal_Bool
WriteData( ::com::sun::star::uno::Any
* pValues
) const;
381 SdOptionsSnap( sal_uInt16 nConfigId
, sal_Bool bUseConfig
);
382 virtual ~SdOptionsSnap() {}
384 sal_Bool
operator==( const SdOptionsSnap
& rOpt
) const;
386 sal_Bool
IsSnapHelplines() const { Init(); return (sal_Bool
) bSnapHelplines
; }
387 sal_Bool
IsSnapBorder() const { Init(); return (sal_Bool
) bSnapBorder
; }
388 sal_Bool
IsSnapFrame() const { Init(); return (sal_Bool
) bSnapFrame
; }
389 sal_Bool
IsSnapPoints() const { Init(); return (sal_Bool
) bSnapPoints
; }
390 sal_Bool
IsOrtho() const { Init(); return (sal_Bool
) bOrtho
; }
391 sal_Bool
IsBigOrtho() const { Init(); return (sal_Bool
) bBigOrtho
; }
392 sal_Bool
IsRotate() const { Init(); return (sal_Bool
) bRotate
; }
393 sal_Int16
GetSnapArea() const { Init(); return nSnapArea
; }
394 sal_Int16
GetAngle() const { Init(); return nAngle
; }
395 sal_Int16
GetEliminatePolyPointLimitAngle() const { Init(); return nBezAngle
; }
397 void SetSnapHelplines( sal_Bool bOn
= sal_True
) { if( bSnapHelplines
!= bOn
) { OptionsChanged(); bSnapHelplines
= bOn
; } }
398 void SetSnapBorder( sal_Bool bOn
= sal_True
) { if( bSnapBorder
!= bOn
) { OptionsChanged(); bSnapBorder
= bOn
; } }
399 void SetSnapFrame( sal_Bool bOn
= sal_True
) { if( bSnapFrame
!= bOn
) { OptionsChanged(); bSnapFrame
= bOn
; } }
400 void SetSnapPoints( sal_Bool bOn
= sal_True
) { if( bSnapPoints
!= bOn
) { OptionsChanged(); bSnapPoints
= bOn
; } }
401 void SetOrtho( sal_Bool bOn
= sal_True
) { if( bOrtho
!= bOn
) { OptionsChanged(); bOrtho
= bOn
; } }
402 void SetBigOrtho( sal_Bool bOn
= sal_True
) { if( bBigOrtho
!= bOn
) { OptionsChanged(); bBigOrtho
= bOn
; } }
403 void SetRotate( sal_Bool bOn
= sal_True
) { if( bRotate
!= bOn
) { OptionsChanged(); bRotate
= bOn
; } }
404 void SetSnapArea( sal_Int16 nIn
) { if( nSnapArea
!= nIn
) { OptionsChanged(); nSnapArea
= nIn
; } }
405 void SetAngle( sal_Int16 nIn
) { if( nAngle
!= nIn
) { OptionsChanged(); nAngle
= nIn
; } }
406 void SetEliminatePolyPointLimitAngle( sal_Int16 nIn
) { if( nBezAngle
!= nIn
) { OptionsChanged(); nBezAngle
= nIn
; } }
409 class SD_DLLPUBLIC SdOptionsSnapItem
: public SfxPoolItem
413 SdOptionsSnapItem( sal_uInt16 nWhich
);
414 SdOptionsSnapItem( sal_uInt16 nWhich
, SdOptions
* pOpts
, ::sd::FrameView
* pView
= NULL
);
416 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
417 virtual int operator==( const SfxPoolItem
& ) const;
419 void SetOptions( SdOptions
* pOpts
) const;
421 SdOptionsSnap
& GetOptionsSnap() { return maOptionsSnap
; }
423 SdOptionsSnap maOptionsSnap
;
426 class SdOptionsZoom
: public SdOptionsGeneric
430 sal_Int32 nX
; // Zoom/ScaleX
431 sal_Int32 nY
; // Zoom/ScaleY
435 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const;
436 virtual sal_Bool
ReadData( const ::com::sun::star::uno::Any
* pValues
);
437 virtual sal_Bool
WriteData( ::com::sun::star::uno::Any
* pValues
) const;
441 SdOptionsZoom( sal_uInt16 nConfigId
, sal_Bool bUseConfig
);
442 virtual ~SdOptionsZoom() {}
444 sal_Bool
operator==( const SdOptionsZoom
& rOpt
) const;
446 void GetScale( sal_Int32
& rX
, sal_Int32
& rY
) const { Init(); rX
= nX
; rY
= nY
; }
447 void SetScale( sal_Int32 nInX
, sal_Int32 nInY
) { if( nX
!= nInX
|| nY
!= nInY
) { OptionsChanged(); nX
= nInX
; nY
= nInY
; } }
450 class SdOptionsGrid
: public SdOptionsGeneric
, public SvxOptionsGrid
454 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const;
455 virtual sal_Bool
ReadData( const ::com::sun::star::uno::Any
* pValues
);
456 virtual sal_Bool
WriteData( ::com::sun::star::uno::Any
* pValues
) const;
460 SdOptionsGrid( sal_uInt16 nConfigId
, sal_Bool bUseConfig
);
461 virtual ~SdOptionsGrid();
464 sal_Bool
operator==( const SdOptionsGrid
& rOpt
) const;
466 sal_uInt32
GetFldDrawX() const { Init(); return SvxOptionsGrid::GetFldDrawX(); }
467 sal_uInt32
GetFldDivisionX() const { Init(); return SvxOptionsGrid::GetFldDivisionX(); }
468 sal_uInt32
GetFldDrawY() const { Init(); return SvxOptionsGrid::GetFldDrawY(); }
469 sal_uInt32
GetFldDivisionY() const { Init(); return SvxOptionsGrid::GetFldDivisionY(); }
470 sal_uInt32
GetFldSnapX() const { Init(); return SvxOptionsGrid::GetFldSnapX(); }
471 sal_uInt32
GetFldSnapY() const { Init(); return SvxOptionsGrid::GetFldSnapY(); }
472 sal_Bool
IsUseGridSnap() const { Init(); return SvxOptionsGrid::GetUseGridSnap(); }
473 sal_Bool
IsSynchronize() const { Init(); return SvxOptionsGrid::GetSynchronize(); }
474 sal_Bool
IsGridVisible() const { Init(); return SvxOptionsGrid::GetGridVisible(); }
475 sal_Bool
IsEqualGrid() const { Init(); return SvxOptionsGrid::GetEqualGrid(); }
477 void SetFldDrawX( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFldDrawX() ) { OptionsChanged(); SvxOptionsGrid::SetFldDrawX( nSet
); } }
478 void SetFldDivisionX( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFldDivisionX() ) { OptionsChanged(); SvxOptionsGrid::SetFldDivisionX( nSet
); } }
479 void SetFldDrawY( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFldDrawY() ) { OptionsChanged(); SvxOptionsGrid::SetFldDrawY( nSet
); } }
480 void SetFldDivisionY( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFldDivisionY() ) { OptionsChanged(); SvxOptionsGrid::SetFldDivisionY( nSet
); } }
481 void SetFldSnapX( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFldSnapX() ) { OptionsChanged(); SvxOptionsGrid::SetFldSnapX( nSet
); } }
482 void SetFldSnapY( sal_uInt32 nSet
) { if( nSet
!= SvxOptionsGrid::GetFldSnapY() ) { OptionsChanged(); SvxOptionsGrid::SetFldSnapY( nSet
); } }
483 void SetUseGridSnap( sal_Bool bSet
) { if( bSet
!= SvxOptionsGrid::GetUseGridSnap() ) { OptionsChanged(); SvxOptionsGrid::SetUseGridSnap( bSet
); } }
484 void SetSynchronize( sal_Bool bSet
) { if( bSet
!= SvxOptionsGrid::GetSynchronize() ) { OptionsChanged(); SvxOptionsGrid::SetSynchronize( bSet
); } }
485 void SetGridVisible( sal_Bool bSet
) { if( bSet
!= SvxOptionsGrid::GetGridVisible() ) { OptionsChanged(); SvxOptionsGrid::SetGridVisible( bSet
); } }
486 void SetEqualGrid( sal_Bool bSet
) { if( bSet
!= SvxOptionsGrid::GetEqualGrid() ) { OptionsChanged(); SvxOptionsGrid::SetEqualGrid( bSet
); } }
489 class SdOptionsGridItem
: public SvxGridItem
493 SdOptionsGridItem( sal_uInt16 nWhich
, SdOptions
* pOpts
, ::sd::FrameView
* pView
= NULL
);
495 void SetOptions( SdOptions
* pOpts
) const;
498 class SD_DLLPUBLIC SdOptionsPrint
: public SdOptionsGeneric
502 sal_Bool bDraw
: 1; // Print/Content/Drawing
503 sal_Bool bNotes
: 1; // Print/Content/Note
504 sal_Bool bHandout
: 1; // Print/Content/Handout
505 sal_Bool bOutline
: 1; // Print/Content/Outline
506 sal_Bool bDate
: 1; // Print/Other/Date
507 sal_Bool bTime
: 1; // Print/Other/Time
508 sal_Bool bPagename
: 1; // Print/Other/PageName
509 sal_Bool bHiddenPages
: 1; // Print/Other/HiddenPage
510 sal_Bool bPagesize
: 1; // Print/Page/PageSize
511 sal_Bool bPagetile
: 1; // Print/Page/PageTile
512 sal_Bool bWarningPrinter
: 1; // These flags you get
513 sal_Bool bWarningSize
: 1; // from the common options,
514 sal_Bool bWarningOrientation
: 1; // currently org.openoffice.Office.Common.xml (class OfaMiscCfg ; sfx2/misccfg.hxx )
515 sal_Bool bBooklet
: 1; // Print/Page/Booklet
516 sal_Bool bFront
: 1; // Print/Page/BookletFront
517 sal_Bool bBack
: 1; // Print/Page/BookletFront
518 sal_Bool bCutPage
: 1; // NOT persistent !!!
519 sal_Bool bPaperbin
: 1; // Print/Other/FromPrinterSetup
520 sal_Bool mbHandoutHorizontal
: 1; // Order Page previews on Handout Pages horizontal
521 sal_uInt16 mnHandoutPages
; // Number of page previews on handout page (only 1/2/4/6/9 are supported)
522 sal_uInt16 nQuality
; // Print/Other/Quality
526 virtual void GetPropNameArray( const char**& ppNames
, sal_uLong
& rCount
) const;
527 virtual sal_Bool
ReadData( const ::com::sun::star::uno::Any
* pValues
);
528 virtual sal_Bool
WriteData( ::com::sun::star::uno::Any
* pValues
) const;
532 SdOptionsPrint( sal_uInt16 nConfigId
, sal_Bool bUseConfig
);
533 virtual ~SdOptionsPrint() {}
535 sal_Bool
operator==( const SdOptionsPrint
& rOpt
) const;
537 sal_Bool
IsDraw() const { Init(); return (sal_Bool
) bDraw
; }
538 sal_Bool
IsNotes() const { Init(); return (sal_Bool
) bNotes
; }
539 sal_Bool
IsHandout() const { Init(); return (sal_Bool
) bHandout
; }
540 sal_Bool
IsOutline() const { Init(); return (sal_Bool
) bOutline
; }
541 sal_Bool
IsDate() const { Init(); return (sal_Bool
) bDate
; }
542 sal_Bool
IsTime() const { Init(); return (sal_Bool
) bTime
; }
543 sal_Bool
IsPagename() const { Init(); return (sal_Bool
) bPagename
; }
544 sal_Bool
IsHiddenPages() const { Init(); return (sal_Bool
) bHiddenPages
; }
545 sal_Bool
IsPagesize() const { Init(); return (sal_Bool
) bPagesize
; }
546 sal_Bool
IsPagetile() const { Init(); return (sal_Bool
) bPagetile
; }
547 sal_Bool
IsWarningPrinter() const { Init(); return (sal_Bool
) bWarningPrinter
; }
548 sal_Bool
IsWarningSize() const { Init(); return (sal_Bool
) bWarningSize
; }
549 sal_Bool
IsWarningOrientation() const { Init(); return (sal_Bool
) bWarningOrientation
; }
550 sal_Bool
IsBooklet() const { Init(); return (sal_Bool
) bBooklet
; }
551 sal_Bool
IsFrontPage() const { Init(); return (sal_Bool
) bFront
; }
552 sal_Bool
IsBackPage() const { Init(); return (sal_Bool
) bBack
; }
553 sal_Bool
IsCutPage() const { Init(); return (sal_Bool
) bCutPage
; }
554 sal_Bool
IsPaperbin() const { Init(); return (sal_Bool
) bPaperbin
; }
555 sal_uInt16
GetOutputQuality() const { Init(); return nQuality
; }
556 sal_Bool
IsHandoutHorizontal() const { Init(); return mbHandoutHorizontal
; }
557 sal_uInt16
GetHandoutPages() const { Init(); return mnHandoutPages
; }
559 void SetDraw( sal_Bool bOn
= sal_True
) { if( bDraw
!= bOn
) { OptionsChanged(); bDraw
= bOn
; } }
560 void SetNotes( sal_Bool bOn
= sal_True
) { if( bNotes
!= bOn
) { OptionsChanged(); bNotes
= bOn
; } }
561 void SetHandout( sal_Bool bOn
= sal_True
) { if( bHandout
!= bOn
) { OptionsChanged(); bHandout
= bOn
; } }
562 void SetOutline( sal_Bool bOn
= sal_True
) { if( bOutline
!= bOn
) { OptionsChanged(); bOutline
= bOn
; } }
563 void SetDate( sal_Bool bOn
= sal_True
) { if( bDate
!= bOn
) { OptionsChanged(); bDate
= bOn
; } }
564 void SetTime( sal_Bool bOn
= sal_True
) { if( bTime
!= bOn
) { OptionsChanged(); bTime
= bOn
; } }
565 void SetPagename( sal_Bool bOn
= sal_True
) { if( bPagename
!= bOn
) { OptionsChanged(); bPagename
= bOn
; } }
566 void SetHiddenPages( sal_Bool bOn
= sal_True
) { if( bHiddenPages
!= bOn
) { OptionsChanged(); bHiddenPages
= bOn
; } }
567 void SetPagesize( sal_Bool bOn
= sal_True
) { if( bPagesize
!= bOn
) { OptionsChanged(); bPagesize
= bOn
; } }
568 void SetPagetile( sal_Bool bOn
= sal_True
) { if( bPagetile
!= bOn
) { OptionsChanged(); bPagetile
= bOn
; } }
569 void SetWarningPrinter( sal_Bool bOn
= sal_True
) { if( bWarningPrinter
!= bOn
) { OptionsChanged(); bWarningPrinter
= bOn
; } }
570 void SetWarningSize( sal_Bool bOn
= sal_True
) { if( bWarningSize
!= bOn
) { OptionsChanged(); bWarningSize
= bOn
; } }
571 void SetWarningOrientation( sal_Bool bOn
= sal_True
) { if( bWarningOrientation
!= bOn
) { OptionsChanged(); bWarningOrientation
= bOn
; } }
572 void SetBooklet( sal_Bool bOn
= sal_True
) { if( bBooklet
!= bOn
) { OptionsChanged(); bBooklet
= bOn
; } }
573 void SetFrontPage( sal_Bool bOn
= sal_True
) { if( bFront
!= bOn
) { OptionsChanged(); bFront
= bOn
; } }
574 void SetBackPage( sal_Bool bOn
= sal_True
) { if( bBack
!= bOn
) { OptionsChanged(); bBack
= bOn
; } }
575 void SetCutPage( sal_Bool bOn
= sal_True
) { if( bCutPage
!= bOn
) { OptionsChanged(); bCutPage
= bOn
; } }
576 void SetPaperbin( sal_Bool bOn
= sal_True
) { if( bPaperbin
!= bOn
) { OptionsChanged(); bPaperbin
= bOn
; } }
577 void SetOutputQuality( sal_uInt16 nInQuality
) { if( nQuality
!= nInQuality
) { OptionsChanged(); nQuality
= nInQuality
; } }
578 void SetHandoutHorizontal( sal_Bool bHandoutHorizontal
) { if( mbHandoutHorizontal
!= bHandoutHorizontal
) { OptionsChanged(); mbHandoutHorizontal
= bHandoutHorizontal
; } }
579 void SetHandoutPages( sal_uInt16 nHandoutPages
) { if( nHandoutPages
!= mnHandoutPages
) { OptionsChanged(); mnHandoutPages
= nHandoutPages
; } }
582 class SD_DLLPUBLIC SdOptionsPrintItem
: public SfxPoolItem
586 SdOptionsPrintItem( sal_uInt16 nWhich
);
587 SdOptionsPrintItem( sal_uInt16 nWhich
, SdOptions
* pOpts
, ::sd::FrameView
* pView
= NULL
);
589 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
590 virtual int operator==( const SfxPoolItem
& ) const;
592 void SetOptions( SdOptions
* pOpts
) const;
594 SdOptionsPrint
& GetOptionsPrint() { return maOptionsPrint
; }
595 const SdOptionsPrint
& GetOptionsPrint() const { return maOptionsPrint
; }
597 SdOptionsPrint maOptionsPrint
;
600 class SdOptions
: public SdOptionsLayout
, public SdOptionsContents
,
601 public SdOptionsMisc
, public SdOptionsSnap
,
602 public SdOptionsZoom
, public SdOptionsGrid
,
603 public SdOptionsPrint
607 SdOptions( sal_uInt16 nConfigId
);
608 virtual ~SdOptions();
610 void StoreConfig( sal_uLong nOptionRange
= SD_OPTIONS_ALL
);
613 #endif // _SD_OPTSITEM_HXX
615 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */