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