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