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 _SVDPAGE_HXX 25 #define _SVDPAGE_HXX 26 27 #include <vcl/bitmap.hxx> 28 #include <vcl/print.hxx> 29 #include <vcl/gdimtf.hxx> 30 #include <tools/weakbase.hxx> 31 #include <cppuhelper/weakref.hxx> 32 #include <svx/svdtypes.hxx> 33 #include <svx/svdlayer.hxx> 34 #include <svx/sdrcomment.hxx> 35 #include <vector> 36 #include <svx/sdrpageuser.hxx> 37 #include <svx/sdr/contact/viewobjectcontactredirector.hxx> 38 #include <svx/sdrmasterpagedescriptor.hxx> 39 #include "svx/svxdllapi.h" 40 #include <com/sun/star/container/XIndexAccess.hpp> 41 #include <svx/svdobj.hxx> 42 #include <boost/scoped_ptr.hpp> 43 44 ////////////////////////////////////////////////////////////////////////////// 45 // predefines 46 47 namespace sdr { namespace contact { class ViewContact; }} 48 class SdrPage; 49 class SdrModel; 50 class SfxItemPool; 51 class SdrPageView; 52 class SdrLayerAdmin; 53 class SetOfByte; 54 class Color; 55 class SfxStyleSheet; 56 class SvxUnoDrawPagesAccess; 57 58 enum SdrInsertReasonKind {SDRREASON_UNKNOWN, // unbekannt 59 SDRREASON_STREAMING, // einlesen eines Doks 60 SDRREASON_UNDO, // kommt aus dem Undo 61 SDRREASON_COPY, // irgendjemand kopiert... 62 SDRREASON_VIEWCREATE, // vom Anwender interaktiv erzeugt 63 SDRREASON_VIEWCALL}; // Durch SdrView::Group(), ... 64 65 class SdrInsertReason { 66 const SdrObject* pRefObj; 67 SdrInsertReasonKind eReason; 68 public: 69 SdrInsertReason(): pRefObj(NULL),eReason(SDRREASON_UNKNOWN) {} 70 SdrInsertReason(SdrInsertReasonKind eR,const SdrObject* pO=NULL): pRefObj(pO),eReason(eR) {} 71 void SetReferenceObject(const SdrObject* pO) { pRefObj=pO; } 72 const SdrObject* GetReferenceObject() const { return pRefObj; } 73 void SetReason(SdrInsertReasonKind eR) { eReason=eR; } 74 SdrInsertReasonKind GetReason() const { return eReason; } 75 }; 76 77 ////////////////////////////////////////////////////////////////////////////// 78 // class SdrObjList 79 80 class SVX_DLLPUBLIC SdrObjList 81 { 82 private: 83 typedef ::std::vector<SdrObject*> SdrObjectContainerType; 84 SdrObjectContainerType maList; 85 86 protected: 87 friend class SdrObjListIter; 88 friend class SdrEditView; 89 SdrObjList* pUpList; // Vaterliste 90 SdrModel* pModel; // Diese Liste gehoert zu diesem Model (Layer,ItemPool,Storage). 91 SdrPage* pPage; // Page, in die Liste haengt. Kann auch this sein. 92 SdrObject* pOwnerObj; // OwnerObject, falls Liste eines GruppenObjekts. 93 Rectangle aOutRect; 94 Rectangle aSnapRect; 95 SdrObjListKind eListKind; 96 FASTBOOL bObjOrdNumsDirty; 97 FASTBOOL bRectsDirty; 98 protected: 99 virtual void RecalcRects(); 100 101 private: 102 /// simple ActionChildInserted forwarder to have it on a central place 103 void impChildInserted(SdrObject& rChild) const; 104 public: 105 TYPEINFO(); 106 SdrObjList(SdrModel* pNewModel, SdrPage* pNewPage, SdrObjList* pNewUpList=NULL); 107 SdrObjList(const SdrObjList& rSrcList); 108 virtual ~SdrObjList(); 109 // !!! Diese Methode nur fuer Leute, die ganz genau wissen was sie tun !!! 110 111 // #110094# This should not be needed (!) 112 void SetObjOrdNumsDirty() { bObjOrdNumsDirty=sal_True; } 113 // pModel, pPage, pUpList und pOwnerObj werden Zuweisungeoperator nicht veraendert! 114 void operator=(const SdrObjList& rSrcList); 115 void CopyObjects(const SdrObjList& rSrcList); 116 // alles Aufraeumen (ohne Undo) 117 void Clear(); 118 SdrObjListKind GetListKind() const { return eListKind; } 119 void SetListKind(SdrObjListKind eNewKind) { eListKind=eNewKind; } 120 SdrObjList* GetUpList() const { return pUpList; } 121 void SetUpList(SdrObjList* pNewUpList) { pUpList=pNewUpList; } 122 SdrObject* GetOwnerObj() const { return pOwnerObj; } 123 void SetOwnerObj(SdrObject* pNewOwner) { pOwnerObj=pNewOwner; } 124 virtual SdrPage* GetPage() const; 125 virtual void SetPage(SdrPage* pNewPage); 126 virtual SdrModel* GetModel() const; 127 virtual void SetModel(SdrModel* pNewModel); 128 // Neuberechnung der Objekt-Ordnungsnummern 129 void RecalcObjOrdNums(); 130 FASTBOOL IsObjOrdNumsDirty() const { return bObjOrdNumsDirty; } 131 virtual void NbcInsertObject(SdrObject* pObj, sal_uIntPtr nPos=CONTAINER_APPEND 132 , const SdrInsertReason* pReason=NULL 133 ); 134 virtual void InsertObject(SdrObject* pObj, sal_uIntPtr nPos=CONTAINER_APPEND 135 , const SdrInsertReason* pReason=NULL 136 ); 137 // aus Liste entfernen ohne delete 138 virtual SdrObject* NbcRemoveObject(sal_uIntPtr nObjNum); 139 virtual SdrObject* RemoveObject(sal_uIntPtr nObjNum); 140 // Vorhandenes Objekt durch ein anderes ersetzen. 141 // Wie Remove&Insert jedoch performanter, da die Ordnungsnummern 142 // nicht Dirty gesetzt werden muessen. 143 virtual SdrObject* NbcReplaceObject(SdrObject* pNewObj, sal_uIntPtr nObjNum); 144 virtual SdrObject* ReplaceObject(SdrObject* pNewObj, sal_uIntPtr nObjNum); 145 // Die Z-Order eines Objekts veraendern 146 virtual SdrObject* NbcSetObjectOrdNum(sal_uIntPtr nOldObjNum, sal_uIntPtr nNewObjNum); 147 virtual SdrObject* SetObjectOrdNum(sal_uIntPtr nOldObjNum, sal_uIntPtr nNewObjNum); 148 149 virtual void SetRectsDirty(); 150 151 const Rectangle& GetAllObjSnapRect() const; 152 const Rectangle& GetAllObjBoundRect() const; 153 154 // Alle Textobjekte neu formatieren, z.B. bei Druckerwechsel 155 void NbcReformatAllTextObjects(); 156 void ReformatAllTextObjects(); 157 158 /** #103122# reformats all edge objects that are connected to other objects */ 159 void ReformatAllEdgeObjects(); 160 161 // Die Vorlagenattribute der Zeichenobjekte in harte Attribute verwandeln. 162 void BurnInStyleSheetAttributes(); 163 164 sal_uIntPtr GetObjCount() const; 165 SdrObject* GetObj(sal_uIntPtr nNum) const; 166 167 // Gelinkte Seite oder gelinktes Gruppenobjekt 168 virtual FASTBOOL IsReadOnly() const; 169 170 // Zaehlt alle Objekte inkl. Objekte in Objektgruppen, ... 171 sal_uIntPtr CountAllObjects() const; 172 173 // Alle aufgelagerten Teile (z.B. Grafiken) der Liste in den 174 // Speicher laden. 175 void ForceSwapInObjects() const; 176 void ForceSwapOutObjects() const; 177 178 void SwapInAll() const { ForceSwapInObjects(); } 179 void SwapOutAll() const { ForceSwapOutObjects(); } 180 181 /** Makes the object list flat, i.e. the object list content are 182 then tree leaves 183 184 This method travels recursively over all group objects in this 185 list, extracts the content, inserts it flat to the list and 186 removes the group object afterwards. 187 */ 188 virtual void FlattenGroups(); 189 /** Ungroup the object at the given index 190 191 This method ungroups the content of the group object at the 192 given index, i.e. the content is put flat into the object list 193 (if the object at the given index is no group, this method is 194 a no-op). If the group itself contains group objects, the 195 operation is performed recursively, such that the content of 196 the given object contains no groups afterwards. 197 */ 198 virtual void UnGroupObj( sal_uIntPtr nObjNum ); 199 200 /** Return whether there is an explicit, user defined, object navigation 201 order. When there is one this method returns <TRUE/> and the 202 GetObjectForNavigationPosition() and 203 SdrObject::GetNavigationPosition() methods will return values 204 different from those returne by SdrObject::GetOrdNum() and 205 GetObj(). 206 */ 207 bool HasObjectNavigationOrder (void) const; 208 209 /** Set the navigation position of the given object to the specified 210 value. Note that this changes the navigation position for all 211 objects on or following the old or new position. 212 */ 213 void SetObjectNavigationPosition ( 214 SdrObject& rObject, 215 const sal_uInt32 nNewNavigationPosition); 216 217 /** Return the object for the given navigation position. When there is 218 a user defined navigation order, i.e. mpNavigationOrder is not NULL, 219 then that is used to look up the object. Otherwise the z-order is 220 used by looking up the object in maList. 221 @param nNavigationPosition 222 Valid values include 0 and are smaller than the number of 223 objects as returned by GetObjCount(). 224 @return 225 The returned pointer is NULL for invalid positions. 226 */ 227 SdrObject* GetObjectForNavigationPosition (const sal_uInt32 nNavigationPosition) const; 228 229 /** Restore the navigation order to that defined by the z-order. 230 */ 231 void ClearObjectNavigationOrder (void); 232 233 /** Set the navigation position of all SdrObjects to their position in 234 the mpNavigationOrder list. This method returns immediately when no 235 update is necessary. 236 @return 237 This method returns <TRUE/> when the navigation positions stored 238 in SdrObjects are up to date. 239 It returns <FALSE/> when teh navigation positions are not valid, 240 for example because no explicit navigation order has been 241 defined, i.e. HasObjectNavigationOrder() would return <FALSE/>. 242 */ 243 bool RecalcNavigationPositions (void); 244 245 /** Set the navigation order to the one defined by the given list of 246 XShape objects. 247 @param rxOrder 248 When this is an empty reference then the navigation order is 249 reset to the z-order. The preferred way to do this, however, is 250 to call ClearObjectNavigationOrder(). 251 Otherwise this list is expected to contain all the shapes in the 252 called SdrObjList. 253 */ 254 void SetNavigationOrder (const ::com::sun::star::uno::Reference< 255 ::com::sun::star::container::XIndexAccess>& rxOrder); 256 257 private: 258 class WeakSdrObjectContainerType; 259 /// This list, if it exists, defines the navigation order. It it does 260 /// not exist then maList defines the navigation order. 261 ::boost::scoped_ptr<WeakSdrObjectContainerType> mpNavigationOrder; 262 263 /// This flag is <TRUE/> when the mpNavigation list has been changed but 264 /// the indices of the referenced SdrObjects still have their old values. 265 bool mbIsNavigationOrderDirty; 266 267 /** Insert an SdrObject into maList. Do not modify the maList member 268 directly. 269 @param rObject 270 The object to insert into the object list. 271 @param nInsertPosition 272 The given object is inserted before the object at this 273 position. Valid values include 0 (the object is inserted at the 274 head of the list) and the number of objects in the list as 275 returned by GetObjCount() (the object is inserted at the end of 276 the list.) 277 */ 278 void InsertObjectIntoContainer ( 279 SdrObject& rObject, 280 const sal_uInt32 nInsertPosition); 281 282 /** Replace an object in the object list. 283 @param rObject 284 The new object that replaces the one in the list at the 285 specified position. 286 @param nObjectPosition 287 The object at this position in the object list is replaced by 288 the given object. Valid values include 0 and are smaller than 289 the number of objects in the list. 290 */ 291 void ReplaceObjectInContainer ( 292 SdrObject& rObject, 293 const sal_uInt32 nObjectPosition); 294 295 /** Remove an object from the object list. 296 The object list has to contain at least one element. 297 @param nObjectPosition 298 The object at this position is removed from the object list. 299 Valid values include 0 and are smaller than the number of 300 objects in the list. 301 */ 302 void RemoveObjectFromContainer ( 303 const sal_uInt32 nObjectPosition); 304 }; 305 306 /* 307 Eine Sdraw-Seite enthaelt genau eine Objektliste sowie eine Beschreibung 308 der physikalischen Seitendimensionen (Groesse/Raender). Letzteres wird 309 lediglich zum Fangen von Objekten beim Draggen benoetigt. 310 An der Seite lassen sich (ueber SdrObjList) Objekte einfuegen und loeschen, 311 nach vorn und nach hinten stellen. Ausserdem kann die Ordnungszahl eines 312 Objektes abgefragt sowie direkt gesetzt werden. 313 */ 314 315 // Used for all methods which return a page number 316 #define SDRPAGE_NOTFOUND 0xFFFF 317 318 ////////////////////////////////////////////////////////////////////////////// 319 // class SdrPageGridFrame 320 321 // Fuer das Fangraster/Punkgitter im Writer 322 class SdrPageGridFrame 323 { 324 Rectangle aPaper; 325 Rectangle aUserArea; 326 public: 327 SdrPageGridFrame(const Rectangle& rPaper): aPaper(rPaper), aUserArea(rPaper) {} 328 SdrPageGridFrame(const Rectangle& rPaper, const Rectangle& rUser): aPaper(rPaper), aUserArea(rUser) {} 329 void SetPaperRect(const Rectangle& rPaper) { aPaper=rPaper; } 330 void SetUserArea(const Rectangle& rUser) { aUserArea=rUser; } 331 const Rectangle& GetPaperRect() const { return aPaper; } 332 const Rectangle& GetUserArea() const { return aUserArea; } 333 }; 334 335 class SVX_DLLPUBLIC SdrPageGridFrameList { 336 Container aList; 337 private: 338 SVX_DLLPRIVATE SdrPageGridFrameList(const SdrPageGridFrameList& rSrcList); // never implemented 339 SVX_DLLPRIVATE void operator=(const SdrPageGridFrameList& rSrcList); // never implemented 340 protected: 341 SdrPageGridFrame* GetObject(sal_uInt16 i) const { return (SdrPageGridFrame*)(aList.GetObject(i)); } 342 public: 343 SdrPageGridFrameList(): aList(1024,4,4) {} 344 ~SdrPageGridFrameList() { Clear(); } 345 void Clear(); 346 sal_uInt16 GetCount() const { return sal_uInt16(aList.Count()); } 347 void Insert(const SdrPageGridFrame& rGF, sal_uInt16 nPos=0xFFFF) { aList.Insert(new SdrPageGridFrame(rGF),nPos); } 348 void Delete(sal_uInt16 nPos) { delete (SdrPageGridFrame*)aList.Remove(nPos); } 349 void Move(sal_uInt16 nPos, sal_uInt16 nNewPos) { aList.Insert(aList.Remove(nPos),nNewPos); } 350 SdrPageGridFrame& operator[](sal_uInt16 nPos) { return *GetObject(nPos); } 351 const SdrPageGridFrame& operator[](sal_uInt16 nPos) const { return *GetObject(nPos); } 352 }; 353 354 //////////////////////////////////////////////////////////////////////////////////////////////////// 355 // class SdrPageProperties 356 357 class SVX_DLLPUBLIC SdrPageProperties : public SfxListener 358 { 359 private: 360 // data 361 SdrPage* mpSdrPage; 362 SfxStyleSheet* mpStyleSheet; 363 SfxItemSet* mpProperties; 364 365 // internal helpers 366 void ImpRemoveStyleSheet(); 367 void ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet); 368 369 // not implemented 370 SdrPageProperties& operator=(const SdrPageProperties& rCandidate); 371 372 public: 373 // construct/destruct 374 SdrPageProperties(SdrPage& rSdrPage); 375 virtual ~SdrPageProperties(); 376 377 // Notify(...) from baseclass SfxListener 378 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint); 379 380 // data read/write 381 const SfxItemSet& GetItemSet() const; 382 void PutItemSet(const SfxItemSet& rSet); 383 void PutItem(const SfxPoolItem& rItem); 384 void ClearItem(const sal_uInt16 nWhich = 0); 385 386 // StyleSheet access 387 void SetStyleSheet(SfxStyleSheet* pStyleSheet); 388 SfxStyleSheet* GetStyleSheet() const; 389 }; 390 391 //////////////////////////////////////////////////////////////////////////////////////////////////// 392 // class SdrPage 393 394 class SVX_DLLPUBLIC SdrPage : public SdrObjList, public tools::WeakBase< SdrPage > 395 { 396 /////////////////////////////////////////////////////////////////////////////// 397 // start PageUser section 398 private: 399 // #111111# PageUser section 400 sdr::PageUserVector maPageUsers; 401 402 public: 403 void AddPageUser(sdr::PageUser& rNewUser); 404 void RemovePageUser(sdr::PageUser& rOldUser); 405 406 /////////////////////////////////////////////////////////////////////////////// 407 // end PageUser section 408 409 /////////////////////////////////////////////////////////////////////////////// 410 // #110094# DrawContact section 411 private: 412 sdr::contact::ViewContact* mpViewContact; 413 protected: 414 virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); 415 public: 416 sdr::contact::ViewContact& GetViewContact() const; 417 418 // #110094# DrawContact support: Methods for handling Page changes 419 void ActionChanged() const; 420 421 // #i9076# 422 friend class SdrModel; 423 friend class SvxUnoDrawPagesAccess; 424 425 // this class uses its own UNO wrapper 426 // and thus has to set mxUnoPage 427 friend class ChXChartDocument; 428 429 sal_Int32 nWdt; // Seitengroesse 430 sal_Int32 nHgt; // Seitengroesse 431 sal_Int32 nBordLft; // Seitenrand links 432 sal_Int32 nBordUpp; // Seitenrand oben 433 sal_Int32 nBordRgt; // Seitenrand rechts 434 sal_Int32 nBordLwr; // Seitenrand unten 435 436 // this is a weak reference to a possible living api wrapper for this page 437 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoPage; 438 439 protected: 440 SdrLayerAdmin* pLayerAdmin; 441 private: 442 SdrPageProperties* mpSdrPageProperties; 443 444 public: 445 SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; } 446 const SdrPageProperties& getSdrPageProperties() const { return *mpSdrPageProperties; } 447 const SdrPageProperties* getCorrectSdrPageProperties() const; 448 449 protected: 450 // new MasterPageDescriptorVector 451 ::sdr::MasterPageDescriptor* mpMasterPageDescriptor; 452 453 SetOfByte aPrefVisiLayers; 454 sal_uInt16 nPageNum; 455 456 // bitfield 457 unsigned mbMaster : 1; // flag if this is a MasterPage 458 unsigned mbInserted : 1; 459 unsigned mbObjectsNotPersistent : 1; 460 unsigned mbSwappingLocked : 1; 461 462 // #i93597# 463 unsigned mbPageBorderOnlyLeftRight : 1; 464 465 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage(); 466 467 public: 468 TYPEINFO(); 469 SdrPage(SdrModel& rNewModel, bool bMasterPage=false); 470 // Copy-Ctor und Zuweisungeoperator sind nicht getestet! 471 SdrPage(const SdrPage& rSrcPage); 472 virtual ~SdrPage(); 473 // pModel, pPage, pUpList, pOwnerObj und mbInserted werden Zuweisungeoperator nicht veraendert! 474 virtual void operator=(const SdrPage& rSrcPage); 475 virtual SdrPage* Clone() const; 476 virtual SdrPage* Clone(SdrModel* pNewModel) const; 477 bool IsMasterPage() const { return mbMaster; } 478 void SetInserted(bool bNew = true); 479 FASTBOOL IsInserted() const { return mbInserted; } 480 virtual void SetChanged(); 481 482 // #i68775# React on PageNum changes (from Model in most cases) 483 void SetPageNum(sal_uInt16 nNew); 484 sal_uInt16 GetPageNum() const; 485 486 // #i93597# Allow page border definition to not be the full rectangle but to 487 // use only the left and right vertical edges (reportdesigner) 488 void setPageBorderOnlyLeftRight(bool bNew) { mbPageBorderOnlyLeftRight = bNew; } 489 bool getPageBorderOnlyLeftRight() const { return mbPageBorderOnlyLeftRight; } 490 491 virtual void SetSize(const Size& aSiz); 492 virtual Size GetSize() const; 493 virtual void SetOrientation(Orientation eOri); 494 virtual Orientation GetOrientation() const; 495 virtual sal_Int32 GetWdt() const; 496 virtual sal_Int32 GetHgt() const; 497 virtual void SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr); 498 virtual void SetLftBorder(sal_Int32 nBorder); 499 virtual void SetUppBorder(sal_Int32 nBorder); 500 virtual void SetRgtBorder(sal_Int32 nBorder); 501 virtual void SetLwrBorder(sal_Int32 nBorder); 502 virtual sal_Int32 GetLftBorder() const; 503 virtual sal_Int32 GetUppBorder() const; 504 virtual sal_Int32 GetRgtBorder() const; 505 virtual sal_Int32 GetLwrBorder() const; 506 507 virtual void SetModel(SdrModel* pNewModel); 508 509 // New MasterPage interface 510 sal_Bool TRG_HasMasterPage() const { return (0L != mpMasterPageDescriptor); } 511 void TRG_SetMasterPage(SdrPage& rNew); 512 void TRG_ClearMasterPage(); 513 SdrPage& TRG_GetMasterPage() const; 514 const SetOfByte& TRG_GetMasterPageVisibleLayers() const; 515 void TRG_SetMasterPageVisibleLayers(const SetOfByte& rNew); 516 sdr::contact::ViewContact& TRG_GetMasterPageDescriptorViewContact() const; 517 518 //#if 0 // _SOLAR__PRIVATE 519 protected: 520 void TRG_ImpMasterPageRemoved(const SdrPage& rRemovedPage); 521 //#endif // __PRIVATE 522 public: 523 524 // Aenderungen an den Layern setzen nicht das Modified-Flag ! 525 const SdrLayerAdmin& GetLayerAdmin() const { return *pLayerAdmin; } 526 SdrLayerAdmin& GetLayerAdmin() { return *pLayerAdmin; } 527 528 // GetBitmap und GetMetafile sind noch nicht implementiert. 529 // Bitmap in Bildschirmaufloesung und -farbtiefe aus den Objekten der 530 // Page erzeugen. 531 Bitmap GetBitmap(FASTBOOL bTrimBorders=sal_True) const { return GetBitmap(aPrefVisiLayers,bTrimBorders); } 532 Bitmap GetBitmap(const SetOfByte& rVisibleLayers, FASTBOOL bTrimBorders=sal_True) const; 533 // Metafile aus den Objekten der Page erzeugen 534 GDIMetaFile GetMetaFile(FASTBOOL bTrimBorders=sal_True) { return GetMetaFile(aPrefVisiLayers,bTrimBorders); } 535 GDIMetaFile GetMetaFile(const SetOfByte& rVisibleLayers, FASTBOOL bTrimBorders=sal_True); 536 537 virtual String GetLayoutName() const; 538 539 // fuer's Raster im Writer, auch fuer AlignObjects wenn 1 Objekt markiert ist 540 // wenn pRect!=NULL, dann die Seiten, die von diesem Rect intersected werden 541 // ansonsten die sichtbaren Seiten. 542 virtual const SdrPageGridFrameList* GetGridFrameList(const SdrPageView* pPV, const Rectangle* pRect) const; 543 bool IsObjectsNotPersistent() const { return mbObjectsNotPersistent; } 544 void SetObjectsNotPersistent(bool b) { mbObjectsNotPersistent = b; } 545 // Durch Setzen dieses Flags, kann das Auslagern (Swappen) von 546 // Teilen der Page (z.B. Grafiken) unterbunden werden. 547 // Es werden hierdurch jedoch nicht automatisch alle ausgelagerten 548 // Teile nachgeladen, dies geschieht erst bei konkretem Bedarf oder 549 // durch Aufruf von SwapInAll(). 550 // Fuer die MasterPage(s) der Page muss dies ggf. separat gemacht werden. 551 bool IsSwappingLocked() const { return mbSwappingLocked; } 552 void SetSwappingLocked(bool bLock) { mbSwappingLocked = bLock; } 553 554 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoPage(); 555 556 virtual SfxStyleSheet* GetTextStyleSheetForObject( SdrObject* pObj ) const; 557 558 FASTBOOL HasTransparentObjects( sal_Bool bCheckForAlphaChannel = sal_False ) const; 559 560 /** *deprecated* returns an averaged background color of this page */ 561 // #i75566# GetBackgroundColor -> GetPageBackgroundColor 562 Color GetPageBackgroundColor() const; 563 564 /** *deprecated* returns an averaged background color of this page */ 565 // #i75566# GetBackgroundColor -> GetPageBackgroundColor and bScreenDisplay hint value 566 Color GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay = true) const; 567 568 /** this method returns true if the object from the ViewObjectContact should 569 be visible on this page while rendering. 570 bEdit selects if visibility test is for an editing view or a final render, 571 like printing. 572 */ 573 virtual bool checkVisibility( 574 const sdr::contact::ViewObjectContact& rOriginal, 575 const sdr::contact::DisplayInfo& rDisplayInfo, 576 bool bEdit ); 577 578 /** Check if page is the HandoutMasterPage (in SVX, no PK_HANDOUT available) */ 579 bool isHandoutMasterPage() const; 580 581 ////////////////////////////////////////////////////////////////////////////// 582 // sdr::Comment interface 583 private: 584 sdr::CommentVector maComments; 585 586 public: 587 sal_uInt32 GetCommentCount() const { return maComments.size(); } 588 const sdr::Comment& GetCommentByIndex(sal_uInt32 nIndex); 589 void AddComment(const sdr::Comment& rNew); 590 void ReplaceCommentByIndex(sal_uInt32 nIndex, const sdr::Comment& rNew); 591 }; 592 593 typedef tools::WeakReference< SdrPage > SdrPageWeakRef; 594 595 ////////////////////////////////////////////////////////////////////////////// 596 // use new redirector instead of pPaintProc 597 598 class SVX_DLLPUBLIC StandardCheckVisisbilityRedirector : public ::sdr::contact::ViewObjectContactRedirector 599 { 600 public: 601 StandardCheckVisisbilityRedirector(); 602 virtual ~StandardCheckVisisbilityRedirector(); 603 604 // all default implementations just call the same methods at the original. To do something 605 // different, overload the method and at least do what the method does. 606 virtual drawinglayer::primitive2d::Primitive2DSequence createRedirectedPrimitive2DSequence( 607 const sdr::contact::ViewObjectContact& rOriginal, 608 const sdr::contact::DisplayInfo& rDisplayInfo); 609 }; 610 611 ////////////////////////////////////////////////////////////////////////////// 612 613 #endif //_SVDPAGE_HXX 614 615