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