LCOV - code coverage report
Current view: top level - solver/unxlngi6.pro/inc/svx - svdpage.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 8 13 61.5 %
Date: 2012-08-25 Functions: 8 13 61.5 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 2 4 50.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef _SVDPAGE_HXX
      30                 :            : #define _SVDPAGE_HXX
      31                 :            : 
      32                 :            : #include <vcl/bitmap.hxx>
      33                 :            : #include <vcl/print.hxx>
      34                 :            : #include <vcl/gdimtf.hxx>
      35                 :            : #include <tools/weakbase.hxx>
      36                 :            : #include <cppuhelper/weakref.hxx>
      37                 :            : #include <svx/svdtypes.hxx>
      38                 :            : #include <svx/svdlayer.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                 :          0 :     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                 :            :     bool    bObjOrdNumsDirty;
     101                 :            :     bool    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                 :          0 :     SdrObjList*    GetUpList() const                    { return pUpList; }
     125                 :            :     void           SetUpList(SdrObjList* pNewUpList)    { pUpList=pNewUpList; }
     126                 :          0 :     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                 :          0 :     bool IsObjOrdNumsDirty() const        { return bObjOrdNumsDirty; }
     135                 :            :     virtual void NbcInsertObject(SdrObject* pObj, sal_uIntPtr nPos=0xFFFF
     136                 :            :                                  , const SdrInsertReason* pReason=NULL
     137                 :            :                                                                       );
     138                 :            :     virtual void InsertObject(SdrObject* pObj, sal_uIntPtr nPos=0xFFFF
     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 bool 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                 :         25 :     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                 :            :     std::vector<SdrPageGridFrame*> 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 aList[i]; }
     346                 :            : public:
     347                 :          2 :     SdrPageGridFrameList(): aList()                                    {}
     348         [ +  - ]:          2 :     ~SdrPageGridFrameList()                                            { Clear(); }
     349                 :            :     void           Clear();
     350                 :            :     sal_uInt16         GetCount() const                                    { return sal_uInt16(aList.size()); }
     351         [ +  - ]:         25 :     void           Insert(const SdrPageGridFrame& rGF) { aList.push_back(new SdrPageGridFrame(rGF)); }
     352                 :            :     void           Insert(const SdrPageGridFrame& rGF, sal_uInt16 nPos)
     353                 :            :     {
     354                 :            :         if(nPos==0xFFFF)
     355                 :            :             aList.push_back(new SdrPageGridFrame(rGF));
     356                 :            :         else
     357                 :            :             aList.insert(aList.begin()+nPos,new SdrPageGridFrame(rGF));
     358                 :            :     }
     359                 :            :     void           Delete(sal_uInt16 nPos)
     360                 :            :     {
     361                 :            :         SdrPageGridFrame* p = aList[nPos];
     362                 :            :         aList.erase(aList.begin()+nPos);
     363                 :            :         delete p;
     364                 :            :     }
     365                 :            :     void           Move(sal_uInt16 nPos, sal_uInt16 nNewPos)
     366                 :            :     {
     367                 :            :         SdrPageGridFrame* p = aList[nPos];
     368                 :            :         aList.erase(aList.begin()+nPos);
     369                 :            :         aList.insert(aList.begin()+nNewPos,p);
     370                 :            :     }
     371                 :            :     SdrPageGridFrame&       operator[](sal_uInt16 nPos)                    { return *GetObject(nPos); }
     372                 :            :     const SdrPageGridFrame& operator[](sal_uInt16 nPos) const              { return *GetObject(nPos); }
     373                 :            : };
     374                 :            : 
     375                 :            : ////////////////////////////////////////////////////////////////////////////////////////////////////
     376                 :            : // class SdrPageProperties
     377                 :            : 
     378                 :            : class SVX_DLLPUBLIC SdrPageProperties : public SfxListener
     379                 :            : {
     380                 :            : private:
     381                 :            :     // data
     382                 :            :     SdrPage*                mpSdrPage;
     383                 :            :     SfxStyleSheet*          mpStyleSheet;
     384                 :            :     SfxItemSet*             mpProperties;
     385                 :            : 
     386                 :            :     // internal helpers
     387                 :            :     void ImpRemoveStyleSheet();
     388                 :            :     void ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet);
     389                 :            : 
     390                 :            :     // not implemented
     391                 :            :     SdrPageProperties& operator=(const SdrPageProperties& rCandidate);
     392                 :            : 
     393                 :            : public:
     394                 :            :     // construct/destruct
     395                 :            :     SdrPageProperties(SdrPage& rSdrPage);
     396                 :            :     virtual ~SdrPageProperties();
     397                 :            : 
     398                 :            :     // Notify(...) from baseclass SfxListener
     399                 :            :     virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
     400                 :            : 
     401                 :            :     // data read/write
     402                 :            :     const SfxItemSet& GetItemSet() const;
     403                 :            :     void PutItemSet(const SfxItemSet& rSet);
     404                 :            :     void PutItem(const SfxPoolItem& rItem);
     405                 :            :     void ClearItem(const sal_uInt16 nWhich = 0);
     406                 :            : 
     407                 :            :     // StyleSheet access
     408                 :            :     void SetStyleSheet(SfxStyleSheet* pStyleSheet);
     409                 :            :     SfxStyleSheet* GetStyleSheet() const;
     410                 :            : };
     411                 :            : 
     412                 :            : ////////////////////////////////////////////////////////////////////////////////////////////////////
     413                 :            : // class SdrPage
     414                 :            : 
     415                 :            : class SVX_DLLPUBLIC SdrPage : public SdrObjList, public tools::WeakBase< SdrPage >
     416                 :            : {
     417                 :            :     ///////////////////////////////////////////////////////////////////////////////
     418                 :            :     // start PageUser section
     419                 :            : private:
     420                 :            :     // #111111# PageUser section
     421                 :            :     sdr::PageUserVector                                             maPageUsers;
     422                 :            : 
     423                 :            : public:
     424                 :            :     void AddPageUser(sdr::PageUser& rNewUser);
     425                 :            :     void RemovePageUser(sdr::PageUser& rOldUser);
     426                 :            : 
     427                 :            :     ///////////////////////////////////////////////////////////////////////////////
     428                 :            :     // end PageUser section
     429                 :            : 
     430                 :            :     ///////////////////////////////////////////////////////////////////////////////
     431                 :            :     // #110094# DrawContact section
     432                 :            : private:
     433                 :            :     sdr::contact::ViewContact*                                      mpViewContact;
     434                 :            : protected:
     435                 :            :     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
     436                 :            : public:
     437                 :            :     sdr::contact::ViewContact& GetViewContact() const;
     438                 :            : 
     439                 :            :     // #110094# DrawContact support: Methods for handling Page changes
     440                 :            :     void ActionChanged() const;
     441                 :            : 
     442                 :            :     // #i9076#
     443                 :            :     friend class SdrModel;
     444                 :            :     friend class SvxUnoDrawPagesAccess;
     445                 :            : 
     446                 :            : // this class uses its own UNO wrapper
     447                 :            : // and thus has to set mxUnoPage
     448                 :            : friend class ChXChartDocument;
     449                 :            : 
     450                 :            :     sal_Int32 nWdt;     // Seitengroesse
     451                 :            :     sal_Int32 nHgt;     // Seitengroesse
     452                 :            :     sal_Int32 nBordLft; // Seitenrand links
     453                 :            :     sal_Int32 nBordUpp; // Seitenrand oben
     454                 :            :     sal_Int32 nBordRgt; // Seitenrand rechts
     455                 :            :     sal_Int32 nBordLwr; // Seitenrand unten
     456                 :            : 
     457                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoPage;
     458                 :            : 
     459                 :            : protected:
     460                 :            :     SdrLayerAdmin*      pLayerAdmin;
     461                 :            : private:
     462                 :            :     SdrPageProperties*  mpSdrPageProperties;
     463                 :            : 
     464                 :            : public:
     465                 :        588 :     SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; }
     466                 :            :     const SdrPageProperties& getSdrPageProperties() const { return *mpSdrPageProperties; }
     467                 :            :     const SdrPageProperties* getCorrectSdrPageProperties() const;
     468                 :            : 
     469                 :            : protected:
     470                 :            :     // new MasterPageDescriptorVector
     471                 :            :     ::sdr::MasterPageDescriptor*                    mpMasterPageDescriptor;
     472                 :            : 
     473                 :            :     SetOfByte  aPrefVisiLayers;
     474                 :            :     sal_uInt16     nPageNum;
     475                 :            : 
     476                 :            :     // bitfield
     477                 :            :     unsigned            mbMaster : 1;               // flag if this is a MasterPage
     478                 :            :     unsigned            mbInserted : 1;
     479                 :            :     unsigned            mbObjectsNotPersistent : 1;
     480                 :            :     unsigned            mbSwappingLocked : 1;
     481                 :            : 
     482                 :            :     // #i93597#
     483                 :            :     unsigned            mbPageBorderOnlyLeftRight : 1;
     484                 :            : 
     485                 :            :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
     486                 :            : 
     487                 :            : public:
     488                 :            :     TYPEINFO();
     489                 :            :     SdrPage(SdrModel& rNewModel, bool bMasterPage=false);
     490                 :            :     // Copy-Ctor und Zuweisungeoperator sind nicht getestet!
     491                 :            :     SdrPage(const SdrPage& rSrcPage);
     492                 :            :     virtual ~SdrPage();
     493                 :            :     // pModel, pPage, pUpList, pOwnerObj und mbInserted werden Zuweisungeoperator nicht veraendert!
     494                 :            :     SdrPage& operator=(const SdrPage& rSrcPage);
     495                 :            :     virtual SdrPage* Clone() const;
     496                 :            :     virtual SdrPage* Clone(SdrModel* pNewModel) const;
     497                 :      15919 :     bool IsMasterPage() const       { return mbMaster; }
     498                 :            :     void SetInserted(bool bNew = true);
     499                 :         44 :     bool IsInserted() const         { return mbInserted; }
     500                 :            :     virtual void SetChanged();
     501                 :            : 
     502                 :            :     // #i68775# React on PageNum changes (from Model in most cases)
     503                 :            :     void SetPageNum(sal_uInt16 nNew);
     504                 :            :     sal_uInt16 GetPageNum() const;
     505                 :            : 
     506                 :            :     // #i93597# Allow page border definition to not be the full rectangle but to
     507                 :            :     // use only the left and right vertical edges (reportdesigner)
     508                 :          0 :     void setPageBorderOnlyLeftRight(bool bNew) { mbPageBorderOnlyLeftRight = bNew; }
     509                 :            :     bool getPageBorderOnlyLeftRight() const { return mbPageBorderOnlyLeftRight; }
     510                 :            : 
     511                 :            :     virtual void SetSize(const Size& aSiz);
     512                 :            :     virtual Size GetSize() const;
     513                 :            :     virtual void SetOrientation(Orientation eOri);
     514                 :            :     virtual Orientation GetOrientation() const;
     515                 :            :     virtual sal_Int32 GetWdt() const;
     516                 :            :     virtual sal_Int32 GetHgt() const;
     517                 :            :     virtual void  SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr);
     518                 :            :     virtual void  SetLftBorder(sal_Int32 nBorder);
     519                 :            :     virtual void  SetUppBorder(sal_Int32 nBorder);
     520                 :            :     virtual void  SetRgtBorder(sal_Int32 nBorder);
     521                 :            :     virtual void  SetLwrBorder(sal_Int32 nBorder);
     522                 :            :     virtual sal_Int32 GetLftBorder() const;
     523                 :            :     virtual sal_Int32 GetUppBorder() const;
     524                 :            :     virtual sal_Int32 GetRgtBorder() const;
     525                 :            :     virtual sal_Int32 GetLwrBorder() const;
     526                 :            : 
     527                 :            :     virtual void SetModel(SdrModel* pNewModel);
     528                 :            : 
     529                 :            :     // New MasterPage interface
     530                 :       2613 :     sal_Bool TRG_HasMasterPage() const { return (0L != mpMasterPageDescriptor); }
     531                 :            :     void TRG_SetMasterPage(SdrPage& rNew);
     532                 :            :     void TRG_ClearMasterPage();
     533                 :            :     SdrPage& TRG_GetMasterPage() const;
     534                 :            :     const SetOfByte& TRG_GetMasterPageVisibleLayers() const;
     535                 :            :     void TRG_SetMasterPageVisibleLayers(const SetOfByte& rNew);
     536                 :            :     sdr::contact::ViewContact& TRG_GetMasterPageDescriptorViewContact() const;
     537                 :            : 
     538                 :            : protected:
     539                 :            :     void TRG_ImpMasterPageRemoved(const SdrPage& rRemovedPage);
     540                 :            : public:
     541                 :            : 
     542                 :            :     // Aenderungen an den Layern setzen nicht das Modified-Flag !
     543                 :            :     const         SdrLayerAdmin& GetLayerAdmin() const                  { return *pLayerAdmin; }
     544                 :            :                   SdrLayerAdmin& GetLayerAdmin()                        { return *pLayerAdmin; }
     545                 :            : 
     546                 :            :     virtual String GetLayoutName() const;
     547                 :            : 
     548                 :            :     // fuer's Raster im Writer, auch fuer AlignObjects wenn 1 Objekt markiert ist
     549                 :            :     // wenn pRect!=NULL, dann die Seiten, die von diesem Rect intersected werden
     550                 :            :     // ansonsten die sichtbaren Seiten.
     551                 :            :     virtual const SdrPageGridFrameList* GetGridFrameList(const SdrPageView* pPV, const Rectangle* pRect) const;
     552                 :            :     bool IsObjectsNotPersistent() const          { return mbObjectsNotPersistent; }
     553                 :            :     void SetObjectsNotPersistent(bool b)     { mbObjectsNotPersistent = b; }
     554                 :            :     // Durch Setzen dieses Flags, kann das Auslagern (Swappen) von
     555                 :            :     // Teilen der Page (z.B. Grafiken) unterbunden werden.
     556                 :            :     // Es werden hierdurch jedoch nicht automatisch alle ausgelagerten
     557                 :            :     // Teile nachgeladen, dies geschieht erst bei konkretem Bedarf oder
     558                 :            :     // durch Aufruf von SwapInAll().
     559                 :            :     // Fuer die MasterPage(s) der Page muss dies ggf. separat gemacht werden.
     560                 :            :     bool IsSwappingLocked() const { return mbSwappingLocked; }
     561                 :            :     void SetSwappingLocked(bool bLock) { mbSwappingLocked = bLock; }
     562                 :            : 
     563                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoPage();
     564                 :            : 
     565                 :            :     virtual SfxStyleSheet* GetTextStyleSheetForObject( SdrObject* pObj ) const;
     566                 :            : 
     567                 :            :     /** *deprecated* returns an averaged background color of this page */
     568                 :            :     // #i75566# GetBackgroundColor -> GetPageBackgroundColor
     569                 :            :     Color GetPageBackgroundColor() const;
     570                 :            : 
     571                 :            :     /** *deprecated* returns an averaged background color of this page */
     572                 :            :     // #i75566# GetBackgroundColor -> GetPageBackgroundColor and bScreenDisplay hint value
     573                 :            :     Color GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay = true) const;
     574                 :            : 
     575                 :            :     /** this method returns true if the object from the ViewObjectContact should
     576                 :            :         be visible on this page while rendering.
     577                 :            :         bEdit selects if visibility test is for an editing view or a final render,
     578                 :            :         like printing.
     579                 :            :     */
     580                 :            :     virtual bool checkVisibility(
     581                 :            :         const sdr::contact::ViewObjectContact& rOriginal,
     582                 :            :         const sdr::contact::DisplayInfo& rDisplayInfo,
     583                 :            :         bool bEdit );
     584                 :            : };
     585                 :            : 
     586                 :            : typedef tools::WeakReference< SdrPage > SdrPageWeakRef;
     587                 :            : 
     588                 :            : //////////////////////////////////////////////////////////////////////////////
     589                 :            : // use new redirector instead of pPaintProc
     590                 :            : 
     591                 :            : class SVX_DLLPUBLIC StandardCheckVisisbilityRedirector : public ::sdr::contact::ViewObjectContactRedirector
     592                 :            : {
     593                 :            : public:
     594                 :            :     StandardCheckVisisbilityRedirector();
     595                 :            :     virtual ~StandardCheckVisisbilityRedirector();
     596                 :            : 
     597                 :            :     // all default implementations just call the same methods at the original. To do something
     598                 :            :     // different, overload the method and at least do what the method does.
     599                 :            :     virtual drawinglayer::primitive2d::Primitive2DSequence createRedirectedPrimitive2DSequence(
     600                 :            :         const sdr::contact::ViewObjectContact& rOriginal,
     601                 :            :         const sdr::contact::DisplayInfo& rDisplayInfo);
     602                 :            : };
     603                 :            : 
     604                 :            : //////////////////////////////////////////////////////////////////////////////
     605                 :            : 
     606                 :            : #endif //_SVDPAGE_HXX
     607                 :            : 
     608                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10