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