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