LCOV - code coverage report
Current view: top level - include/svx - svdpage.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 27 30 90.0 %
Date: 2015-06-13 12:38:46 Functions: 27 30 90.0 %
Legend: Lines: hit not hit

          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 INCLUDED_SVX_SVDPAGE_HXX
      21             : #define INCLUDED_SVX_SVDPAGE_HXX
      22             : 
      23             : #include <svl/stylesheetuser.hxx>
      24             : #include <vcl/bitmap.hxx>
      25             : #include <vcl/print.hxx>
      26             : #include <vcl/gdimtf.hxx>
      27             : #include <tools/weakbase.hxx>
      28             : #include <tools/contnr.hxx>
      29             : #include <cppuhelper/weakref.hxx>
      30             : #include <svx/svdtypes.hxx>
      31             : #include <svx/svdlayer.hxx>
      32             : #include <svx/sdrpageuser.hxx>
      33             : #include <svx/sdr/contact/viewobjectcontactredirector.hxx>
      34             : #include <svx/sdrmasterpagedescriptor.hxx>
      35             : #include <svx/svxdllapi.h>
      36             : #include <com/sun/star/container/XIndexAccess.hpp>
      37             : #include <com/sun/star/drawing/XDrawPage.hpp>
      38             : #include <svx/svdobj.hxx>
      39             : #include <memory>
      40             : #include <vector>
      41             : 
      42             : 
      43             : // predefines
      44             : namespace reportdesign { class OSection; }
      45             : namespace sdr { namespace contact { class ViewContact; }}
      46             : class SdrPage;
      47             : class SdrModel;
      48             : class SfxItemPool;
      49             : class SdrPageView;
      50             : class SdrLayerAdmin;
      51             : class SetOfByte;
      52             : class Color;
      53             : class SfxStyleSheet;
      54             : class SvxUnoDrawPagesAccess;
      55             : 
      56             : enum SdrInsertReasonKind {
      57             :     SDRREASON_UNKNOWN,
      58             :     SDRREASON_STREAMING,  /// importing document
      59             :     SDRREASON_UNDO,       /// from Undo
      60             :     SDRREASON_COPY,       /// something copied...
      61             :     SDRREASON_VIEWCREATE, /// created by User interactively
      62             :     SDRREASON_VIEWCALL    /// via SdrView::Group(), ...
      63             : };
      64             : 
      65             : class SdrInsertReason {
      66             :     const SdrObject* pRefObj;
      67             :     SdrInsertReasonKind eReason;
      68             : public:
      69             :     SdrInsertReason(): pRefObj(NULL),eReason(SDRREASON_UNKNOWN) {}
      70         287 :     SdrInsertReason(SdrInsertReasonKind eR,const SdrObject* pO=NULL): pRefObj(pO),eReason(eR) {}
      71             :     void SetReferenceObject(const SdrObject* pO)  { pRefObj=pO; }
      72             :     const SdrObject* GetReferenceObject() const   { return pRefObj; }
      73             :     void SetReason(SdrInsertReasonKind eR)        { eReason=eR; }
      74         126 :     SdrInsertReasonKind GetReason() const         { return eReason; }
      75             : };
      76             : 
      77             : 
      78             : // class SdrObjList
      79             : 
      80             : class SVX_DLLPUBLIC SdrObjList
      81             : {
      82             :     SdrObjList(const SdrObjList& rSrcList) SAL_DELETED_FUNCTION;
      83             :     SdrObjList &operator=(const SdrObjList& rSrcList) SAL_DELETED_FUNCTION;
      84             : 
      85             : private:
      86             :     typedef ::std::vector<SdrObject*> SdrObjectContainerType;
      87             :     SdrObjectContainerType maList;
      88             : 
      89             : protected:
      90             : friend class SdrObjListIter;
      91             : friend class SdrEditView;
      92             :     SdrObjList* pUpList;   /// parent list
      93             :     SdrModel*   pModel;    /// model to which the list belongs (Layer,ItemPool,Storage)
      94             :     SdrPage*    pPage;     /// Page containing the list, may be "this".
      95             :     SdrObject*  pOwnerObj; /// OwnerObject, if it's list of a Group object.
      96             :     Rectangle   aOutRect;
      97             :     Rectangle   aSnapRect;
      98             :     SdrObjListKind eListKind;
      99             :     bool    bObjOrdNumsDirty;
     100             :     bool    bRectsDirty;
     101             : protected:
     102             :     void RecalcRects();
     103             : 
     104             :     SdrObjList();
     105             :     void lateInit(const SdrObjList& rSrcList);
     106             : 
     107             : private:
     108             :     /// simple ActionChildInserted forwarder to have it on a central place
     109             :     static void impChildInserted(SdrObject& rChild);
     110             : public:
     111             :     TYPEINFO();
     112             :     SdrObjList(SdrModel* pNewModel, SdrPage* pNewPage, SdrObjList* pNewUpList=NULL);
     113             :     virtual ~SdrObjList();
     114             : 
     115             :     virtual SdrObjList* Clone() const;
     116             : 
     117             :     // !!! This method is only for people who know exactly what they do !!!
     118             : 
     119             :     // #110094# This should not be needed (!)
     120             :     void SetObjOrdNumsDirty()                           { bObjOrdNumsDirty=true; }
     121             :     void CopyObjects(const SdrObjList& rSrcList);
     122             :     /// clean up everything (without Undo)
     123             :     void    Clear();
     124     1370541 :     SdrObjListKind GetListKind() const                  { return eListKind; }
     125       41455 :     void           SetListKind(SdrObjListKind eNewKind) { eListKind=eNewKind; }
     126           6 :     SdrObjList*    GetUpList() const                    { return pUpList; }
     127       53814 :     void           SetUpList(SdrObjList* pNewUpList)    { pUpList=pNewUpList; }
     128    29397931 :     SdrObject*     GetOwnerObj() const                  { return pOwnerObj; }
     129       41455 :     void           SetOwnerObj(SdrObject* pNewOwner)    { pOwnerObj=pNewOwner; }
     130             :     SdrPage* GetPage() const;
     131             :     void     SetPage(SdrPage* pNewPage);
     132             :     SdrModel* GetModel() const;
     133             :     virtual void      SetModel(SdrModel* pNewModel);
     134             :     /// recalculate order numbers / ZIndex
     135             :     void     RecalcObjOrdNums();
     136       49868 :     bool IsObjOrdNumsDirty() const        { return bObjOrdNumsDirty; }
     137             :     virtual void NbcInsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE
     138             :                                  , const SdrInsertReason* pReason=NULL
     139             :                                                                       );
     140             :     virtual void InsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE
     141             :                               , const SdrInsertReason* pReason=NULL
     142             :                                                                      );
     143             :     /// remove from list without delete
     144             :     virtual SdrObject* NbcRemoveObject(size_t nObjNum);
     145             :     virtual SdrObject* RemoveObject(size_t nObjNum);
     146             :     /// Replace existing object by different one.
     147             :     /// Same as Remove(old)+Insert(new) but faster because the order numbers
     148             :     /// do not have to be set dirty.
     149             :     virtual SdrObject* NbcReplaceObject(SdrObject* pNewObj, size_t nObjNum);
     150             :     virtual SdrObject* ReplaceObject(SdrObject* pNewObj, size_t nObjNum);
     151             :     /// Modify ZOrder of an SdrObject
     152             :     virtual SdrObject* SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum);
     153             : 
     154             :     void SetRectsDirty();
     155             : 
     156             :     const Rectangle& GetAllObjSnapRect() const;
     157             :     const Rectangle& GetAllObjBoundRect() const;
     158             : 
     159             :     /// reformat all text objects, e.g. when changing printer
     160             :     void NbcReformatAllTextObjects();
     161             :     void ReformatAllTextObjects();
     162             : 
     163             :     /** #103122# reformats all edge objects that are connected to other objects */
     164             :     void ReformatAllEdgeObjects();
     165             : 
     166             :     /// convert attributes of the style to hard formatting
     167             :     void BurnInStyleSheetAttributes();
     168             : 
     169             :     size_t GetObjCount() const;
     170             :     SdrObject* GetObj(size_t nNum) const;
     171             : 
     172             :     /// linked page or linked group object
     173             :     virtual bool IsReadOnly() const;
     174             : 
     175             :     /// count all objects including objects in Groups
     176             :     size_t CountAllObjects() const;
     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             :     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             :     void UnGroupObj( size_t 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() 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. mxNavigationOrder 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();
     229             : 
     230             :     /** Set the navigation position of all SdrObjects to their position in
     231             :         the mxNavigationOrder 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 the 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();
     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             :     void dumpAsXml(struct _xmlTextWriter* pWriter) const;
     255             : 
     256             : private:
     257             :     class WeakSdrObjectContainerType;
     258             :     /// This list, if it exists, defines the navigation order. If it does
     259             :     /// not exist then maList defines the navigation order.
     260             :     std::unique_ptr<WeakSdrObjectContainerType> mxNavigationOrder;
     261             : 
     262             :     /// This flag is <TRUE/> when the mpNavigation list has been changed but
     263             :     /// the indices of the referenced SdrObjects still have their old values.
     264             :     bool mbIsNavigationOrderDirty;
     265             : 
     266             :     /** Insert an SdrObject into maList.  Do not modify the maList member
     267             :         directly.
     268             :         @param rObject
     269             :             The object to insert into the object list.
     270             :         @param nInsertPosition
     271             :             The given object is inserted before the object at this
     272             :             position.  Valid values include 0 (the object is inserted at the
     273             :             head of the list) and the number of objects in the list as
     274             :             returned by GetObjCount() (the object is inserted at the end of
     275             :             the list.)
     276             :     */
     277             :     void InsertObjectIntoContainer (
     278             :         SdrObject& rObject,
     279             :         const sal_uInt32 nInsertPosition);
     280             : 
     281             :     /** Replace an object in the object list.
     282             :         @param rObject
     283             :             The new object that replaces the one in the list at the
     284             :             specified position.
     285             :         @param nObjectPosition
     286             :             The object at this position in the object list is replaced by
     287             :             the given object.  Valid values include 0 and are smaller than
     288             :             the number of objects in the list.
     289             :     */
     290             :     void ReplaceObjectInContainer (
     291             :         SdrObject& rObject,
     292             :         const sal_uInt32 nObjectPosition);
     293             : 
     294             :     /** Remove an object from the object list.
     295             :         The object list has to contain at least one element.
     296             :         @param nObjectPosition
     297             :             The object at this position is removed from the object list.
     298             :             Valid values include 0 and are smaller than the number of
     299             :             objects in the list.
     300             :     */
     301             :     void RemoveObjectFromContainer (
     302             :         const sal_uInt32 nObjectPosition);
     303             : };
     304             : 
     305             : // Used for all methods which return a page number
     306             : #define SDRPAGE_NOTFOUND 0xFFFF
     307             : 
     308             : 
     309             : // class SdrPageGridFrame
     310             : 
     311             : /// for the snap-to-grid in Writer
     312             : class SdrPageGridFrame
     313             : {
     314             :     Rectangle aPaper;
     315             :     Rectangle aUserArea;
     316             : public:
     317             :     SdrPageGridFrame(const Rectangle& rPaper): aPaper(rPaper), aUserArea(rPaper) {}
     318          40 :     SdrPageGridFrame(const Rectangle& rPaper, const Rectangle& rUser): aPaper(rPaper), aUserArea(rUser) {}
     319             :     void             SetPaperRect(const Rectangle& rPaper) { aPaper=rPaper; }
     320             :     void             SetUserArea(const Rectangle& rUser)   { aUserArea=rUser; }
     321         120 :     const Rectangle& GetPaperRect() const                  { return aPaper; }
     322         200 :     const Rectangle& GetUserArea() const                   { return aUserArea; }
     323             : };
     324             : 
     325             : class SVX_DLLPUBLIC SdrPageGridFrameList {
     326             :     std::vector<SdrPageGridFrame*> aList;
     327             : private:
     328             :     SdrPageGridFrameList(const SdrPageGridFrameList& rSrcList) SAL_DELETED_FUNCTION;
     329             :     void           operator=(const SdrPageGridFrameList& rSrcList) SAL_DELETED_FUNCTION;
     330             : protected:
     331          80 :     SdrPageGridFrame* GetObject(sal_uInt16 i) const { return aList[i]; }
     332             : public:
     333           1 :     SdrPageGridFrameList(): aList()                                    {}
     334           1 :     ~SdrPageGridFrameList()                                            { Clear(); }
     335             :     void           Clear();
     336          80 :     sal_uInt16         GetCount() const                                    { return sal_uInt16(aList.size()); }
     337          40 :     void           Insert(const SdrPageGridFrame& rGF) { aList.push_back(new SdrPageGridFrame(rGF)); }
     338             :     void           Insert(const SdrPageGridFrame& rGF, sal_uInt16 nPos)
     339             :     {
     340             :         if(nPos==0xFFFF)
     341             :             aList.push_back(new SdrPageGridFrame(rGF));
     342             :         else
     343             :             aList.insert(aList.begin()+nPos,new SdrPageGridFrame(rGF));
     344             :     }
     345             :     void           Delete(sal_uInt16 nPos)
     346             :     {
     347             :         SdrPageGridFrame* p = aList[nPos];
     348             :         aList.erase(aList.begin()+nPos);
     349             :         delete p;
     350             :     }
     351             :     void           Move(sal_uInt16 nPos, sal_uInt16 nNewPos)
     352             :     {
     353             :         SdrPageGridFrame* p = aList[nPos];
     354             :         aList.erase(aList.begin()+nPos);
     355             :         aList.insert(aList.begin()+nNewPos,p);
     356             :     }
     357           0 :     SdrPageGridFrame&       operator[](sal_uInt16 nPos)                    { return *GetObject(nPos); }
     358          40 :     const SdrPageGridFrame& operator[](sal_uInt16 nPos) const              { return *GetObject(nPos); }
     359             : };
     360             : 
     361             : 
     362             : // class SdrPageProperties
     363             : 
     364             : class SVX_DLLPUBLIC SdrPageProperties : public SfxListener, public svl::StyleSheetUser
     365             : {
     366             : private:
     367             :     // data
     368             :     SdrPage*                mpSdrPage;
     369             :     SfxStyleSheet*          mpStyleSheet;
     370             :     SfxItemSet*             mpProperties;
     371             : 
     372             :     // internal helpers
     373             :     void ImpRemoveStyleSheet();
     374             :     void ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet);
     375             : 
     376             :     SdrPageProperties& operator=(const SdrPageProperties& rCandidate) SAL_DELETED_FUNCTION;
     377             : 
     378             : public:
     379             :     // construct/destruct
     380             :     SdrPageProperties(SdrPage& rSdrPage);
     381             :     virtual ~SdrPageProperties();
     382             : 
     383             :     // Notify(...) from baseclass SfxListener
     384             :     virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) SAL_OVERRIDE;
     385             : 
     386             :     virtual bool isUsedByModel() const SAL_OVERRIDE;
     387             : 
     388             :     // data read/write
     389       23266 :     const SfxItemSet& GetItemSet() const { return *mpProperties;}
     390             :     void PutItemSet(const SfxItemSet& rSet);
     391             :     void PutItem(const SfxPoolItem& rItem);
     392             :     void ClearItem(const sal_uInt16 nWhich = 0);
     393             : 
     394             :     // StyleSheet access
     395             :     void SetStyleSheet(SfxStyleSheet* pStyleSheet);
     396        1350 :     SfxStyleSheet* GetStyleSheet() const { return mpStyleSheet;}
     397             : };
     398             : 
     399             : 
     400             : /**
     401             :   A SdrPage contains exactly one SdrObjList and a description of the physical
     402             :   page dimensions (size / margins).  The latter is required to "catch" objects
     403             :   during drag-and-drop.
     404             :   The SdrPage allows (via SdrObjList) inserting and removing SdrObjects,
     405             :   as well as moving them into the foreground or background.
     406             :   Also it's possible to request and directly set the order number (ZOrder)
     407             :   of SdrObjects.
     408             : */
     409             : class SVX_DLLPUBLIC SdrPage : public SdrObjList, public tools::WeakBase< SdrPage >
     410             : {
     411             :     SdrPage& operator=(const SdrPage& rSrcPage) SAL_DELETED_FUNCTION;
     412             : 
     413             :     // start PageUser section
     414             : private:
     415             :     // #111111# PageUser section
     416             :     sdr::PageUserVector                                             maPageUsers;
     417             : 
     418             : public:
     419             :     void AddPageUser(sdr::PageUser& rNewUser);
     420             :     void RemovePageUser(sdr::PageUser& rOldUser);
     421             : 
     422             : 
     423             :     // end PageUser section
     424             : 
     425             : 
     426             :     // #110094# DrawContact section
     427             : private:
     428             :     sdr::contact::ViewContact*                                      mpViewContact;
     429             : protected:
     430             :     sdr::contact::ViewContact* CreateObjectSpecificViewContact();
     431             : public:
     432             :     sdr::contact::ViewContact& GetViewContact() const;
     433             : 
     434             :     // #110094# DrawContact support: Methods for handling Page changes
     435             :     void ActionChanged() const;
     436             : 
     437             :     // #i9076#
     438             :     friend class SdrModel;
     439             :     friend class SvxUnoDrawPagesAccess;
     440             : 
     441             : // this class uses its own UNO wrapper
     442             : // and thus has to set mxUnoPage (it also relies on mxUnoPage not being WeakRef)
     443             : friend class reportdesign::OSection;
     444             : 
     445             :     sal_Int32 nWdt;     // Seitengroesse
     446             :     sal_Int32 nHgt;     // Seitengroesse
     447             :     sal_Int32 nBordLft; // Seitenrand links
     448             :     sal_Int32 nBordUpp; // Seitenrand oben
     449             :     sal_Int32 nBordRgt; // Seitenrand rechts
     450             :     sal_Int32 nBordLwr; // Seitenrand unten
     451             : 
     452             : protected:
     453             :     SdrLayerAdmin*      pLayerAdmin;
     454             : private:
     455             :     SdrPageProperties*  mpSdrPageProperties;
     456             :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoPage;
     457             : 
     458             : public:
     459       21481 :     SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; }
     460        4589 :     const SdrPageProperties& getSdrPageProperties() const { return *mpSdrPageProperties; }
     461             :     const SdrPageProperties* getCorrectSdrPageProperties() const;
     462             : 
     463             : protected:
     464             :     // new MasterPageDescriptorVector
     465             :     sdr::MasterPageDescriptor*                    mpMasterPageDescriptor;
     466             : 
     467             :     SetOfByte  aPrefVisiLayers;
     468             :     sal_uInt16     nPageNum;
     469             : 
     470             :     // bitfield
     471             :     bool                mbMaster : 1;               // flag if this is a MasterPage
     472             :     bool                mbInserted : 1;
     473             :     bool                mbObjectsNotPersistent : 1;
     474             : 
     475             :     // #i93597#
     476             :     bool                mbPageBorderOnlyLeftRight : 1;
     477             : 
     478             :     void SetUnoPage(::com::sun::star::uno::Reference<
     479             :                         ::com::sun::star::drawing::XDrawPage> const&);
     480             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
     481             : 
     482             :     // Copying of pages is split into two parts: construction and copying of page objects,
     483             :     // because the copying might need access to fully initialized page. Clone() is responsible
     484             :     // to call lateInit() after copy-construction of a new object. Any initialization in derived
     485             :     // classes that needs access to the page objects must be deferred to lateInit. And it must
     486             :     // call lateInit() of its parent class.
     487             :     SdrPage(const SdrPage& rSrcPage);
     488             :     void lateInit(const SdrPage& rSrcPage, SdrModel* pNewModel = 0);
     489             : 
     490             : public:
     491             :     TYPEINFO_OVERRIDE();
     492             :     explicit SdrPage(SdrModel& rNewModel, bool bMasterPage=false);
     493             :     virtual ~SdrPage();
     494             :     virtual SdrPage* Clone() const SAL_OVERRIDE;
     495             :     virtual SdrPage* Clone(SdrModel* pNewModel) const;
     496       75697 :     bool IsMasterPage() const       { return mbMaster; }
     497             :     void SetInserted(bool bNew = true);
     498        5884 :     bool IsInserted() const         { return mbInserted; }
     499             :     void SetChanged();
     500             : 
     501             :     // #i68775# React on PageNum changes (from Model in most cases)
     502             :     void SetPageNum(sal_uInt16 nNew);
     503             :     sal_uInt16 GetPageNum() const;
     504             : 
     505             :     // #i93597# Allow page border definition to not be the full rectangle but to
     506             :     // use only the left and right vertical edges (reportdesigner)
     507           0 :     void setPageBorderOnlyLeftRight(bool bNew) { mbPageBorderOnlyLeftRight = bNew; }
     508        2510 :     bool getPageBorderOnlyLeftRight() const { return mbPageBorderOnlyLeftRight; }
     509             : 
     510             :     virtual void SetSize(const Size& aSiz);
     511             :     Size GetSize() const;
     512             :     virtual void SetOrientation(Orientation eOri);
     513             :     virtual Orientation GetOrientation() const;
     514             :     sal_Int32 GetWdt() const;
     515             :     sal_Int32 GetHgt() const;
     516             :     virtual void  SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr);
     517             :     virtual void  SetLftBorder(sal_Int32 nBorder);
     518             :     virtual void  SetUppBorder(sal_Int32 nBorder);
     519             :     virtual void  SetRgtBorder(sal_Int32 nBorder);
     520             :     virtual void  SetLwrBorder(sal_Int32 nBorder);
     521             :     sal_Int32 GetLftBorder() const;
     522             :     sal_Int32 GetUppBorder() const;
     523             :     sal_Int32 GetRgtBorder() const;
     524             :     sal_Int32 GetLwrBorder() const;
     525             : 
     526             :     virtual void SetModel(SdrModel* pNewModel) SAL_OVERRIDE;
     527             : 
     528             :     // New MasterPage interface
     529      112468 :     bool TRG_HasMasterPage() const { return (0L != mpMasterPageDescriptor); }
     530             :     void TRG_SetMasterPage(SdrPage& rNew);
     531             :     void TRG_ClearMasterPage();
     532             :     SdrPage& TRG_GetMasterPage() const;
     533             :     const SetOfByte& TRG_GetMasterPageVisibleLayers() const;
     534             :     void TRG_SetMasterPageVisibleLayers(const SetOfByte& rNew);
     535             :     sdr::contact::ViewContact& TRG_GetMasterPageDescriptorViewContact() const;
     536             : 
     537             : protected:
     538             :     void TRG_ImpMasterPageRemoved(const SdrPage& rRemovedPage);
     539             : public:
     540             : 
     541             :     /// changing the layers does not set the modified-flag!
     542           0 :     const         SdrLayerAdmin& GetLayerAdmin() const                  { return *pLayerAdmin; }
     543       25079 :                   SdrLayerAdmin& GetLayerAdmin()                        { return *pLayerAdmin; }
     544             : 
     545             :     virtual OUString GetLayoutName() const;
     546             : 
     547             :     /// for snap-to-grid in Writer, also for AlignObjects if 1 object is marked
     548             :     /// if pRect != null, then the pages that are intersected by this Rect,
     549             :     /// otherwise the visible pages
     550             :     virtual const SdrPageGridFrameList* GetGridFrameList(const SdrPageView* pPV, const Rectangle* pRect) const;
     551             :     bool IsObjectsNotPersistent() const          { return mbObjectsNotPersistent; }
     552             :     void SetObjectsNotPersistent(bool b)     { mbObjectsNotPersistent = b; }
     553             : 
     554             :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoPage();
     555             : 
     556             :     virtual SfxStyleSheet* GetTextStyleSheetForObject( SdrObject* pObj ) const;
     557             : 
     558             :     /** *deprecated* returns an averaged background color of this page */
     559             :     // #i75566# GetBackgroundColor -> GetPageBackgroundColor
     560             :     Color GetPageBackgroundColor() const;
     561             : 
     562             :     /** *deprecated* returns an averaged background color of this page */
     563             :     // #i75566# GetBackgroundColor -> GetPageBackgroundColor and bScreenDisplay hint value
     564             :     Color GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay = true) const;
     565             : 
     566             :     /** this method returns true if the object from the ViewObjectContact should
     567             :         be visible on this page while rendering.
     568             :         bEdit selects if visibility test is for an editing view or a final render,
     569             :         like printing.
     570             :     */
     571             :     virtual bool checkVisibility(
     572             :         const sdr::contact::ViewObjectContact& rOriginal,
     573             :         const sdr::contact::DisplayInfo& rDisplayInfo,
     574             :         bool bEdit );
     575             : 
     576             : private:
     577             :     void impl_setModelForLayerAdmin(SdrModel* pNewModel);
     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, override 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) SAL_OVERRIDE;
     596             : };
     597             : 
     598             : 
     599             : 
     600             : #endif // INCLUDED_SVX_SVDPAGE_HXX
     601             : 
     602             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11