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