1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _SVDPNTV_HXX 29 #define _SVDPNTV_HXX 30 31 #include <svl/brdcst.hxx> 32 #include <svl/lstner.hxx> 33 #include <svl/smplhint.hxx> 34 #include <svl/undo.hxx> 35 #include <svx/svddrag.hxx> 36 #include <svx/svdlayer.hxx> // fuer SetOfByte 37 #include <vcl/window.hxx> 38 #include <svtools/colorcfg.hxx> 39 #include <com/sun/star/awt/XControlContainer.hpp> 40 #include <svl/itemset.hxx> 41 #include <vcl/timer.hxx> 42 #include "svx/svxdllapi.h" 43 #include <svtools/optionsdrawinglayer.hxx> 44 #include <unotools/options.hxx> 45 46 //************************************************************ 47 // Pre-Defines 48 //************************************************************ 49 50 class SdrPageWindow; 51 52 namespace com { namespace sun { namespace star { namespace awt { 53 class XControlContainer; 54 }}}} 55 56 class SdrPage; 57 class SdrView; 58 class SfxItemSet; 59 class SfxStyleSheet; 60 class SdrOle2Obj; 61 class SdrModel; 62 class SdrObject; 63 class SdrViewUserMarker; 64 class B2dIAOManager; 65 66 #ifdef DBG_UTIL 67 class SdrItemBrowser; 68 #endif 69 70 namespace sdr { namespace contact { 71 class ViewObjectContactRedirector; 72 }} 73 74 //************************************************************ 75 // Defines for AnimationMode 76 //************************************************************ 77 78 enum SdrAnimationMode 79 { 80 SDR_ANIMATION_ANIMATE, 81 SDR_ANIMATION_DONT_ANIMATE, 82 SDR_ANIMATION_DISABLE 83 }; 84 85 //************************************************************ 86 // Typedef's und defines 87 //************************************************************ 88 89 typedef unsigned char TRISTATE; 90 #define FUZZY (2) 91 #define SDR_ANYFORMAT (0xFFFFFFFF) 92 #define SDR_ANYITEM (0xFFFF) 93 #define SDRVIEWWIN_NOTFOUND (0xFFFF) 94 95 96 //////////////////////////////////////////////////////////////////////////////////////////////////// 97 class SdrPaintView; 98 99 namespace sdr 100 { 101 namespace contact 102 { 103 class ViewObjectContactRedirector; 104 } // end of namespace contact 105 } // end of namespace sdr 106 107 //////////////////////////////////////////////////////////////////////////////////////////////////// 108 109 110 class SVX_DLLPUBLIC SvxViewHint : public SfxHint 111 { 112 public: 113 enum HintType { SVX_HINT_VIEWCHANGED }; 114 TYPEINFO(); 115 SvxViewHint (HintType eType); 116 HintType GetHintType (void) const; 117 118 private: 119 HintType meHintType; 120 }; 121 122 // typedefs for a list of SdrPaintWindows 123 class SdrPaintWindow; 124 typedef ::std::vector< SdrPaintWindow* > SdrPaintWindowVector; 125 126 //////////////////////////////////////////////////////////////////////////////////////////////////// 127 128 class SVX_DLLPUBLIC SdrPaintView : public SfxListener, public SfxRepeatTarget, public SfxBroadcaster, public ::utl::ConfigurationListener 129 { 130 friend class SdrPageView; 131 friend class FrameAnimator; 132 friend class SdrGrafObj; 133 134 protected: 135 // #114409#-2 Migrate Encirclement 136 class ImplEncirclementOverlay* mpEncirclementOverlay; 137 138 SdrModel* pMod; 139 #ifdef DBG_UTIL 140 SdrItemBrowser* pItemBrowser; 141 #endif 142 const OutputDevice* pActualOutDev; // Nur zum vergleichen 143 OutputDevice* pDragWin; 144 SfxStyleSheet* pDefaultStyleSheet; 145 146 String aAktLayer; // Aktueller Zeichenlayer 147 String aMeasureLayer; // Aktueller Layer fuer Bemassung 148 149 // Container aPagV; // Liste von SdrPageViews 150 SdrPageView* mpPageView; 151 152 // All windows this view is displayed on 153 SdrPaintWindowVector maPaintWindows; 154 155 MapMode aActualMapMode; 156 Size aGridBig; // muss dann mal raus 157 Size aGridFin; // muss dann mal raus 158 SdrDragStat aDragStat; 159 Rectangle aMaxWorkArea; 160 SfxItemSet aDefaultAttr; 161 Timer aComeBackTimer; 162 163 SdrAnimationMode eAnimationMode; 164 165 sal_uInt16 nHitTolPix; 166 sal_uInt16 nMinMovPix; 167 sal_uInt16 nHitTolLog; 168 sal_uInt16 nMinMovLog; 169 sal_uIntPtr nMasterCacheMode; 170 sal_uIntPtr nGraphicManagerDrawMode; 171 172 // hold an incarnation of Drawinglayer configuration options 173 SvtOptionsDrawinglayer maDrawinglayerOpt; 174 175 unsigned bPageVisible : 1; 176 unsigned bPageBorderVisible : 1; 177 unsigned bBordVisible : 1; 178 unsigned bGridVisible : 1; 179 unsigned bGridFront : 1; 180 unsigned bHlplVisible : 1; 181 unsigned bHlplFront : 1; 182 unsigned bGlueVisible : 1; // Persistent. Klebepunkte anzeigen 183 unsigned bGlueVisible2 : 1; // Klebepunkte auch bei GluePointEdit anzeigen 184 unsigned bGlueVisible3 : 1; // Klebepunkte auch bei EdgeTool anzeigen 185 unsigned bGlueVisible4 : 1; // Klebepunkte anzeigen, wenn 1 Edge markiert 186 unsigned bRestoreColors : 1; // Pens und Brushes werden zurueckgesetzt. 187 unsigned bSomeObjChgdFlag : 1; 188 unsigned bSwapAsynchron : 1; 189 unsigned bPrintPreview : 1; 190 191 // sal_Bool fuer die Verwaltung des anzuzeigenden Status 192 // Gruppe Betreten/Verlassen. Default ist sal_True, wird aber 193 // beispielsweise beim Chart auf sal_False gesetzt, da dort 194 // die Ghosted-Effekte zur Darstellug unerwuenscht sind. 195 unsigned bVisualizeEnteredGroup : 1; 196 unsigned bAnimationPause : 1; 197 198 // #114898# 199 // Flag which decides if buffered output for this view is allowed. When 200 // set, PreRendering for PageView rendering will be used. Default is sal_False 201 unsigned mbBufferedOutputAllowed : 1; 202 203 // #114898# 204 // Flag which decides if buffered overlay for this view is allowed. When 205 // set, the output will be buffered in an overlay vdev. When not, overlay is 206 // directly painted to OutDev. Default is sal_False. 207 unsigned mbBufferedOverlayAllowed : 1; 208 209 // allow page painting at all? 210 unsigned mbPagePaintingAllowed : 1; 211 212 // is this a preview renderer? 213 unsigned mbPreviewRenderer : 1; 214 215 // flags for calc and sw for suppressing OLE, CHART or DRAW objects 216 unsigned mbHideOle : 1; 217 unsigned mbHideChart : 1; 218 unsigned mbHideDraw : 1; // hide draw objects other than form controls 219 unsigned mbHideFormControl : 1; // hide form controls only 220 221 public: 222 // #114898# 223 // interface for PagePaintingAllowed flag 224 bool IsBufferedOutputAllowed() const; 225 void SetBufferedOutputAllowed(bool bNew); 226 227 // interface for BufferedOverlayAllowed flag 228 bool IsBufferedOverlayAllowed() const; 229 void SetBufferedOverlayAllowed(bool bNew); 230 231 // allow page painting at all? 232 sal_Bool IsPagePaintingAllowed() const; 233 void SetPagePaintingAllowed(bool bNew); 234 235 protected: 236 svtools::ColorConfig maColorConfig; 237 Color maGridColor; 238 239 // interface to SdrPaintWindow 240 protected: 241 void AppendPaintWindow(SdrPaintWindow& rNew); 242 SdrPaintWindow* RemovePaintWindow(SdrPaintWindow& rOld); 243 void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, sal_uInt32 ); 244 245 public: 246 sal_uInt32 PaintWindowCount() const { return maPaintWindows.size(); } 247 SdrPaintWindow* FindPaintWindow(const OutputDevice& rOut) const; 248 SdrPaintWindow* GetPaintWindow(sal_uInt32 nIndex) const; 249 // replacement for GetWin(0), may return 0L (!) 250 OutputDevice* GetFirstOutputDevice() const; 251 252 private: 253 SVX_DLLPRIVATE void ImpClearVars(); 254 DECL_LINK(ImpComeBackHdl,Timer*); 255 256 protected: 257 sal_uInt16 ImpGetMinMovLogic(short nMinMov, const OutputDevice* pOut) const; 258 sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice* pOut) const; 259 260 // Wenn man den IdleStatus des Systems nicht abwarten will (auf const geschummelt): 261 void FlushComeBackTimer() const; 262 void TheresNewMapMode(); 263 void ImpSetGlueVisible2(bool bOn) { if (bGlueVisible2!=(unsigned)bOn) { bGlueVisible2=bOn; if (!bGlueVisible && !bGlueVisible3 && !bGlueVisible4) GlueInvalidate(); } } 264 void ImpSetGlueVisible3(bool bOn) { if (bGlueVisible3!=(unsigned)bOn) { bGlueVisible3=bOn; if (!bGlueVisible && !bGlueVisible2 && !bGlueVisible4) GlueInvalidate(); } } 265 void ImpSetGlueVisible4(bool bOn) { if (bGlueVisible4!=(unsigned)bOn) { bGlueVisible4=bOn; if (!bGlueVisible && !bGlueVisible2 && !bGlueVisible3) GlueInvalidate(); } } 266 sal_Bool ImpIsGlueVisible2() const { return bGlueVisible2; } 267 sal_Bool ImpIsGlueVisible3() const { return bGlueVisible3; } 268 sal_Bool ImpIsGlueVisible4() const { return bGlueVisible4; } 269 270 public: 271 sal_Bool ImpIsGlueVisible() { return bGlueVisible || bGlueVisible2 || bGlueVisible3 || bGlueVisible4; } 272 protected: 273 274 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint); 275 void GlueInvalidate() const; 276 277 void ShowEncirclement(OutputDevice* pOut); 278 void HideEncirclement(OutputDevice* pOut); 279 void DrawEncirclement(OutputDevice* pOut) const; 280 281 // ModelHasChanged wird gerufen, sobald nach beliebig vielen HINT_OBJCHG 282 // das System wieder idle ist (StarView-Timer). Wer diese Methode ueberlaed, 283 // muss unbedingt ModelHasChanged() der Basisklasse rufen. 284 virtual void ModelHasChanged(); 285 286 protected: 287 // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView 288 SdrPaintView(SdrModel* pModel1, OutputDevice* pOut = 0L); 289 virtual ~SdrPaintView(); 290 291 public: 292 TYPEINFO(); 293 294 virtual void ClearPageView(); 295 // virtual void ClearAll(); 296 // virtual void Clear(); // PageViews loeschen, Markierungen weg, ... 297 SdrModel* GetModel() const { return pMod; } 298 299 virtual sal_Bool IsAction() const; 300 virtual void MovAction(const Point& rPnt); 301 virtual void EndAction(); 302 virtual void BckAction(); 303 virtual void BrkAction(); // Alle Actions z.B. Draggen abbrechen. 304 virtual void TakeActionRect(Rectangle& rRect) const; 305 306 // info about TextEdit. Default is sal_False. 307 virtual bool IsTextEdit() const; 308 309 // info about TextEditPageView. Default is 0L. 310 virtual SdrPageView* GetTextEditPageView() const; 311 312 // Muss dann bei jedem Fensterwechsel (wenn die SdrView in mehreren 313 // Fenstern gleichzeitig dargestellt wird (->z.B. Splitter)) und bei 314 // jedem MapMode(Scaling)-wechsel gerufen werden, damit ich aus meinen 315 // Pixelwerten logische Werte berechnen kann. 316 void SetActualWin(const OutputDevice* pWin); 317 void SetMinMoveDistancePixel(sal_uInt16 nVal) { nMinMovPix=nVal; TheresNewMapMode(); } 318 sal_uInt16 GetMinMoveDistancePixel() const { return (sal_uInt16)nMinMovPix; } 319 void SetHitTolerancePixel(sal_uInt16 nVal) { nHitTolPix=nVal; TheresNewMapMode(); } 320 sal_uInt16 GetHitTolerancePixel() const { return (sal_uInt16)nHitTolPix; } 321 322 // data read access on logic HitTolerance and MinMoveTolerance 323 sal_uInt16 getHitTolLog() const { return nHitTolLog; } 324 sal_uInt16 getMinMovLog() const { return nMinMovLog; } 325 326 // Flag zur Visualisierung von Gruppen abfragen/testen 327 sal_Bool DoVisualizeEnteredGroup() const { return bVisualizeEnteredGroup; } 328 void SetVisualizeEnteredGroup(sal_Bool bNew) { bVisualizeEnteredGroup = bNew; } 329 330 // Am DragStatus laesst sich beispielsweise erfragen, welche 331 // entfernung bereits gedraggd wurde, etc. 332 const SdrDragStat& GetDragStat() const { return aDragStat; } 333 334 // Anmelden/Abmelden einer PageView an der View. 335 // Dieselbe // Seite kann nicht mehrfach angemeldet werden. 336 // Methoden mit dem Suffix PgNum erwarten als numerischen Parameter 337 // eine Seitennummer (0...). Methoden mit dem Suffix PvNum erwarten 338 // degagen als numerischen Parameter die Nummer der PageView an der 339 // SdrView (Iterieren ueber alle angemeldeten Pages). 340 virtual SdrPageView* ShowSdrPage(SdrPage* pPage); 341 virtual void HideSdrPage(); 342 343 // Iterieren ueber alle angemeldeten PageViews 344 // sal_uInt16 GetPageViewCount() const { return sal_uInt16(aPagV.Count()); } 345 // SdrPageView* GetPageViewByIndex(sal_uInt16 nPvNum) const { return ((SdrPageView*)aPagV.GetObject(nPvNum)); } 346 SdrPageView* GetSdrPageView() const { return mpPageView; } 347 348 // Pageview einer bestimmten Seite ermitteln 349 // SdrPageView* GetPageViewByPage(const SdrPage* pPage) const; 350 // sal_uInt16 GetIndexByPageView(const SdrPageView* pPV) const; 351 352 // Test, ob eine Seite getroffen 353 // SdrPageView* HitPage(const Point& rPnt) const; 354 355 // Die Seite, die dem Punkt am naechsten ist. Liefert nur NULL, 356 // wenn absolut keine Seite angemeldet ist. 357 // SdrPageView* GetPageViewByPosition(const Point& rPnt) const; 358 359 // Eine SdrView kann auf mehreren Fenstern gleichzeitig abgebiltet sein: 360 virtual void AddWindowToPaintView(OutputDevice* pNewWin); 361 virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin); 362 363 void SetLayerVisible(const String& rName, sal_Bool bShow=sal_True); 364 bool IsLayerVisible(const String& rName) const; 365 void SetAllLayersVisible(sal_Bool bShow=sal_True); 366 367 void SetLayerLocked(const String& rName, sal_Bool bLock=sal_True); 368 bool IsLayerLocked(const String& rName) const; 369 void SetAllLayersLocked(sal_Bool bLock=sal_True); 370 371 void SetLayerPrintable(const String& rName, sal_Bool bPrn=sal_True); 372 bool IsLayerPrintable(const String& rName) const; 373 void SetAllLayersPrintable(sal_Bool bPrn=sal_True); 374 375 // PrePaint call forwarded from app windows 376 void PrePaint(); 377 378 // PostPaint call forwarded from app windows 379 void PostPaint(); 380 381 //////////////////////////////////////////////////////////////////////////////////////////////////// 382 // used internally for Draw/Impress/sch/chart2 383 virtual void CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0); 384 385 // #i72889# used from CompleteRedraw() implementation internally, added to be able to do a complete redraw in single steps 386 // 387 // BeginCompleteRedraw returns (or even creates) a SdrPaintWindow whcih shall then be used as 388 // target for paints. Since paints may be buffered, use it's GetTargetOutputDevice() method which will 389 // return the buffer in case of bufered. 390 // DoCompleteRedraw draws the DrawingLayer hierarchy then. 391 // EndCompleteRedraw does the necessary refreshes, evtl. paints text edit and overlay and evtl destroys the 392 // SdrPaintWindow again. This means: the SdrPaintWindow is no longer safe after this closing call. 393 virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut); 394 virtual void DoCompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0); 395 virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer); 396 397 //////////////////////////////////////////////////////////////////////////////////////////////////// 398 // used for the other applications basctl/sc/sw which call DrawLayer at PageViews 399 // #i74769# Interface change to use common BeginCompleteRedraw/EndCompleteRedraw 400 // #i76114# bDisableIntersect disables intersecting rReg with the Window's paint region 401 SdrPaintWindow* BeginDrawLayers(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect = false); 402 void EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer); 403 404 protected: 405 //////////////////////////////////////////////////////////////////////////////////////////////////// 406 // used to call the old PaintOutlinerView at the single PageViews. Will be replaced when the 407 // outliner will be displayed on the overlay in edit mode. 408 void ImpTextEditDrawing(SdrPaintWindow& rPaintWindow) const; 409 410 //////////////////////////////////////////////////////////////////////////////////////////////////// 411 // used to paint the form layer after the PreRender device is flushed (painted) to the window. 412 void ImpFormLayerDrawing(SdrPaintWindow& rPaintWindow) const; 413 414 public: 415 sal_Bool IsPageVisible() const { return bPageVisible; } // Seite (weisse Flaeche) malen oder nicht 416 sal_Bool IsPageBorderVisible() const { return bPageBorderVisible; } // Seite (weisse Flaeche) malen oder nicht 417 sal_Bool IsBordVisible() const { return bBordVisible; } // Seitenrandlinie malen oder nicht 418 sal_Bool IsGridVisible() const { return bGridVisible; } // Rastergitter malen oder nicht 419 sal_Bool IsGridFront() const { return bGridFront ; } // Rastergitter ueber die Objekte druebermalen oder dahinter 420 sal_Bool IsHlplVisible() const { return bHlplVisible; } // Hilfslinien der Seiten malen oder nicht 421 sal_Bool IsHlplFront() const { return bHlplFront ; } // Hilfslinie ueber die Objekte druebermalen oder dahinter 422 sal_Bool IsGlueVisible() const { return bGlueVisible; } // Konnektoren der objekte sichtbar oder nicht 423 Color GetGridColor() const; 424 void SetPageVisible(bool bOn = true) { bPageVisible=bOn; InvalidateAllWin(); } 425 void SetPageBorderVisible(bool bOn = true) { bPageBorderVisible=bOn; InvalidateAllWin(); } 426 void SetBordVisible(bool bOn = true) { bBordVisible=bOn; InvalidateAllWin(); } 427 void SetGridVisible(bool bOn = true) { bGridVisible=bOn; InvalidateAllWin(); } 428 void SetGridFront(bool bOn = true) { bGridFront =bOn; InvalidateAllWin(); } 429 void SetHlplVisible(bool bOn = true) { bHlplVisible=bOn; InvalidateAllWin(); } 430 void SetHlplFront(bool bOn = true) { bHlplFront =bOn; InvalidateAllWin(); } 431 void SetGlueVisible(bool bOn = true) { if (bGlueVisible!=(unsigned)bOn) { bGlueVisible=bOn; if (!bGlueVisible2 && !bGlueVisible3 && !bGlueVisible4) GlueInvalidate(); } } 432 void SetGridColor( Color aColor ); 433 434 sal_Bool IsPreviewRenderer() const { return (sal_Bool )mbPreviewRenderer; } 435 void SetPreviewRenderer(bool bOn) { if((unsigned)bOn != mbPreviewRenderer) { mbPreviewRenderer=bOn; }} 436 437 // access methods for calc and sw hide object modes 438 bool getHideOle() const { return mbHideOle; } 439 bool getHideChart() const { return mbHideChart; } 440 bool getHideDraw() const { return mbHideDraw; } 441 bool getHideFormControl() const { return mbHideFormControl; } 442 void setHideOle(bool bNew) { if(bNew != (bool)mbHideOle) mbHideOle = bNew; } 443 void setHideChart(bool bNew) { if(bNew != (bool)mbHideChart) mbHideChart = bNew; } 444 void setHideDraw(bool bNew) { if(bNew != (bool)mbHideDraw) mbHideDraw = bNew; } 445 void setHideFormControl(bool bNew) { if(bNew != (bool)mbHideFormControl) mbHideFormControl = bNew; } 446 447 void SetGridCoarse(const Size& rSiz) { aGridBig=rSiz; } 448 void SetGridFine(const Size& rSiz) { aGridFin=rSiz; if (aGridFin.Height()==0) aGridFin.Height()=aGridFin.Width(); if (bGridVisible) InvalidateAllWin(); } // #40479# 449 const Size& GetGridCoarse() const { return aGridBig; } 450 const Size& GetGridFine() const { return aGridFin; } 451 452 void InvalidateAllWin(); 453 void InvalidateAllWin(const Rectangle& rRect, sal_Bool bPlus1Pix=sal_False); 454 455 // Wenn die View kein Invalidate() an den Fenstern durchfuehren soll, muss 456 // man diese beiden folgenden Methoden ueberladen und entsprechend anders 457 // reagieren. 458 virtual void InvalidateOneWin(Window& rWin); 459 virtual void InvalidateOneWin(Window& rWin, const Rectangle& rRect); 460 461 void SetActiveLayer(const String& rName) { aAktLayer=rName; } 462 const String& GetActiveLayer() const { return aAktLayer; } 463 464 // Verlassen einer betretenen Objektgruppe aller sichtbaren Seiten. 465 // (wie MsDos chdir ..) 466 void LeaveOneGroup(); 467 468 // Verlassen aller betretenen Objektgruppen aller sichtbaren Seiten. 469 // (wie MsDos chdir \) 470 void LeaveAllGroup(); 471 472 // Feststellen, ob Leave sinnvoll ist. 473 bool IsGroupEntered() const; 474 475 // DefaultAttribute an der View: Neu erzeugte Objekte bekommen diese 476 // Attribute direkt nach dem Erzeugen erstmal zugewiesen. 477 void SetDefaultAttr(const SfxItemSet& rAttr, sal_Bool bReplaceAll); 478 const SfxItemSet& GetDefaultAttr() const { return aDefaultAttr; } 479 void SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr); 480 SfxStyleSheet* GetDefaultStyleSheet() const { return pDefaultStyleSheet; } 481 482 void SetNotPersistDefaultAttr(const SfxItemSet& rAttr, sal_Bool bReplaceAll); 483 void MergeNotPersistDefaultAttr(SfxItemSet& rAttr, sal_Bool bOnlyHardAttr) const; 484 485 // Aufziehen eines animierten Rechtecks fuer Applikationsspeziefische 486 // Verwendung. Alle Positionsangaben in logischen View-Koordinaten. 487 // pOut bezeichnet das OutputDevice, in das animierte Rechteck dargestellt 488 // werden soll. Wird NULL uebergeben, wird es in allen an der View 489 // angemeldeten OutputDevices gleichzeitig dargestellt. 490 void BegEncirclement(const Point& rPnt); 491 void MovEncirclement(const Point& rPnt); 492 Rectangle EndEncirclement(sal_Bool bNoJustify = sal_False); 493 void BrkEncirclement(); 494 sal_Bool IsEncirclement() const { return (0L != mpEncirclementOverlay); } 495 496 // use this mode as mode to draw all internal GraphicManager objects with 497 sal_uIntPtr GetGraphicManagerDrawMode() const { return nGraphicManagerDrawMode; } 498 void SetGraphicManagerDrawMode( sal_uIntPtr nMode ) { nGraphicManagerDrawMode = nMode; } 499 500 // SwapIn (z.B. von Grafiken) asynchron durchfuehren. Also nicht 501 // beim Paint sofort nachladen, sondern dort das Nachladen anstossen. 502 // Nach Abschluss des Nachladens wird das Objekt dann angezeigt. 503 // Hat nur z.Zt. Wirkung, wenn SwapGraphics am Model eingeschaltet ist. 504 // Default=FALSE. Flag ist nicht persistent. 505 sal_Bool IsSwapAsynchron() const { return bSwapAsynchron; } 506 void SetSwapAsynchron(sal_Bool bJa=sal_True) { bSwapAsynchron=bJa; } 507 virtual sal_Bool KeyInput(const KeyEvent& rKEvt, Window* pWin); 508 509 virtual sal_Bool MouseButtonDown(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return sal_False; } 510 virtual sal_Bool MouseButtonUp(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return sal_False; } 511 virtual sal_Bool MouseMove(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return sal_False; } 512 virtual sal_Bool Command(const CommandEvent& /*rCEvt*/, Window* /*pWin*/) { return sal_False; } 513 sal_Bool Cut(sal_uIntPtr /*nFormat*/=SDR_ANYFORMAT) { return sal_False; } 514 sal_Bool Yank(sal_uIntPtr /*nFormat*/=SDR_ANYFORMAT) { return sal_False; } 515 sal_Bool Paste(Window* /*pWin*/=NULL, sal_uIntPtr /*nFormat*/=SDR_ANYFORMAT) { return sal_False; } 516 517 /* new interface src537 */ 518 sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const; 519 520 sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll); 521 SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(sal_Bool& rOk) const; 522 sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr); 523 524 virtual void MakeVisible(const Rectangle& rRect, Window& rWin); 525 526 // Fuer PlugIn. Wird vom Paint des OLE-Obj gerufen. 527 virtual void DoConnect(SdrOle2Obj* pOleObj); 528 529 // Animation aktivieren/deaktivieren fuer ::Paint 530 // wird z.Zt. ausgewertet von SdrGrafObj, wenn in dem eine Animation steckt 531 // Das Unterbinden der automatischen Animation wird z.B. fuer die Dia-Show benoetigt 532 sal_Bool IsAnimationEnabled() const { return ( SDR_ANIMATION_ANIMATE == eAnimationMode ); } 533 void SetAnimationEnabled( sal_Bool bEnable=sal_True ); 534 535 // set/unset pause state for animations 536 bool IsAnimationPause() const { return bAnimationPause; } 537 void SetAnimationPause( bool bSet ); 538 539 // Verhalten beim Starten von Animation im Paint-Handler: 540 // 1. Animation normal starten( SDR_ANIMATION_ANIMATE ) => DEFAULT 541 // 2. Nur die Ersatzdarstellung der Animation zeichnen ( SDR_ANIMATION_DONT_ANIMATE ) 542 // 3. Nicht starten und nichts ersatzweise ausgeben ( SDR_ANIMATION_DISABLE ) 543 void SetAnimationMode( const SdrAnimationMode eMode ); 544 SdrAnimationMode GetAnimationMode() const { return eAnimationMode; } 545 546 // bei bShow=sal_False wird der Browser destruiert 547 #ifdef DBG_UTIL 548 void ShowItemBrowser(sal_Bool bShow=sal_True); 549 sal_Bool IsItemBrowserVisible() const { return pItemBrowser!=NULL && ((Window*)pItemBrowser)->IsVisible(); } 550 Window* GetItemBrowser() const { return (Window*)pItemBrowser; } 551 #endif 552 553 // Muss von App beim Scrollen usw. gerufen werden, damit ein u.U. 554 // aktives FormularControl mitverschoben werden kann 555 void VisAreaChanged(const OutputDevice* pOut=NULL); 556 void VisAreaChanged(const SdrPageWindow& rWindow); 557 558 sal_Bool IsPrintPreview() const { return bPrintPreview; } 559 void SetPrintPreview(bool bOn = true) { bPrintPreview=bOn; } 560 561 const svtools::ColorConfig& getColorConfig() const; 562 563 virtual void onChangeColorConfig(); 564 565 // #103834# Set background color for svx at SdrPageViews 566 void SetApplicationBackgroundColor(Color aBackgroundColor); 567 568 // #103911# Set document color for svx at SdrPageViews 569 void SetApplicationDocumentColor(Color aDocumentColor); 570 571 // #i38135# 572 // Sets the timer for Object animations and restarts. 573 void SetAnimationTimer(sal_uInt32 nTime); 574 575 // access to Drawinglayer configuration options 576 const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; } 577 }; 578 579 #endif //_SVDPNTV_HXX 580 581