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