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