merge the formfield patch from ooo-build
[ooovba.git] / sd / source / ui / inc / optsitem.hxx
blobed8fd7ff6fcd63f8ed9f947d4226e1ea489702d5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: optsitem.hxx,v $
10 * $Revision: 1.29 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SD_OPTSITEM_HXX
32 #define _SD_OPTSITEM_HXX
34 #include <unotools/configitem.hxx>
35 #include <sfx2/module.hxx>
36 #include <sfx2/app.hxx>
37 #include <sfx2/sfxsids.hrc>
38 #include <svx/optgrid.hxx>
39 #include <svx/dlgutil.hxx>
40 #include "sddllapi.h"
42 // -----------------
43 // - Option ranges -
44 // -----------------
46 #define SD_OPTIONS_NONE 0x00000000
47 #define SD_OPTIONS_ALL 0xffffffff
49 #define SD_OPTIONS_LAYOUT 0x00000001
50 #define SD_OPTIONS_CONTENTS 0x00000002
51 #define SD_OPTIONS_MISC 0x00000004
52 #define SD_OPTIONS_SNAP 0x00000008
53 #define SD_OPTIONS_ZOOM 0x00000010
54 #define SD_OPTIONS_GRID 0x00000020
55 #define SD_OPTIONS_PRINT 0x00000040
57 // ------------
58 // - Forwards -
59 // ------------
61 class SfxConfigItem;
62 class SdOptions;
64 namespace sd {
65 class FrameView;
68 // -----------------
69 // - SdOptionsItem -
70 // -----------------
72 class SdOptionsGeneric;
74 class SD_DLLPUBLIC SdOptionsItem : public ::utl::ConfigItem
77 private:
79 const SdOptionsGeneric& mrParent;
82 public:
84 SdOptionsItem( const SdOptionsGeneric& rParent, const ::rtl::OUString rSubTree );
85 virtual ~SdOptionsItem();
87 virtual void Commit();
89 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetProperties(
90 const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames );
91 sal_Bool PutProperties( const com::sun::star::uno::Sequence< rtl::OUString >& rNames,
92 const com::sun::star::uno::Sequence< com::sun::star::uno::Any>& rValues );
93 void SetModified();
96 // --------------------
97 // - SdOptionsGeneric -
98 // --------------------
100 class SD_DLLPUBLIC SdOptionsGeneric
102 friend class SdOptionsItem;
104 private:
106 ::rtl::OUString maSubTree;
107 SdOptionsItem* mpCfgItem;
108 USHORT mnConfigId;
109 BOOL mbInit : 1;
110 BOOL mbEnableModify : 1;
112 SD_DLLPRIVATE void Commit( SdOptionsItem& rCfgItem ) const;
113 SD_DLLPRIVATE ::com::sun::star::uno::Sequence< ::rtl::OUString > GetPropertyNames() const;
115 protected:
117 void Init() const;
118 void OptionsChanged() { if( mpCfgItem && mbEnableModify ) mpCfgItem->SetModified(); }
120 protected:
122 virtual void GetPropNameArray( const char**& ppNames, ULONG& rCount ) const = 0;
123 virtual BOOL ReadData( const ::com::sun::star::uno::Any* pValues ) = 0;
124 virtual BOOL WriteData( ::com::sun::star::uno::Any* pValues ) const = 0;
126 public:
128 SdOptionsGeneric( USHORT nConfigId, const ::rtl::OUString& rSubTree );
129 virtual ~SdOptionsGeneric();
131 const ::rtl::OUString& GetSubTree() const { return maSubTree; }
132 USHORT GetConfigId() const { return mnConfigId; }
134 void EnableModify( BOOL bModify ) { mbEnableModify = bModify; }
136 void Store();
139 static bool isMetricSystem();
142 // -------------------
143 // - SdOptionsLayout -
144 // -------------------
146 class SD_DLLPUBLIC SdOptionsLayout : public SdOptionsGeneric
148 private:
150 BOOL bRuler : 1; // Layout/Display/Ruler
151 BOOL bMoveOutline : 1; // Layout/Display/Contur
152 BOOL bDragStripes : 1; // Layout/Display/Guide
153 BOOL bHandlesBezier : 1; // Layout/Display/Bezier
154 BOOL bHelplines : 1; // Layout/Display/Helpline
155 UINT16 nMetric; // Layout/Other/MeasureUnit
156 UINT16 nDefTab; // Layout/Other/TabStop
158 protected:
160 virtual void GetPropNameArray( const char**& ppNames, ULONG& rCount ) const;
161 virtual BOOL ReadData( const ::com::sun::star::uno::Any* pValues );
162 virtual BOOL WriteData( ::com::sun::star::uno::Any* pValues ) const;
164 public:
165 SdOptionsLayout( USHORT nConfigId, BOOL bUseConfig );
166 virtual ~SdOptionsLayout() {}
168 void SetDefaults();
169 BOOL operator==( const SdOptionsLayout& rOpt ) const;
171 BOOL IsRulerVisible() const { Init(); return (BOOL) bRuler; }
172 BOOL IsMoveOutline() const { Init(); return (BOOL) bMoveOutline; }
173 BOOL IsDragStripes() const { Init(); return (BOOL) bDragStripes; }
174 BOOL IsHandlesBezier() const { Init(); return (BOOL) bHandlesBezier; }
175 BOOL IsHelplines() const { Init(); return (BOOL) bHelplines; }
176 UINT16 GetMetric() const { Init(); return( ( 0xffff == nMetric ) ? (UINT16)GetModuleFieldUnit() : nMetric ); }
177 UINT16 GetDefTab() const { Init(); return nDefTab; }
179 void SetRulerVisible( BOOL bOn = TRUE ) { if( bRuler != bOn ) { OptionsChanged(); bRuler = bOn; } }
180 void SetMoveOutline( BOOL bOn = TRUE ) { if( bMoveOutline != bOn ) { OptionsChanged(); bMoveOutline = bOn; } }
181 void SetDragStripes( BOOL bOn = TRUE ) { if( bDragStripes != bOn ) { OptionsChanged(); bDragStripes = bOn; } }
182 void SetHandlesBezier( BOOL bOn = TRUE ) { if( bHandlesBezier != bOn ) { OptionsChanged(); bHandlesBezier = bOn; } }
183 void SetHelplines( BOOL bOn = TRUE ) { if( bHelplines != bOn ) { OptionsChanged(); bHelplines = bOn; } }
184 void SetMetric( UINT16 nInMetric ) { if( nMetric != nInMetric ) { OptionsChanged(); nMetric = nInMetric; } }
185 void SetDefTab( UINT16 nTab ) { if( nDefTab != nTab ) { OptionsChanged(); nDefTab = nTab; } }
188 // -----------------------------------------------------------------------------
190 class SD_DLLPUBLIC SdOptionsLayoutItem : public SfxPoolItem
192 public:
194 SdOptionsLayoutItem( USHORT nWhich);
195 SdOptionsLayoutItem( USHORT nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
197 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
198 virtual int operator==( const SfxPoolItem& ) const;
200 void SetOptions( SdOptions* pOpts ) const;
202 SdOptionsLayout& GetOptionsLayout() { return maOptionsLayout; }
203 private:
204 SdOptionsLayout maOptionsLayout;
207 // ---------------------
208 // - SdOptionsContents -
209 // ---------------------
211 class SD_DLLPUBLIC SdOptionsContents : public SdOptionsGeneric
213 private:
214 protected:
216 virtual void GetPropNameArray( const char**& ppNames, ULONG& rCount ) const;
217 virtual BOOL ReadData( const ::com::sun::star::uno::Any* pValues );
218 virtual BOOL WriteData( ::com::sun::star::uno::Any* pValues ) const;
220 public:
222 SdOptionsContents( USHORT nConfigId, BOOL bUseConfig );
223 virtual ~SdOptionsContents() {}
225 void SetDefaults();
226 BOOL operator==( const SdOptionsContents& rOpt ) const;
229 // -----------------------------------------------------------------------------
231 class SD_DLLPUBLIC SdOptionsContentsItem : public SfxPoolItem
233 public:
235 SdOptionsContentsItem( USHORT nWhich);
236 SdOptionsContentsItem( USHORT nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
238 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
239 virtual int operator==( const SfxPoolItem& ) const;
241 void SetOptions( SdOptions* pOpts ) const;
243 SdOptionsContents& GetOptionsContents() { return maOptionsContents; }
244 private:
245 SdOptionsContents maOptionsContents;
248 // -----------------
249 // - SdOptionsMisc -
250 // -----------------
252 class SD_DLLPUBLIC SdOptionsMisc : public SdOptionsGeneric
254 private:
256 // #97016#
257 ULONG nDefaultObjectSizeWidth;
258 ULONG nDefaultObjectSizeHeight;
260 BOOL bStartWithTemplate : 1; // Misc/NewDoc/AutoPilot
261 BOOL bMarkedHitMovesAlways : 1; // Misc/ObjectMoveable
262 BOOL bMoveOnlyDragging : 1; // Currently, not in use !!!
263 BOOL bCrookNoContortion : 1; // Misc/NoDistort
264 BOOL bQuickEdit : 1; // Misc/TextObject/QuickEditing
265 BOOL bMasterPageCache : 1; // Misc/BackgroundCache
266 BOOL bDragWithCopy : 1; // Misc/CopyWhileMoving
267 BOOL bPickThrough : 1; // Misc/TextObject/Selectable
268 BOOL bBigHandles : 1; // Misc/BigHandles
269 BOOL bDoubleClickTextEdit : 1; // Misc/DclickTextedit
270 BOOL bClickChangeRotation : 1; // Misc/RotateClick
271 BOOL bStartWithActualPage : 1; // Misc/Start/CurrentPage
272 BOOL bSolidDragging : 1; // Misc/ModifyWithAttributes
273 BOOL bSolidMarkHdl : 1; // /Misc/SimpleHandles
274 BOOL bSummationOfParagraphs : 1; // misc/SummationOfParagraphs
275 // #90356#
276 BOOL bShowUndoDeleteWarning : 1; // Misc/ShowUndoDeleteWarning
277 // #i75315#
278 BOOL bSlideshowRespectZOrder : 1; // Misc/SlideshowRespectZOrder
279 BOOL bShowComments : 1; // Misc/ShowComments
281 sal_Bool bPreviewNewEffects;
282 sal_Bool bPreviewChangedEffects;
283 sal_Bool bPreviewTransitions;
285 sal_Int32 mnDisplay;
287 /** This value controls the device to use for formatting documents.
288 The currently supported values are 0 for the current printer or 1
289 for the printer independent virtual device the can be retrieved from
290 the modules.
292 USHORT mnPrinterIndependentLayout; // Misc/Compatibility/PrinterIndependentLayout
293 // Misc
295 protected:
297 virtual void GetPropNameArray( const char**& ppNames, ULONG& rCount ) const;
298 virtual BOOL ReadData( const ::com::sun::star::uno::Any* pValues );
299 virtual BOOL WriteData( ::com::sun::star::uno::Any* pValues ) const;
301 public:
303 SdOptionsMisc( USHORT nConfigId, BOOL bUseConfig );
304 virtual ~SdOptionsMisc() {}
306 void SetDefaults();
307 BOOL operator==( const SdOptionsMisc& rOpt ) const;
309 BOOL IsStartWithTemplate() const { Init(); return (BOOL) bStartWithTemplate; }
310 BOOL IsMarkedHitMovesAlways() const { Init(); return (BOOL) bMarkedHitMovesAlways; }
311 BOOL IsMoveOnlyDragging() const { Init(); return (BOOL) bMoveOnlyDragging; }
312 BOOL IsCrookNoContortion() const { Init(); return (BOOL) bCrookNoContortion; }
313 BOOL IsQuickEdit() const { Init(); return (BOOL) bQuickEdit; }
314 BOOL IsMasterPagePaintCaching() const { Init(); return (BOOL) bMasterPageCache; }
315 BOOL IsDragWithCopy() const { Init(); return (BOOL) bDragWithCopy; }
316 BOOL IsPickThrough() const { Init(); return (BOOL) bPickThrough; }
317 BOOL IsBigHandles() const { Init(); return (BOOL) bBigHandles; }
318 BOOL IsDoubleClickTextEdit() const { Init(); return (BOOL) bDoubleClickTextEdit; }
319 BOOL IsClickChangeRotation() const { Init(); return (BOOL) bClickChangeRotation; }
320 BOOL IsStartWithActualPage() const { Init(); return (BOOL) bStartWithActualPage; }
321 BOOL IsSolidDragging() const { Init(); return (BOOL) bSolidDragging; }
322 BOOL IsSolidMarkHdl() const { Init(); return (BOOL) bSolidMarkHdl; }
323 BOOL IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs != 0; };
325 /** Return the currently selected printer independent layout mode.
326 @return
327 Returns 1 for printer independent layout enabled and 0 when it
328 is disabled. Other values are reserved for future use.
330 USHORT GetPrinterIndependentLayout() const { Init(); return mnPrinterIndependentLayout; };
331 // #90356#
332 BOOL IsShowUndoDeleteWarning() const { Init(); return (BOOL) bShowUndoDeleteWarning; }
333 BOOL IsSlideshowRespectZOrder() const { Init(); return (BOOL) bSlideshowRespectZOrder; }
334 // #97016#
335 ULONG GetDefaultObjectSizeWidth() const { Init(); return nDefaultObjectSizeWidth; }
336 ULONG GetDefaultObjectSizeHeight() const { Init(); return nDefaultObjectSizeHeight; }
338 sal_Bool IsPreviewNewEffects() const { Init(); return bPreviewNewEffects; }
339 sal_Bool IsPreviewChangedEffects() const { Init(); return bPreviewChangedEffects; }
340 sal_Bool IsPreviewTransitions() const { Init(); return bPreviewTransitions; }
342 sal_Int32 GetDisplay() const { Init(); return mnDisplay; }
343 void SetDisplay( sal_Int32 nDisplay = 0 ) { if( mnDisplay != nDisplay ) { OptionsChanged(); mnDisplay = nDisplay; } }
345 void SetStartWithTemplate( BOOL bOn = TRUE ) { if( bStartWithTemplate != bOn ) { OptionsChanged(); bStartWithTemplate = bOn; } }
346 void SetMarkedHitMovesAlways( BOOL bOn = TRUE ) { if( bMarkedHitMovesAlways != bOn ) { OptionsChanged(); bMarkedHitMovesAlways = bOn; } }
347 void SetMoveOnlyDragging( BOOL bOn = TRUE ) { if( bMoveOnlyDragging != bOn ) { OptionsChanged(); bMoveOnlyDragging = bOn; } }
348 void SetCrookNoContortion( BOOL bOn = TRUE ) { if( bCrookNoContortion != bOn ) { OptionsChanged(); bCrookNoContortion = bOn; } }
349 void SetQuickEdit( BOOL bOn = TRUE ) { if( bQuickEdit != bOn ) { OptionsChanged(); bQuickEdit = bOn; } }
350 void SetMasterPagePaintCaching( BOOL bOn = TRUE ) { if( bMasterPageCache != bOn ) { OptionsChanged(); bMasterPageCache = bOn; } }
351 void SetDragWithCopy( BOOL bOn = TRUE ) { if( bDragWithCopy != bOn ) { OptionsChanged(); bDragWithCopy = bOn; } }
352 void SetPickThrough( BOOL bOn = TRUE ) { if( bPickThrough != bOn ) { OptionsChanged(); bPickThrough = bOn; } }
353 void SetBigHandles( BOOL bOn = TRUE ) { if( bBigHandles != bOn ) { OptionsChanged(); bBigHandles = bOn; } }
354 void SetDoubleClickTextEdit( BOOL bOn = TRUE ) { if( bDoubleClickTextEdit != bOn ) { OptionsChanged(); bDoubleClickTextEdit = bOn; } }
355 void SetClickChangeRotation( BOOL bOn = TRUE ) { if( bClickChangeRotation != bOn ) { OptionsChanged(); bClickChangeRotation = bOn; } }
356 void SetStartWithActualPage( BOOL bOn = TRUE ) { if( bStartWithActualPage != bOn ) { OptionsChanged(); bStartWithActualPage = bOn; } }
357 void SetSummationOfParagraphs( BOOL bOn = TRUE ){ if ( bOn != bSummationOfParagraphs ) { OptionsChanged(); bSummationOfParagraphs = bOn; } }
358 /** Set the printer independent layout mode.
359 @param nOn
360 The default value is to switch printer independent layout on,
361 hence the parameters name. Use 0 for turning it off. Other
362 values are reserved for future use.
364 void SetPrinterIndependentLayout (USHORT nOn = 1 ){ if ( nOn != mnPrinterIndependentLayout ) { OptionsChanged(); mnPrinterIndependentLayout = nOn; } }
365 void SetSolidDragging( BOOL bOn = TRUE ) { if( bSolidDragging != bOn ) { OptionsChanged(); bSolidDragging = bOn; } }
366 void SetSolidMarkHdl( BOOL bOn = TRUE ) { if( bSolidMarkHdl != bOn ) { OptionsChanged(); bSolidMarkHdl = bOn; } }
367 // #90356#
368 void SetShowUndoDeleteWarning( BOOL bOn = TRUE ) { if( bShowUndoDeleteWarning != bOn ) { OptionsChanged(); bShowUndoDeleteWarning = bOn; } }
369 void SetSlideshowRespectZOrder( BOOL bOn = TRUE ) { if( bSlideshowRespectZOrder != bOn ) { OptionsChanged(); bSlideshowRespectZOrder = bOn; } }
370 // #97016#
371 void SetDefaultObjectSizeWidth( ULONG nWidth ) { if( nDefaultObjectSizeWidth != nWidth ) { OptionsChanged(); nDefaultObjectSizeWidth = nWidth; } }
372 void SetDefaultObjectSizeHeight( ULONG nHeight ) { if( nDefaultObjectSizeHeight != nHeight ) { OptionsChanged(); nDefaultObjectSizeHeight = nHeight; } }
374 void SetPreviewNewEffects( sal_Bool bOn ) { if( bPreviewNewEffects != bOn ) { OptionsChanged(); bPreviewNewEffects = bOn; } }
375 void SetPreviewChangedEffects( sal_Bool bOn ) { if( bPreviewChangedEffects != bOn ) { OptionsChanged(); bPreviewChangedEffects = bOn; } }
376 void SetPreviewTransitions( sal_Bool bOn ) { if( bPreviewTransitions != bOn ) { OptionsChanged(); bPreviewTransitions = bOn; } }
378 BOOL IsShowComments() const { Init(); return bShowComments; }
379 void SetShowComments( BOOL bShow ) { if( bShowComments != bShow ) { OptionsChanged(); bShowComments = bShow; } }
382 // -----------------------------------------------------------------------------
384 class SD_DLLPUBLIC SdOptionsMiscItem : public SfxPoolItem
386 public:
388 SdOptionsMiscItem( USHORT nWhich);
389 SdOptionsMiscItem( USHORT nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
391 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
392 virtual int operator==( const SfxPoolItem& ) const;
394 void SetOptions( SdOptions* pOpts ) const;
396 SdOptionsMisc& GetOptionsMisc() { return maOptionsMisc; }
397 const SdOptionsMisc& GetOptionsMisc() const { return maOptionsMisc; }
398 private:
399 SdOptionsMisc maOptionsMisc;
402 // -----------------
403 // - SdOptionsSnap -
404 // -----------------
406 class SD_DLLPUBLIC SdOptionsSnap : public SdOptionsGeneric
408 private:
410 BOOL bSnapHelplines : 1; // Snap/Object/SnapLine
411 BOOL bSnapBorder : 1; // Snap/Object/PageMargin
412 BOOL bSnapFrame : 1; // Snap/Object/ObjectFrame
413 BOOL bSnapPoints : 1; // Snap/Object/ObjectPoint
414 BOOL bOrtho : 1; // Snap/Position/CreatingMoving
415 BOOL bBigOrtho : 1; // Snap/Position/ExtendEdges
416 BOOL bRotate : 1; // Snap/Position/Rotating
417 INT16 nSnapArea; // Snap/Object/Range
418 INT16 nAngle; // Snap/Position/RotatingValue
419 INT16 nBezAngle; // Snap/Position/PointReduction
421 protected:
423 virtual void GetPropNameArray( const char**& ppNames, ULONG& rCount ) const;
424 virtual BOOL ReadData( const ::com::sun::star::uno::Any* pValues );
425 virtual BOOL WriteData( ::com::sun::star::uno::Any* pValues ) const;
427 public:
429 SdOptionsSnap( USHORT nConfigId, BOOL bUseConfig );
430 virtual ~SdOptionsSnap() {}
432 void SetDefaults();
433 BOOL operator==( const SdOptionsSnap& rOpt ) const;
435 BOOL IsSnapHelplines() const { Init(); return (BOOL) bSnapHelplines; }
436 BOOL IsSnapBorder() const { Init(); return (BOOL) bSnapBorder; }
437 BOOL IsSnapFrame() const { Init(); return (BOOL) bSnapFrame; }
438 BOOL IsSnapPoints() const { Init(); return (BOOL) bSnapPoints; }
439 BOOL IsOrtho() const { Init(); return (BOOL) bOrtho; }
440 BOOL IsBigOrtho() const { Init(); return (BOOL) bBigOrtho; }
441 BOOL IsRotate() const { Init(); return (BOOL) bRotate; }
442 INT16 GetSnapArea() const { Init(); return nSnapArea; }
443 INT16 GetAngle() const { Init(); return nAngle; }
444 INT16 GetEliminatePolyPointLimitAngle() const { Init(); return nBezAngle; }
446 void SetSnapHelplines( BOOL bOn = TRUE ) { if( bSnapHelplines != bOn ) { OptionsChanged(); bSnapHelplines = bOn; } }
447 void SetSnapBorder( BOOL bOn = TRUE ) { if( bSnapBorder != bOn ) { OptionsChanged(); bSnapBorder = bOn; } }
448 void SetSnapFrame( BOOL bOn = TRUE ) { if( bSnapFrame != bOn ) { OptionsChanged(); bSnapFrame = bOn; } }
449 void SetSnapPoints( BOOL bOn = TRUE ) { if( bSnapPoints != bOn ) { OptionsChanged(); bSnapPoints = bOn; } }
450 void SetOrtho( BOOL bOn = TRUE ) { if( bOrtho != bOn ) { OptionsChanged(); bOrtho = bOn; } }
451 void SetBigOrtho( BOOL bOn = TRUE ) { if( bBigOrtho != bOn ) { OptionsChanged(); bBigOrtho = bOn; } }
452 void SetRotate( BOOL bOn = TRUE ) { if( bRotate != bOn ) { OptionsChanged(); bRotate = bOn; } }
453 void SetSnapArea( INT16 nIn ) { if( nSnapArea != nIn ) { OptionsChanged(); nSnapArea = nIn; } }
454 void SetAngle( INT16 nIn ) { if( nAngle != nIn ) { OptionsChanged(); nAngle = nIn; } }
455 void SetEliminatePolyPointLimitAngle( INT16 nIn ) { if( nBezAngle != nIn ) { OptionsChanged(); nBezAngle = nIn; } }
458 // -----------------------------------------------------------------------------
460 class SD_DLLPUBLIC SdOptionsSnapItem : public SfxPoolItem
462 public:
464 SdOptionsSnapItem( USHORT nWhich);
465 SdOptionsSnapItem( USHORT nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
467 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
468 virtual int operator==( const SfxPoolItem& ) const;
470 void SetOptions( SdOptions* pOpts ) const;
472 SdOptionsSnap& GetOptionsSnap() { return maOptionsSnap; }
473 private:
474 SdOptionsSnap maOptionsSnap;
477 // -----------------
478 // - SdOptionsZoom -
479 // -----------------
481 class SdOptionsZoom : public SdOptionsGeneric
483 private:
485 INT32 nX; // Zoom/ScaleX
486 INT32 nY; // Zoom/ScaleY
488 protected:
490 virtual void GetPropNameArray( const char**& ppNames, ULONG& rCount ) const;
491 virtual BOOL ReadData( const ::com::sun::star::uno::Any* pValues );
492 virtual BOOL WriteData( ::com::sun::star::uno::Any* pValues ) const;
494 public:
496 SdOptionsZoom( USHORT nConfigId, BOOL bUseConfig );
497 virtual ~SdOptionsZoom() {}
499 void SetDefaults();
500 BOOL operator==( const SdOptionsZoom& rOpt ) const;
502 void GetScale( INT32& rX, INT32& rY ) const { Init(); rX = nX; rY = nY; }
503 void SetScale( INT32 nInX, INT32 nInY ) { if( nX != nInX || nY != nInY ) { OptionsChanged(); nX = nInX; nY = nInY; } }
506 // -----------------------------------------------------------------------------
508 class SdOptionsZoomItem : public SfxPoolItem
510 public:
512 SdOptionsZoomItem( USHORT nWhich);
513 SdOptionsZoomItem( USHORT nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
515 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
516 virtual int operator==( const SfxPoolItem& ) const;
518 void SetOptions( SdOptions* pOpts ) const;
520 SdOptionsZoom& GetOptionsZoom() { return maOptionsZoom; }
521 private:
522 SdOptionsZoom maOptionsZoom;
525 // -----------------
526 // - SdOptionsGrid -
527 // -----------------
529 class SdOptionsGrid : public SdOptionsGeneric, public SvxOptionsGrid
531 protected:
533 virtual void GetPropNameArray( const char**& ppNames, ULONG& rCount ) const;
534 virtual BOOL ReadData( const ::com::sun::star::uno::Any* pValues );
535 virtual BOOL WriteData( ::com::sun::star::uno::Any* pValues ) const;
537 public:
539 SdOptionsGrid( USHORT nConfigId, BOOL bUseConfig );
540 virtual ~SdOptionsGrid();
542 void SetDefaults();
543 BOOL operator==( const SdOptionsGrid& rOpt ) const;
545 UINT32 GetFldDrawX() const { Init(); return SvxOptionsGrid::GetFldDrawX(); }
546 UINT32 GetFldDivisionX() const { Init(); return SvxOptionsGrid::GetFldDivisionX(); }
547 UINT32 GetFldDrawY() const { Init(); return SvxOptionsGrid::GetFldDrawY(); }
548 UINT32 GetFldDivisionY() const { Init(); return SvxOptionsGrid::GetFldDivisionY(); }
549 UINT32 GetFldSnapX() const { Init(); return SvxOptionsGrid::GetFldSnapX(); }
550 UINT32 GetFldSnapY() const { Init(); return SvxOptionsGrid::GetFldSnapY(); }
551 BOOL IsUseGridSnap() const { Init(); return SvxOptionsGrid::GetUseGridSnap(); }
552 BOOL IsSynchronize() const { Init(); return SvxOptionsGrid::GetSynchronize(); }
553 BOOL IsGridVisible() const { Init(); return SvxOptionsGrid::GetGridVisible(); }
554 BOOL IsEqualGrid() const { Init(); return SvxOptionsGrid::GetEqualGrid(); }
556 void SetFldDrawX( UINT32 nSet ) { if( nSet != SvxOptionsGrid::GetFldDrawX() ) { OptionsChanged(); SvxOptionsGrid::SetFldDrawX( nSet ); } }
557 void SetFldDivisionX( UINT32 nSet ) { if( nSet != SvxOptionsGrid::GetFldDivisionX() ) { OptionsChanged(); SvxOptionsGrid::SetFldDivisionX( nSet ); } }
558 void SetFldDrawY( UINT32 nSet ) { if( nSet != SvxOptionsGrid::GetFldDrawY() ) { OptionsChanged(); SvxOptionsGrid::SetFldDrawY( nSet ); } }
559 void SetFldDivisionY( UINT32 nSet ) { if( nSet != SvxOptionsGrid::GetFldDivisionY() ) { OptionsChanged(); SvxOptionsGrid::SetFldDivisionY( nSet ); } }
560 void SetFldSnapX( UINT32 nSet ) { if( nSet != SvxOptionsGrid::GetFldSnapX() ) { OptionsChanged(); SvxOptionsGrid::SetFldSnapX( nSet ); } }
561 void SetFldSnapY( UINT32 nSet ) { if( nSet != SvxOptionsGrid::GetFldSnapY() ) { OptionsChanged(); SvxOptionsGrid::SetFldSnapY( nSet ); } }
562 void SetUseGridSnap( BOOL bSet ) { if( bSet != SvxOptionsGrid::GetUseGridSnap() ) { OptionsChanged(); SvxOptionsGrid::SetUseGridSnap( bSet ); } }
563 void SetSynchronize( BOOL bSet ) { if( bSet != SvxOptionsGrid::GetSynchronize() ) { OptionsChanged(); SvxOptionsGrid::SetSynchronize( bSet ); } }
564 void SetGridVisible( BOOL bSet ) { if( bSet != SvxOptionsGrid::GetGridVisible() ) { OptionsChanged(); SvxOptionsGrid::SetGridVisible( bSet ); } }
565 void SetEqualGrid( BOOL bSet ) { if( bSet != SvxOptionsGrid::GetEqualGrid() ) { OptionsChanged(); SvxOptionsGrid::SetEqualGrid( bSet ); } }
568 // -----------------------------------------------
570 class SdOptionsGridItem : public SvxGridItem
573 public:
574 SdOptionsGridItem( USHORT nWhich );
575 SdOptionsGridItem( USHORT nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
577 void SetOptions( SdOptions* pOpts ) const;
580 // ------------------
581 // - SdOptionsPrint -
582 // ------------------
584 class SD_DLLPUBLIC SdOptionsPrint : public SdOptionsGeneric
586 private:
588 BOOL bDraw : 1; // Print/Content/Drawing
589 BOOL bNotes : 1; // Print/Content/Note
590 BOOL bHandout : 1; // Print/Content/Handout
591 BOOL bOutline : 1; // Print/Content/Outline
592 BOOL bDate : 1; // Print/Other/Date
593 BOOL bTime : 1; // Print/Other/Time
594 BOOL bPagename : 1; // Print/Other/PageName
595 BOOL bHiddenPages : 1; // Print/Other/HiddenPage
596 BOOL bPagesize : 1; // Print/Page/PageSize
597 BOOL bPagetile : 1; // Print/Page/PageTile
598 BOOL bWarningPrinter : 1; // These flags you get
599 BOOL bWarningSize : 1; // from the common options,
600 BOOL bWarningOrientation : 1; // currently org.openoffice.Office.Common.xml (class OfaMiscCfg ; sfx2/misccfg.hxx )
601 BOOL bBooklet : 1; // Print/Page/Booklet
602 BOOL bFront : 1; // Print/Page/BookletFront
603 BOOL bBack : 1; // Print/Page/BookletFront
604 BOOL bCutPage : 1; // NOT persistent !!!
605 BOOL bPaperbin : 1; // Print/Other/FromPrinterSetup
606 BOOL mbHandoutHorizontal : 1; // Order Page previews on Handout Pages horizontal
607 UINT16 mnHandoutPages; // Number of page previews on handout page (only 1/2/4/6/9 are supported)
608 UINT16 nQuality; // Print/Other/Quality
610 protected:
612 virtual void GetPropNameArray( const char**& ppNames, ULONG& rCount ) const;
613 virtual BOOL ReadData( const ::com::sun::star::uno::Any* pValues );
614 virtual BOOL WriteData( ::com::sun::star::uno::Any* pValues ) const;
616 public:
618 SdOptionsPrint( USHORT nConfigId, BOOL bUseConfig );
619 virtual ~SdOptionsPrint() {}
621 void SetPrinterOptions( const SdOptionsPrint* pOptions );
623 void SetDefaults();
624 BOOL operator==( const SdOptionsPrint& rOpt ) const;
626 BOOL IsDraw() const { Init(); return (BOOL) bDraw; }
627 BOOL IsNotes() const { Init(); return (BOOL) bNotes; }
628 BOOL IsHandout() const { Init(); return (BOOL) bHandout; }
629 BOOL IsOutline() const { Init(); return (BOOL) bOutline; }
630 BOOL IsDate() const { Init(); return (BOOL) bDate; }
631 BOOL IsTime() const { Init(); return (BOOL) bTime; }
632 BOOL IsPagename() const { Init(); return (BOOL) bPagename; }
633 BOOL IsHiddenPages() const { Init(); return (BOOL) bHiddenPages; }
634 BOOL IsPagesize() const { Init(); return (BOOL) bPagesize; }
635 BOOL IsPagetile() const { Init(); return (BOOL) bPagetile; }
636 BOOL IsWarningPrinter() const { Init(); return (BOOL) bWarningPrinter; }
637 BOOL IsWarningSize() const { Init(); return (BOOL) bWarningSize; }
638 BOOL IsWarningOrientation() const { Init(); return (BOOL) bWarningOrientation; }
639 BOOL IsBooklet() const { Init(); return (BOOL) bBooklet; }
640 BOOL IsFrontPage() const { Init(); return (BOOL) bFront; }
641 BOOL IsBackPage() const { Init(); return (BOOL) bBack; }
642 BOOL IsCutPage() const { Init(); return (BOOL) bCutPage; }
643 BOOL IsPaperbin() const { Init(); return (BOOL) bPaperbin; }
644 UINT16 GetOutputQuality() const { Init(); return nQuality; }
645 BOOL IsHandoutHorizontal() const { Init(); return mbHandoutHorizontal; }
646 UINT16 GetHandoutPages() const { Init(); return mnHandoutPages; }
648 void SetDraw( BOOL bOn = TRUE ) { if( bDraw != bOn ) { OptionsChanged(); bDraw = bOn; } }
649 void SetNotes( BOOL bOn = TRUE ) { if( bNotes != bOn ) { OptionsChanged(); bNotes = bOn; } }
650 void SetHandout( BOOL bOn = TRUE ) { if( bHandout != bOn ) { OptionsChanged(); bHandout = bOn; } }
651 void SetOutline( BOOL bOn = TRUE ) { if( bOutline != bOn ) { OptionsChanged(); bOutline = bOn; } }
652 void SetDate( BOOL bOn = TRUE ) { if( bDate != bOn ) { OptionsChanged(); bDate = bOn; } }
653 void SetTime( BOOL bOn = TRUE ) { if( bTime != bOn ) { OptionsChanged(); bTime = bOn; } }
654 void SetPagename( BOOL bOn = TRUE ) { if( bPagename != bOn ) { OptionsChanged(); bPagename = bOn; } }
655 void SetHiddenPages( BOOL bOn = TRUE ) { if( bHiddenPages != bOn ) { OptionsChanged(); bHiddenPages = bOn; } }
656 void SetPagesize( BOOL bOn = TRUE ) { if( bPagesize != bOn ) { OptionsChanged(); bPagesize = bOn; } }
657 void SetPagetile( BOOL bOn = TRUE ) { if( bPagetile != bOn ) { OptionsChanged(); bPagetile = bOn; } }
658 void SetWarningPrinter( BOOL bOn = TRUE ) { if( bWarningPrinter != bOn ) { OptionsChanged(); bWarningPrinter = bOn; } }
659 void SetWarningSize( BOOL bOn = TRUE ) { if( bWarningSize != bOn ) { OptionsChanged(); bWarningSize = bOn; } }
660 void SetWarningOrientation( BOOL bOn = TRUE ) { if( bWarningOrientation != bOn ) { OptionsChanged(); bWarningOrientation = bOn; } }
661 void SetBooklet( BOOL bOn = TRUE ) { if( bBooklet != bOn ) { OptionsChanged(); bBooklet = bOn; } }
662 void SetFrontPage( BOOL bOn = TRUE ) { if( bFront != bOn ) { OptionsChanged(); bFront = bOn; } }
663 void SetBackPage( BOOL bOn = TRUE ) { if( bBack != bOn ) { OptionsChanged(); bBack = bOn; } }
664 void SetCutPage( BOOL bOn = TRUE ) { if( bCutPage != bOn ) { OptionsChanged(); bCutPage = bOn; } }
665 void SetPaperbin( BOOL bOn = TRUE ) { if( bPaperbin != bOn ) { OptionsChanged(); bPaperbin = bOn; } }
666 void SetOutputQuality( UINT16 nInQuality ) { if( nQuality != nInQuality ) { OptionsChanged(); nQuality = nInQuality; } }
667 void SetHandoutHorizontal( BOOL bHandoutHorizontal ) { if( mbHandoutHorizontal != bHandoutHorizontal ) { OptionsChanged(); mbHandoutHorizontal = bHandoutHorizontal; } }
668 void SetHandoutPages( UINT16 nHandoutPages ) { if( nHandoutPages != mnHandoutPages ) { OptionsChanged(); mnHandoutPages = nHandoutPages; } }
671 // -----------------------------------------------------------------------------
673 class SD_DLLPUBLIC SdOptionsPrintItem : public SfxPoolItem
675 public:
677 SdOptionsPrintItem( USHORT nWhich);
678 SdOptionsPrintItem( USHORT nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
680 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
681 virtual int operator==( const SfxPoolItem& ) const;
683 void SetOptions( SdOptions* pOpts ) const;
685 SdOptionsPrint& GetOptionsPrint() { return maOptionsPrint; }
686 const SdOptionsPrint& GetOptionsPrint() const { return maOptionsPrint; }
687 private:
688 SdOptionsPrint maOptionsPrint;
691 // -------------
692 // - SdOptions -
693 // -------------
695 class SdOptions : public SdOptionsLayout, public SdOptionsContents,
696 public SdOptionsMisc, public SdOptionsSnap,
697 public SdOptionsZoom, public SdOptionsGrid,
698 public SdOptionsPrint
700 public:
702 SdOptions( USHORT nConfigId );
703 virtual ~SdOptions();
705 void SetRangeDefaults( ULONG nOptionRange );
706 void StoreConfig( ULONG nOptionRange = SD_OPTIONS_ALL );
709 #endif // _SD_OPTSITEM_HXX