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