LCOV - code coverage report
Current view: top level - libreoffice/svx/inc/svx - svdobj.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 7 9 77.8 %
Date: 2012-12-27 Functions: 4 30 13.3 %
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 _SVDOBJ_HXX
      21             : #define _SVDOBJ_HXX
      22             : 
      23             : #include <memory>
      24             : #include <typeinfo>
      25             : #include <cppuhelper/weakref.hxx>
      26             : #include <vcl/mapmod.hxx>
      27             : #include <tools/weakbase.hxx>
      28             : #include <svl/lstner.hxx>
      29             : #include <vcl/timer.hxx>
      30             : #include <svx/svdsob.hxx>
      31             : #include <svx/svdtypes.hxx> // fuer SdrLayerID
      32             : #include <svx/svdglue.hxx> // Klebepunkte
      33             : #include <svx/xdash.hxx>
      34             : #include <svx/xpoly.hxx>
      35             : #include <svx/xenum.hxx>
      36             : #include <vcl/bitmapex.hxx>
      37             : #include <svx/sdrobjectuser.hxx>
      38             : #include "svx/svxdllapi.h"
      39             : #include "svx/shapeproperty.hxx"
      40             : 
      41             : #include <boost/optional.hpp>
      42             : #include <boost/ptr_container/ptr_vector.hpp>
      43             : 
      44             : //************************************************************
      45             : //   Vorausdeklarationen
      46             : //************************************************************
      47             : 
      48             : class SfxBroadcaster;
      49             : class Pointer;
      50             : class AutoTimer;
      51             : class OutlinerParaObject;
      52             : class SdrOutliner;
      53             : class SdrDragStat;
      54             : class SdrHdl;
      55             : class SdrHdlList;
      56             : class SdrItemPool;
      57             : class SdrModel;
      58             : class SdrObjList;
      59             : class SdrObject;
      60             : class SdrPage;
      61             : class SdrPageView;
      62             : class SdrView;
      63             : class SfxItemSet;
      64             : class SfxSetItem;
      65             : class SfxStyleSheet;
      66             : class SfxUndoAction;
      67             : class XFillAttrSetItem;
      68             : class XLineAttrSetItem;
      69             : class SfxItemPool;
      70             : class PolyPolygon;
      71             : class SfxPoolItem;
      72             : class SdrVirtObj;
      73             : class SdrDragView;
      74             : 
      75             : namespace sdr
      76             : {
      77             :     namespace properties
      78             :     {
      79             :         class BaseProperties;
      80             :     } // end of namespace properties
      81             : } // end of namespace sdr
      82             : 
      83             : // #110094#
      84             : namespace sdr
      85             : {
      86             :     namespace contact
      87             :     {
      88             :         class ViewContact;
      89             :     } // end of namespace contact
      90             : } // end of namespace sdr
      91             : 
      92             : namespace svx
      93             : {
      94             :     class PropertyChangeNotifier;
      95             : }
      96             : 
      97             : //************************************************************
      98             : //   Defines
      99             : //************************************************************
     100             : 
     101             : enum SdrObjKind {OBJ_NONE       = 0,  // Abstraktes Objekt (SdrObject)
     102             :                  OBJ_GRUP       = 1,  // Objektgruppe
     103             :                  OBJ_LINE       = 2,  // Strecke
     104             :                  OBJ_RECT       = 3,  // Rechteck ww. mit runden Ecken
     105             :                  OBJ_CIRC       = 4,  // Kreis, Ellipse
     106             :                  OBJ_SECT       = 5,  // Kreissektor
     107             :                  OBJ_CARC       = 6,  // Kreisbogen
     108             :                  OBJ_CCUT       = 7,  // Kreisabschnitt
     109             :                  OBJ_POLY       = 8,  // Polygon, PolyPolygon
     110             :                  OBJ_PLIN       = 9,  // PolyLine
     111             :                  OBJ_PATHLINE   =10,  // Offene Bezierkurve
     112             :                  OBJ_PATHFILL   =11,  // Geschlossene Bezierkurve
     113             :                  OBJ_FREELINE   =12,  // Offene Freihandlinie
     114             :                  OBJ_FREEFILL   =13,  // Geschlossene Freihandlinie
     115             :                  OBJ_SPLNLINE   =14,  // Natuerlicher kubischer Spline          (ni)
     116             :                  OBJ_SPLNFILL   =15,  // Periodischer kubischer Spline          (ni)
     117             :                  OBJ_TEXT       =16,  // Textobjekt
     118             :                  OBJ_TEXTEXT    =17,  // Texterweiterungsrahmen                 (ni)
     119             :                  OBJ_wegFITTEXT,      // FitToSize-Text (alle Zeilen gleich)
     120             :                  OBJ_wegFITALLTEXT,   // FitToSize-Text (Zeilenweise)           (ni)
     121             :                  OBJ_TITLETEXT  =20,  // Titeltext. Spezial-Textobjekt fuer StarDraw
     122             :                  OBJ_OUTLINETEXT=21,  // OutlineText. Spezial-Textobjekt fuer StarDraw
     123             :                  OBJ_GRAF       =22,  // Fremdgrafik - (StarView Graphic)
     124             :                  OBJ_OLE2       =23,  // OLE-Objekt
     125             :                  OBJ_EDGE       =24,  // Verbindungsobjekt fuer Konnektoren
     126             :                  OBJ_CAPTION    =25,  // Legendenobjekt
     127             :                  OBJ_PATHPOLY   =26,  // Polygon/PolyPolygon dargestellt durch SdrPathObj
     128             :                  OBJ_PATHPLIN   =27,  // Polyline dargestellt durch SdrPathObj
     129             :                  OBJ_PAGE       =28,  // Objekt, das eine SdrPage darstellt
     130             :                  OBJ_MEASURE    =29,  // Bemassungsobjekt
     131             :                  OBJ_DUMMY      =30,  // Dummyobjekt zum speichern von Luecken (zur anschliessenden Wiederherstellung der Surrogate)
     132             :                  OBJ_FRAME      =31,  // staendig aktives OLE (PlugIn-Frame oder sowas)
     133             :                  OBJ_UNO        =32,  // Universal Network Object im SvDraw-Obj eingepackt
     134             :                  OBJ_CUSTOMSHAPE=33,  // CustomShape
     135             :                  OBJ_MEDIA      =34,  // Media shape
     136             :                  OBJ_TABLE      =35,  // Table
     137             :                  OBJ_MAXI};
     138             : 
     139             : enum SdrUserCallType {SDRUSERCALL_MOVEONLY,         // Nur verschoben, Groesse unveraendert
     140             :                       SDRUSERCALL_RESIZE,           // Groesse und evtl. auch Pos veraendert
     141             :                       SDRUSERCALL_CHGATTR,          // Attribute veraendert. Moeglicherweise neue Groesse wg. Linienbreite
     142             :                       SDRUSERCALL_DELETE,           // Obj gibt es gleich nicht mehr. Schon keine Attr mehr.
     143             :                       SDRUSERCALL_COPY,             // Zuweisungsoperator gerufen. Kann alles geaendert sein
     144             :                       SDRUSERCALL_INSERTED,         // In eine Objektliste (z.B. Page) eingefuegt
     145             :                       SDRUSERCALL_REMOVED,          // Aus der Objektliste entfernt
     146             :                       SDRUSERCALL_CHILD_MOVEONLY,   // Ein Child einer Gruppe hat sich veraendert
     147             :                       SDRUSERCALL_CHILD_RESIZE,     // Ein Child einer Gruppe hat sich veraendert
     148             :                       SDRUSERCALL_CHILD_CHGATTR,    // Ein Child einer Gruppe hat sich veraendert
     149             :                       SDRUSERCALL_CHILD_DELETE,     // Ein Child einer Gruppe hat sich veraendert
     150             :                       SDRUSERCALL_CHILD_COPY,       // Ein Child einer Gruppe hat sich veraendert
     151             :                       SDRUSERCALL_CHILD_INSERTED,   // Ein Child einer Gruppe hat sich veraendert
     152             :                       SDRUSERCALL_CHILD_REMOVED};   // Ein Child einer Gruppe hat sich veraendert
     153             : 
     154             : //************************************************************
     155             : //   Hilfsklasse SdrObjUserCall
     156             : //************************************************************
     157             : 
     158           0 : class SVX_DLLPUBLIC SdrObjUserCall
     159             : {
     160             : public:
     161             :     TYPEINFO();
     162             :     virtual ~SdrObjUserCall();
     163             :     virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect);
     164             : };
     165             : 
     166             : //************************************************************
     167             : //   Hilfsklasse SdrObjMacroHitRec
     168             : //************************************************************
     169             : 
     170             : class SVX_DLLPUBLIC SdrObjMacroHitRec
     171             : {
     172             : public:
     173             :     Point                       aPos;
     174             :     Point                       aDownPos;
     175             :     OutputDevice*               pOut;
     176             :     const SetOfByte*            pVisiLayer;
     177             :     const SdrPageView*          pPageView;
     178             :     sal_uInt16                  nTol;
     179             :     bool                        bDown;
     180             : 
     181             :     SdrObjMacroHitRec();
     182             : };
     183             : 
     184             : //************************************************************
     185             : //   Hilfsklasse SdrObjUserData
     186             : //
     187             : // Anwenderdaten an einem Zeichenobjekt, z.B. applikationsspezifische Daten.
     188             : // Jedes Zeichenobjekt kann beliebig viele dieser Records haben (SV-Liste).
     189             : // Wer hier Daten halten will, muss sich ableiten und auch an der Factory
     190             : // einen entsprechenden Link setzen.
     191             : //
     192             : //************************************************************
     193             : 
     194             : class SVX_DLLPUBLIC SdrObjUserData
     195             : {
     196             : protected:
     197             :     sal_uInt32                      nInventor;
     198             :     sal_uInt16                      nIdentifier;
     199             :     sal_uInt16                      nVersion;
     200             : 
     201             : private:
     202             :     SVX_DLLPRIVATE void operator=(const SdrObjUserData& rData);        // not implemented
     203             :     SVX_DLLPRIVATE bool operator==(const SdrObjUserData& rData) const; // not implemented
     204             :     SVX_DLLPRIVATE bool operator!=(const SdrObjUserData& rData) const; // not implemented
     205             : 
     206             : public:
     207             :     TYPEINFO();
     208             : 
     209             :     SdrObjUserData(sal_uInt32 nInv, sal_uInt16 nId, sal_uInt16 nVer);
     210             :     SdrObjUserData(const SdrObjUserData& rData);
     211             :     virtual ~SdrObjUserData();
     212             : 
     213             :     virtual SdrObjUserData* Clone(SdrObject* pObj1) const = 0; // #i71039# NULL -> 0
     214             :     sal_uInt32 GetInventor() const;
     215             :     sal_uInt16 GetId() const;
     216             : 
     217             :     virtual bool HasMacro (const SdrObject* pObj) const;
     218             :     virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
     219             :     virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
     220             :     virtual void PaintMacro (OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
     221             :     virtual bool DoMacro (const SdrObjMacroHitRec& rRec, SdrObject* pObj);
     222             :     virtual rtl::OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
     223             : };
     224             : 
     225             : //************************************************************
     226             : //   Hilfsklasse SdrObjUserDataList
     227             : //************************************************************
     228             : 
     229             : class SdrObjUserDataList
     230             : {
     231             :     typedef boost::ptr_vector<SdrObjUserData> ListType;
     232             :     ListType maList;
     233             : 
     234             : public:
     235             :     SdrObjUserDataList();
     236             :     ~SdrObjUserDataList();
     237             : 
     238             :     size_t GetUserDataCount() const;
     239             :     const SdrObjUserData* GetUserData(size_t nNum) const;
     240             :     SdrObjUserData* GetUserData(size_t nNum);
     241             :     void AppendUserData(SdrObjUserData* pData);
     242             :     void DeleteUserData(size_t nNum);
     243             : };
     244             : 
     245             : //************************************************************
     246             : //   Hilfsklasse SdrObjGeoData
     247             : //
     248             : // Alle geometrischen Daten eines beliebigen Objektes zur �bergabe an's Undo/Redo
     249             : //
     250             : //************************************************************
     251             : 
     252             : class SVX_DLLPUBLIC SdrObjGeoData
     253             : {
     254             : public:
     255             :     Rectangle                   aBoundRect;
     256             :     Point                       aAnchor;
     257             :     SdrGluePointList*           pGPL;
     258             :     bool                        bMovProt;
     259             :     bool                        bSizProt;
     260             :     bool                        bNoPrint;
     261             :     bool                        bClosedObj;
     262             :     bool                        mbVisible;
     263             :     SdrLayerID                  mnLayerID;
     264             : 
     265             : public:
     266             :     SdrObjGeoData();
     267             :     virtual ~SdrObjGeoData();
     268             : };
     269             : 
     270             : //************************************************************
     271             : //   Hilfsklasse SdrObjPlusData
     272             : //
     273             : // Bitsack fuer DrawObjekte
     274             : //
     275             : //************************************************************
     276             : 
     277             : class SdrObjPlusData
     278             : {
     279             :     friend class                SdrObject;
     280             : 
     281             :     SfxBroadcaster*             pBroadcast;    // Broadcaster, falls dieses Obj referenziert wird (bVirtObj=true). Auch fuer Konnektoren etc.
     282             :     SdrObjUserDataList*         pUserDataList; // applikationsspeziefische Daten
     283             :     SdrGluePointList*           pGluePoints;   // Klebepunkte zum Ankleben von Objektverbindern
     284             : 
     285             :     // #i68101#
     286             :     // object name, title and description
     287             :     rtl::OUString aObjName;
     288             :     rtl::OUString aObjTitle;
     289             :     rtl::OUString aObjDescription;
     290             : 
     291             : public:
     292             :     TYPEINFO();
     293             :     SdrObjPlusData();
     294             :     virtual ~SdrObjPlusData();
     295             :     virtual SdrObjPlusData* Clone(SdrObject* pObj1) const;
     296             : 
     297             :     void SetGluePoints(const SdrGluePointList& rPts);
     298             : };
     299             : 
     300             : //************************************************************
     301             : //   Hilfsklasse SdrObjTransformInfoRec
     302             : //
     303             : // gibt Auskunft ueber verschiedene Eigenschaften eines ZObjects
     304             : //
     305             : //************************************************************
     306             : 
     307             : class SVX_DLLPUBLIC SdrObjTransformInfoRec
     308             : {
     309             : public:
     310             :     bool bSelectAllowed : 1;     // false=Obj kann nicht selektiert werden
     311             :     bool bMoveAllowed : 1;       // false=Obj kann nicht verschoben werden
     312             :     bool bResizeFreeAllowed : 1; // false=Obj kann nicht frei resized werden
     313             :     bool bResizePropAllowed : 1; // false=Obj kann nichtmal proportional resized werden
     314             :     bool bRotateFreeAllowed : 1; // false=Obj kann nicht frei gedreht werden
     315             :     bool bRotate90Allowed : 1;   // false=Obj kann nichtmal im 90deg Raster gedreht werden
     316             :     bool bMirrorFreeAllowed : 1; // false=Obj kann nicht frei gespiegelt werden
     317             :     bool bMirror45Allowed : 1;   // false=Obj kann nichtmal ueber Achse im 45deg Raster gespiegelt werden
     318             :     bool bMirror90Allowed : 1;   // false=Obj kann ebenfalls nicht ueber Achse im 90deg Raster gespiegelt werden
     319             :     bool bTransparenceAllowed : 1; // false=Obj does not have an interactive transparence control
     320             :     bool bGradientAllowed : 1; // false=Obj dooes not have an interactive gradient control
     321             :     bool bShearAllowed : 1;      // false=Obj kann nicht verzerrt werden
     322             :     bool bEdgeRadiusAllowed : 1;
     323             :     bool bNoOrthoDesired : 1;    // true bei Rect; ... false bei BMP,MTF;
     324             :     bool bNoContortion : 1;      // false=Kein verzerren (bei Crook) moeglich (nur true bei PathObj und Gruppierten PathObjs)
     325             :     bool bCanConvToPath : 1;     // false=Keine Konvertierung in PathObj moeglich
     326             :     bool bCanConvToPoly : 1;     // false=Keine Konvertierung in PolyObj moeglich
     327             :     bool bCanConvToContour : 1;     // false=no conversion down to whole contour possible
     328             :     bool bCanConvToPathLineToArea : 1; // false=Keine Konvertierung in PathObj moeglich mit Wandlung von LineToArea
     329             :     bool bCanConvToPolyLineToArea : 1; // false=Keine Konvertierung in PolyObj moeglich mit Wandlung von LineToArea
     330             : 
     331             :     SdrObjTransformInfoRec();
     332             : };
     333             : 
     334             : ////////////////////////////////////////////////////////////////////////////////////////////////////
     335             : ////////////////////////////////////////////////////////////////////////////////////////////////////
     336             : //
     337             : //   @@@@  @@@@@  @@@@@@ @@@@@  @@@@  @@@@@@
     338             : //  @@  @@ @@  @@     @@ @@    @@  @@   @@
     339             : //  @@  @@ @@  @@     @@ @@    @@       @@
     340             : //  @@  @@ @@@@@      @@ @@@@  @@       @@
     341             : //  @@  @@ @@  @@     @@ @@    @@       @@
     342             : //  @@  @@ @@  @@ @@  @@ @@    @@  @@   @@
     343             : //   @@@@  @@@@@   @@@@  @@@@@  @@@@    @@
     344             : //
     345             : // Abstraktes DrawObject
     346             : //
     347             : ////////////////////////////////////////////////////////////////////////////////////////////////////
     348             : 
     349             : class SvxShape;
     350             : class SVX_DLLPUBLIC SdrObject: public SfxListener, public tools::WeakBase< SdrObject >
     351             : {
     352             : private:
     353             :     // ObjectUser section
     354             :     sdr::ObjectUserVector                                           maObjectUsers;
     355             : 
     356             : public:
     357             :     void AddObjectUser(sdr::ObjectUser& rNewUser);
     358             :     void RemoveObjectUser(sdr::ObjectUser& rOldUser);
     359             : 
     360             :     // BaseProperties section
     361             : private:
     362             :     sdr::properties::BaseProperties*                                mpProperties;
     363             : protected:
     364             :     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
     365             : public:
     366             :     virtual sdr::properties::BaseProperties& GetProperties() const;
     367             : 
     368             :     ///////////////////////////////////////////////////////////////////////////////
     369             :     // #110094# DrawContact section
     370             : private:
     371             :     sdr::contact::ViewContact*                                      mpViewContact;
     372             : protected:
     373             :     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
     374             : public:
     375             :     sdr::contact::ViewContact& GetViewContact() const;
     376             : 
     377             :     // DrawContact support: Methods for handling Object changes
     378             :     void ActionChanged() const;
     379             : 
     380             : private:
     381             :     friend class                SdrObjListIter;
     382             :     friend class                SdrVirtObj;
     383             :     friend class                SdrRectObj;
     384             : 
     385             : protected:
     386             :     Rectangle                   aOutRect;     // umschliessendes Rechteck fuer Paint (inkl. LineWdt, ...)
     387             :     Point                       aAnchor;      // Ankerposition (Writer)
     388             :     Point                       aGridOffset;  // hack (Calc)
     389             :     SdrObjList*                 pObjList;     // Liste, in dem das Obj eingefuegt ist.
     390             :     SdrPage*                    pPage;
     391             :     SdrModel*                   pModel;
     392             :     SdrObjUserCall*             pUserCall;
     393             :     SdrObjPlusData*             pPlusData;    // Broadcaster, UserData, Konnektoren, ... (Das ist der Bitsack)
     394             : 
     395             :     sal_uInt32                  nOrdNum;      // Rangnummer des Obj in der Liste
     396             : 
     397             :     /** Position in the navigation order.  SAL_MAX_UINT32 when not used.
     398             :     */
     399             :     sal_uInt32                  mnNavigationPosition;
     400             :     SdrLayerID                  mnLayerID;
     401             : 
     402             :     // Objekt zeigt nur auf ein Anderes
     403             :     bool                        bVirtObj : 1;
     404             :     bool                        bSnapRectDirty : 1;
     405             :     bool                        bNetLock : 1;   // ni
     406             :     bool                        bInserted : 1;  // nur wenn true gibt's RepaintBroadcast & SetModify
     407             :     bool                        bGrouped : 1;   // Member eines GroupObjektes?
     408             : 
     409             :     // Die folgende Flags werden gestreamt
     410             :     bool                        bMovProt : 1; // If true, the position is protected
     411             :     bool                        bSizProt : 1; // If true, the size is protected
     412             :     bool                        bNoPrint : 1; // If true, the object is not printed.
     413             :     bool                        mbVisible : 1; // If false, the object is not visible on screen (but maybe on printer, depending on bNoprint
     414             :     // Wenn bEmptyPresObj true ist, handelt es sich um ein
     415             :     // Praesentationsobjekt, dem noch kein Inhalt zugewiesen
     416             :     // wurde. Default ist das Flag auf FALSE. Die Verwaltung
     417             :     // uebernimmt die Applikation. Im Zuweisungsoperator sowie
     418             :     // beim Clone wird das Flag nicht mitkopiert!
     419             :     // Das Flag ist persistent.
     420             :     bool                        bEmptyPresObj : 1;     // Leeres Praesentationsobjekt (Draw)
     421             : 
     422             :     // true=Objekt ist als Objekt der MasterPage nicht sichtbar
     423             :     bool                        bNotVisibleAsMaster : 1;
     424             : 
     425             :     // true=Es handelt sich hierbei um ein geschlossenes Objekt, also nicht Linie oder Kreisbogen ...
     426             :     bool                        bClosedObj : 1;
     427             : 
     428             :     bool                        bIsEdge : 1;
     429             :     bool                        bIs3DObj : 1;
     430             :     bool                        bMarkProt : 1;  // Markieren verboten. Persistent
     431             :     bool                        bIsUnoObj : 1;
     432             :     bool                        bNotMasterCachable : 1;
     433             : 
     434             :     // #i25616#
     435             :     bool                        mbLineIsOutsideGeometry : 1;
     436             : 
     437             :     // #i25616#
     438             :     bool                        mbSupportTextIndentingOnLineWidthChange : 1;
     439             : 
     440             :     // on import of OLE object from MS documents the BLIP size might be retrieved,
     441             :     // in this case the following member is initialized as nonempty rectangle
     442             :     Rectangle                   maBLIPSizeRectangle;
     443             : 
     444             :     // global static ItemPool for not-yet-insetred items
     445             : private:
     446             :     static SdrItemPool*         mpGlobalItemPool;
     447             :     boost::optional<double>                                         mnRelativeWidth;
     448             :     boost::optional<double>                                         mnRelativeHeight;
     449             : public:
     450             :     static SdrItemPool& GetGlobalDrawObjectItemPool();
     451             :     void SetRelativeWidth( double nValue ) { mnRelativeWidth.reset( nValue ); }
     452             :     void SetRelativeHeight( double nValue ) { mnRelativeHeight.reset( nValue ); }
     453             :     boost::optional<double> GetRelativeWidth( ) const { return mnRelativeWidth; }
     454             :     boost::optional<double> GetRelativeHeight( ) const { return mnRelativeHeight; }
     455             :     // evil calc grid/shape drawlayer syncing
     456        1077 :     Point GetGridOffset() const { return aGridOffset; }
     457           0 :     void SetGridOffset( const Point& rGridOffset ){ aGridOffset = rGridOffset; }
     458             : protected:
     459             :     void ImpDeleteUserData();
     460             :     SdrObjUserData* ImpGetMacroUserData() const;
     461             :     Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
     462             : 
     463             :     // Fuer GetDragComment
     464             :     void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, rtl::OUString& rStr, sal_uInt16 nVal=0) const;
     465             : 
     466             :     void ImpForcePlusData();
     467             : 
     468             :     rtl::OUString GetWinkStr(long nWink, bool bNoDegChar = false) const;
     469             :     rtl::OUString GetMetrStr(long nVal, MapUnit eWantMap=MAP_MM, bool bNoUnitChars = false) const;
     470             : 
     471             :     // bNotMyself=true bedeutet: Nur die ObjList auf Dirty setzen, nicht mich.
     472             :     // Wird z.B. benoetigt fuer NbcMove, denn da movt man SnapRect und aOutRect
     473             :     // i.d.R. gleich mit um die Neuberechnung zu sparen.
     474             : public:
     475             :     virtual void SetRectsDirty(sal_Bool bNotMyself = false);
     476             : protected:
     477             : 
     478             :     // ueberladen, wenn man sich von SdrObjPlusData abgeleitet hat:
     479             :     virtual SdrObjPlusData* NewPlusData() const;
     480             : 
     481             : protected:
     482             :     // Diese 3 Methoden muss ein abgeleitetes Objekt ueberladen, wenn es eigene
     483             :     // geometrische Daten besitzt, die fuer den Undo-Fall gesichert werden
     484             :     // sollen. NewGeoData() erzeugt lediglich eine leere Instanz auf eine von
     485             :     // SdrObjGeoData abgeleitete Klasse.
     486             :     virtual SdrObjGeoData* NewGeoData() const;
     487             :     virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
     488             :     virtual void RestGeoData(const SdrObjGeoData& rGeo);
     489             : 
     490             : protected:
     491             :     virtual ~SdrObject();
     492             : 
     493             : public:
     494             :     TYPEINFO();
     495             :     SdrObject();
     496             : 
     497             :     /** frees the SdrObject pointed to by the argument
     498             : 
     499             :         In case the object has an SvxShape, which has the ownership of the object, it
     500             :         is actually *not* deleted.
     501             :     */
     502             :     static  void    Free( SdrObject*& _rpObject );
     503             : 
     504             :     // This method is only for access from Property objects
     505             :     virtual void SetBoundRectDirty();
     506             : 
     507             :     virtual void SetObjList(SdrObjList* pNewObjList);
     508             :     SdrObjList* GetObjList() const;
     509             : 
     510             :     virtual void SetPage(SdrPage* pNewPage);
     511             :     SdrPage* GetPage() const;
     512             : 
     513             :     virtual void SetModel(SdrModel* pNewModel);
     514             :     SdrModel* GetModel() const;
     515             :     SdrItemPool* GetObjectItemPool() const;
     516             : 
     517             :     void AddListener(SfxListener& rListener);
     518             :     void RemoveListener(SfxListener& rListener);
     519             :     const SfxBroadcaster* GetBroadcaster() const;
     520             : 
     521             :     virtual void AddReference(SdrVirtObj& rVrtObj);
     522             :     virtual void DelReference(SdrVirtObj& rVrtObj);
     523             :     virtual sal_uInt32 GetObjInventor() const;
     524             :     virtual sal_uInt16 GetObjIdentifier() const;
     525             :     virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
     526             : 
     527             :     // Layer interface
     528             :     virtual SdrLayerID GetLayer() const;
     529             :     virtual void NbcSetLayer(SdrLayerID nLayer);
     530             :     virtual void SetLayer(SdrLayerID nLayer);
     531             :     // renaming GetLayerSet -> getMergedHierarchyLayerSet to make clear what happens here. rSet needs to be empty.
     532             :     virtual void getMergedHierarchyLayerSet(SetOfByte& rSet) const;
     533             : 
     534             :     // UserCall interface
     535             :     void SetUserCall(SdrObjUserCall* pUser);
     536             :     SdrObjUserCall* GetUserCall() const;
     537             :     void SendUserCall(SdrUserCallType eUserCall, const Rectangle& rBoundRect) const;
     538             : 
     539             :     // Ein solcher Referenzpunkt ist z.B. der Punkt eines Symbols, der
     540             :     // der beim Einfuegen des Symbols auf das Raster gefangen werden soll
     541             :     // oder der Fixpunkt eines Bildes innerhalb eines Animationsobjektes.
     542             :     virtual bool HasRefPoint() const;
     543             :     virtual Point GetRefPoint() const;
     544             :     virtual void SetRefPoint(const Point& rPnt);
     545             : 
     546             :     // #i68101#
     547             :     // An object may have a user-set Name (Get/SetName()), e.g SdrGrafObj, SdrObjGroup
     548             :     // or SdrOle2Obj.
     549             :     // It may also have a Title and a Description for accessibility purposes.
     550             :     void SetName(const rtl::OUString& rStr);
     551             :     rtl::OUString GetName() const;
     552             :     void SetTitle(const rtl::OUString& rStr);
     553             :     rtl::OUString GetTitle() const;
     554             :     void SetDescription(const rtl::OUString& rStr);
     555             :     rtl::OUString GetDescription() const;
     556             : 
     557             :     // Fuer Gruppenobjekte
     558             :     bool IsGroupObject() const;
     559             :     virtual SdrObjList* GetSubList() const;
     560             :     SdrObject* GetUpGroup() const;
     561             : 
     562             :     // Ueber die Objekt-Ordnungsnummer kann man feststellen, ob ein Objekt vor
     563             :     // oder hinter einem anderen liegt. Objekte mit kleinen Ordnungsnummern werden
     564             :     // zuerst gezeichnet, Objekte mit grossen Ordnungsnummern zuletzt.
     565             :     // Wird die Reihenfolge der Objekte in der Liste veraendert, so wird ein
     566             :     // Dirty-Flag gesetzt (an der Page). Beim naechsten SdrObject::GetOrdNum()
     567             :     // werden die Ordnungsnummer aller Objekte der Liste neu bestimmt.
     568             :     sal_uInt32 GetOrdNum() const;
     569             : 
     570             :     // Diese Methode sollte nur verwendet werden, wenn man ganz  genau weiss,
     571             :     // was man macht:
     572             :     sal_uInt32 GetOrdNumDirect() const;
     573             : 
     574             :     // Das Setzen der Ordnungsnummer sollte nur vom Model bzw. von der Page
     575             :     // geschehen.
     576             :     void SetOrdNum(sal_uInt32 nNum);
     577             : 
     578             :     /** Return the position in the navigation order for the called object.
     579             :         Note that this method may update the navigation position of the
     580             :         called and of other SdrObjects.  Therefore this method can not be
     581             :         const.
     582             :         @return
     583             :             If no navigation position has been explicitly defined then the
     584             :             result of GetOrdNum() is returned.
     585             :     */
     586             :     sal_uInt32 GetNavigationPosition (void);
     587             : 
     588             :     /** Set the position in the navigation position to the given value.
     589             :         This method is typically used only by the model after a change to
     590             :         the navigation order.
     591             :         This method does not change the navigation position of other
     592             :         objects.
     593             :         Use SdrObjList::SetObjectNavigationPosition() instead.
     594             :     */
     595             :     void SetNavigationPosition (const sal_uInt32 nPosition);
     596             : 
     597             :     // #111111#
     598             :     // To make clearer that this method may trigger RecalcBoundRect and thus may be
     599             :     // expensive and somtimes problematic (inside a bigger object change You will get
     600             :     // non-useful BoundRects sometimes) i rename that method from GetBoundRect() to
     601             :     // GetCurrentBoundRect().
     602             :     virtual const Rectangle& GetCurrentBoundRect() const;
     603             : 
     604             :     // #111111#
     605             :     // To have a possibility to get the last calculated BoundRect e.g for producing
     606             :     // the first rectangle for repaints (old and new need to be used) without forcing
     607             :     // a RecalcBoundRect (which may be problematical and expensive sometimes) i add here
     608             :     // a new method for accessing the last BoundRect.
     609             :     virtual const Rectangle& GetLastBoundRect() const;
     610             : 
     611             :     virtual void RecalcBoundRect();
     612             : 
     613             :     void BroadcastObjectChange() const;
     614             : 
     615             :     // Modified-Flag am Model setzen
     616             :     virtual void SetChanged();
     617             : 
     618             :     // Tooling for painting a single object to a OutputDevice. This will be needed as long
     619             :     // as not all painting is changed to use DrawContact objects.
     620             :     bool SingleObjectPainter(OutputDevice& rOut) const;
     621             :     bool LineGeometryUsageIsNecessary() const;
     622             : 
     623             :     /**
     624             :       Returns a copy of the object. Every inherited class must reimplement this (in class Foo
     625             :       it should be sufficient to do "virtual Foo* Clone() const { return CloneHelper< Foo >(); }".
     626             :       Note that this function uses operator= internally.
     627             :     */
     628             :     virtual SdrObject* Clone() const;
     629             :     /**
     630             :       Implemented mainly for the purposes of Clone().
     631             :     */
     632             :     SdrObject& operator=(const SdrObject& rObj);
     633             : 
     634             :     // TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
     635             :     virtual void TakeObjNameSingul(String& rName) const;
     636             :     virtual void TakeObjNamePlural(String& rName) const;
     637             : 
     638             :     // Das Xor-Polygon wird von der View zu Draggen des Objektes benoetigt.
     639             :     // Alle Polygone innerhalb des PolyPolygon werden als PolyLine interpretiert.
     640             :     // Moechte man ein geschlossenes Polygon, so muss man es explizit schliessen.
     641             :     virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
     642             : 
     643             :     // Die Kontur fuer TextToContour
     644             :     virtual basegfx::B2DPolyPolygon TakeContour() const;
     645             : 
     646             :     // Ueber GetHdlCount gibt ein Objekt die Anzahl seiner Handles preis.
     647             :     // Im Normalfall werden dies 8 sein, bei einer Strecke 2. Bei Polygonobjekten
     648             :     // (Polygon,Spline,Bezier) kann die Handleanzahl wesentlich groesser werden.
     649             :     // Polygonobjekten wird ausserdem die Moeglichkeit eingeraeumt einen Punkt
     650             :     // eines selektierten Objekts zu selektieren. Das Handle dieses Punktes wird
     651             :     // dann durch einen Satz neuer Handles ausgetauscht (PlusHdl). Bei einem
     652             :     // Polygon wird das wohl ein einfacher Selektionshandle sein, bei einer
     653             :     // Bezierkurve dagegen koennen das schon bis zu 3 Handles werden (inkl Gewichte).
     654             :     // GetHdl() und GetPlusHdl() muessen Handleinstanzen mit new erzeugen!
     655             :     // Ein Objekt, das bei HasSpacialDrag() true liefert muss diese Methoden
     656             :     // zur Verfuegung stellen (inkl. FillHdlList).
     657             :     virtual sal_uInt32 GetHdlCount() const;
     658             :     virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
     659             :     virtual sal_uInt32 GetPlusHdlCount(const SdrHdl& rHdl) const;
     660             :     virtual SdrHdl* GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlNum) const;
     661             :     virtual void AddToHdlList(SdrHdlList& rHdlList) const;
     662             : 
     663             :     // Die Standardtransformationen (Move,Resize,Rotate,Mirror,Shear) werden von der
     664             :     // View uebernommen (TakeXorPoly(),...).
     665             :     // Objektspeziefisches draggen wie z.B. Eckenradius bei Rechtecken,
     666             :     // Stuetzstellen bei Splines, Gewichte bei Bezierkurven und Pointer von
     667             :     // Labelobjekten muss vom Objekt selbst gehandled werden. Um das Model
     668             :     // Statusfrei zu halten werden die Statusdaten an der View gehalten und dem
     669             :     // Objekt dann uebergeben. EndDrag liefrt im Normalfall true fuer Erfolg.
     670             :     // false kann zurueckgegeben werden, wenn das Dragging das Objekt nicht
     671             :     // veraendert hat, wobei dir evtl. Tatsache das die Maus nicht bewegt wurde
     672             :     // bereits von der View abgefangen wird.
     673             :     virtual bool hasSpecialDrag() const;
     674             :     virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
     675             :     virtual bool applySpecialDrag(SdrDragStat& rDrag);
     676             :     virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
     677             :     virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const;
     678             : 
     679             :     // FullDrag support. This is for standard interactions and for SdrObjOwn
     680             :     // support. If supportsFullDrag() returns true, getFullDragClone has to
     681             :     // return a cloned SdrObject (who's ownership it loses) at which modifications
     682             :     // like Move(), Scale(), etc or applySpecialDrag() will be executed. That
     683             :     // object will be visualized on overlay for full drag, but should not be
     684             :     // part of the model, thus not changing anything since it's only a temporary
     685             :     // helper object for interaction
     686             :     virtual bool supportsFullDrag() const;
     687             :     virtual SdrObject* getFullDragClone() const;
     688             : 
     689             :     // Jedes Objekt muss in der Lage sein sich selbst interaktiv zu erzeugen.
     690             :     // Beim MausDown wird zunaechst ein neues Objekt erzeugt und dann seine
     691             :     // BegCreate()-Methode gerufen. Bei jedem MausMode wird dann MovCreate
     692             :     // gerufen. BrkCreate() bedeutet, dass der User die interaktive Objekt-
     693             :     // erzeugung abgebrochen hat. EndCreate() wird gerufen beim MouseUp-Event.
     694             :     // Liefert EndCreate() ein true, so ist die Objekterzeugung abgeschlossen;
     695             :     // das Objekt wird in die entsprechende Liste eingefuegt. Andernfalls
     696             :     // (EndCreate()==false) gehe ich davon aus, dass weitere Punkte zur
     697             :     // Objekterzeugung notwendig sind (Polygon,...). Der Parameter eCmd
     698             :     // enthaelt die Anzahl der Mausklicks (so die App diese durchreicht).
     699             :     // BckCreate() -> Letztes EndCreate() rueckgaengig machen (z.B. letzten
     700             :     // Polygonpunkt wieder loeschen).
     701             :     // RetrunCode: true=Weiter gehts, false=Create dadurch abgebrochen.
     702             :     virtual bool BegCreate(SdrDragStat& rStat);
     703             :     virtual bool MovCreate(SdrDragStat& rStat); // TRUE=Xor muss repainted werden
     704             :     virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
     705             :     virtual bool BckCreate(SdrDragStat& rStat);
     706             :     virtual void BrkCreate(SdrDragStat& rStat);
     707             : 
     708             :     // damit holt man sich den Pointer, der das Createn dieses Objekts symbolisiert
     709             :     virtual Pointer GetCreatePointer() const;
     710             : 
     711             :     // Polygon das waehrend des Erzeugens aufgezogen wird
     712             :     virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
     713             : 
     714             :     // Die Methoden Move, Resize, Rotate, Mirror, Shear, SetSnapRect und
     715             :     // SetLogicRect rufen jeweils die entsprechenden Nbc-Methoden, versenden einen
     716             :     // Repaint-Broadcast und setzen den Modified-Status am Model. Abgeleitete
     717             :     // Objekte sollten i.d.R. nur die Nbc-Methoden ueberladen.
     718             :     // Nbc bedeutet: 'NoBroadcast'.
     719             :     virtual void NbcMove  (const Size& rSiz);
     720             :     virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
     721             :     virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
     722             :     virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
     723             :     virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear);
     724             : 
     725             :     virtual void Move  (const Size& rSiz);
     726             :     virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true);
     727             :     virtual void Rotate(const Point& rRef, long nWink, double sn, double cs);
     728             :     virtual void Mirror(const Point& rRef1, const Point& rRef2);
     729             :     virtual void Shear (const Point& rRef, long nWink, double tn, bool bVShear);
     730             : 
     731             :     // Die relative Position eines Zeichenobjektes ist die Entfernung der
     732             :     // linken oberen Eche des logisch umschliessenden Rechtecks (SnapRect)
     733             :     // zum Anker.
     734             :     virtual void NbcSetRelativePos(const Point& rPnt);
     735             :     virtual void SetRelativePos(const Point& rPnt);
     736             :     virtual Point GetRelativePos() const;
     737             :     void ImpSetAnchorPos(const Point& rPnt);
     738             :     virtual void NbcSetAnchorPos(const Point& rPnt);
     739             :     virtual void SetAnchorPos(const Point& rPnt);
     740             :     virtual const Point& GetAnchorPos() const;
     741             : 
     742             :     // Snap wird nicht auf dem BoundRect ausgefuehrt, sondern nach Moeglichkeit auf
     743             :     // logischen Koordinaten (also ohne Beruecksichtigung von Strichstaerke, ... ).
     744             :     // SetSnapRect() versucht das Objekt so hinzusizen, dass es in das uebergebene
     745             :     // Rect passt (ohne Strichstaerke, ...)
     746             :     virtual void RecalcSnapRect();
     747             :     virtual const Rectangle& GetSnapRect() const;
     748             :     virtual void SetSnapRect(const Rectangle& rRect);
     749             :     virtual void NbcSetSnapRect(const Rectangle& rRect);
     750             : 
     751             :     // Logic Rect: Beim Rect z.B. ohne Beruecksichtigung des Drehwinkels, Shear, ...
     752             :     virtual const Rectangle& GetLogicRect() const;
     753             :     virtual void SetLogicRect(const Rectangle& rRect);
     754             :     virtual void NbcSetLogicRect(const Rectangle& rRect);
     755             : 
     756             :     /** the defaul is to set the logic rect to the given rectangle rMaxRect. If the shape
     757             :         has an intrinsic aspect ratio it may set the logic rect so the aspect
     758             :         ratio is kept but still inside the rectangle rMaxRect.
     759             : 
     760             :         If bShrinkOnly is set to true, the size of the current logic rect will not
     761             :         be changed if it is smaller than the given rectangle rMaxRect. */
     762             :     virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
     763             : 
     764             :     // Drehwinkel und Shear
     765             :     virtual long GetRotateAngle() const;
     766             :     virtual long GetShearAngle(bool bVertical = false) const;
     767             : 
     768             :     // Zum Fangen von/auf ausgezeichneten Punkten eines Obj (Polygonpunkte,
     769             :     // Kreismittelpunkt, ...)
     770             :     virtual sal_uInt32 GetSnapPointCount() const;
     771             :     virtual Point GetSnapPoint(sal_uInt32 i) const;
     772             : 
     773             :     // Fuer Objekte, bei denen jeder einzelne Punkt verschoben werden kann,
     774             :     // z.B. Polygone, Polylines, Linien, ... . Bei diesen Objekten werden
     775             :     // Punkte selektiert (ggf. Mehrfachselektion), geloescht, eingefuegt,
     776             :     // als Mehrfachselektion verschoben und gedreht, ...
     777             :     // Nur solche Objekte koennen PlusHandles haben (z.B. die Gewichte an den
     778             :     // Bezierkurven.
     779             :     virtual sal_Bool IsPolyObj() const;
     780             :     virtual sal_uInt32 GetPointCount() const;
     781             :     virtual Point GetPoint(sal_uInt32 i) const;
     782             :     void SetPoint(const Point& rPnt, sal_uInt32 i);
     783             :     virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i);
     784             : 
     785             :     // Alle geometrischen Daten holen fuer's Undo/Redo
     786             :     virtual SdrObjGeoData* GetGeoData() const;
     787             :     virtual void SetGeoData(const SdrObjGeoData& rGeo);
     788             : 
     789             :     // ItemSet access
     790             :     const SfxItemSet& GetMergedItemSet() const;
     791             :     void SetMergedItem(const SfxPoolItem& rItem);
     792             :     void ClearMergedItem(const sal_uInt16 nWhich = 0);
     793             :     void SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems = false);
     794             :     const SfxPoolItem& GetMergedItem(const sal_uInt16 nWhich) const;
     795             : 
     796             :     // internal versions
     797             : protected:
     798             :     const SfxItemSet& GetObjectItemSet() const;
     799             :     void SetObjectItem(const SfxPoolItem& rItem);
     800             :     void SetObjectItemSet(const SfxItemSet& rSet);
     801             :     const SfxPoolItem& GetObjectItem(const sal_uInt16 nWhich) const;
     802             : 
     803             : public:
     804             :     // syntactical sugar for ItemSet accesses
     805             :     void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems = false);
     806             : 
     807             :     // NotPersistAttr fuer Layer, ObjName, geometrische Transformationen, ...
     808             :     void TakeNotPersistAttr(SfxItemSet& rAttr, bool bMerge) const;
     809             :     void ApplyNotPersistAttr(const SfxItemSet& rAttr);
     810             :     void NbcApplyNotPersistAttr(const SfxItemSet& rAttr);
     811             : 
     812             :     // bDontRemoveHardAttr=FALSE: alle in der Vorlage gesetzten Attribute werden am
     813             :     // Zeichenobjekt auf Default gesetzt; TRUE: alle harten Attribute bleiben erhalten.
     814             :     void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
     815             :     virtual void NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
     816             :     SfxStyleSheet* GetStyleSheet() const;
     817             : 
     818             :     // TextEdit
     819             :     virtual bool HasTextEdit() const;
     820             : 
     821             :     // Return==TRUE: TextEditMode gestartet
     822             :     virtual sal_Bool BegTextEdit(SdrOutliner& rOutl);
     823             :     virtual void EndTextEdit(SdrOutliner& rOutl);
     824             : 
     825             :     // Text wird im Format des Outliners gehalten
     826             :     // SetOutlinerParaObject: Eigentumsuebereignung von *pTextObject!
     827             :     virtual void SetOutlinerParaObject(OutlinerParaObject* pTextObject);
     828             :     virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
     829             :     virtual OutlinerParaObject* GetOutlinerParaObject() const;
     830             :     virtual void NbcReformatText();
     831             :     virtual void ReformatText();
     832             : 
     833             :     void BurnInStyleSheetAttributes();
     834             : 
     835             :     // Macrofaehigkeit, z.B. ein Rechteck als PushButton.
     836             :     virtual bool HasMacro() const;
     837             :     virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec) const;
     838             :     virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec) const;
     839             :     virtual void PaintMacro (OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const;
     840             :     virtual bool DoMacro (const SdrObjMacroHitRec& rRec);
     841             :     virtual rtl::OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
     842             :     bool IsMacroHit(const SdrObjMacroHitRec& rRec) const;
     843             : 
     844             :     // Konnektoren. (siehe auch Dokumentation in SvdoEdge.HXX, SdrEdgeObj
     845             :     //               sowie SvdGlue.HXX und SvdGlEV.HXX)
     846             :     // Es gibt Knoten und Kanten. Eine Kante kann theoretisch auch Knoten
     847             :     // sein, das ist jedoch in dieser Version noch nicht implementiert.
     848             :     // Ein Knoten hat eine Anzahl von Klebepunkten, wo Kanten angeklebt
     849             :     // werden koennen.
     850             :     // Eine Kante kann
     851             :     // - ohne Verbindungen sein
     852             :     // - an einem Ende auf der Wiese stehen und am anderen Ende an
     853             :     //   genau einem Knoten gebunden sein
     854             :     // - an beiden Enden mit jeweils genau einem Knoten verbunden sein.
     855             :     // Die Kante ist Listener bei seinen bis zu 2 Knoten.
     856             :     // Wird der Knoten verschoben oder Resized, folgen alle angebundenen
     857             :     // Kanten. Ebenso bei SetGluePoint()... am Knoten.
     858             :     // Beim Verschieben/Resizen der Kante wird dagegen die Verbindung
     859             :     // geloesst.
     860             :     // Objekt ist ein Knoten?
     861             :     virtual bool IsNode() const;
     862             : 
     863             :     // Automatische Klebepunkte:
     864             :     // je 4 Scheitelpunkt- und Eckpositionen muss ein Knotenobjekt liefern
     865             :     // i.d.R. 0=oben, 1=rechts, 2=unten, 3=links
     866             :     virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const;
     867             : 
     868             :     // i.d.R. 0=linksoben, 1=rechtsoben, 2=rechtsunten, 3=linksunten
     869             :     virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const;
     870             : 
     871             :     // Liste aller Klebepunkte. Kann NULL sein.
     872             :     virtual const SdrGluePointList* GetGluePointList() const;
     873             :     //virtual SdrGluePointList* GetGluePointList();
     874             : 
     875             :     // Nach veraendern der GluePointList muss man am Obj SendRepaintBroadcast rufen!
     876             :     virtual SdrGluePointList* ForceGluePointList();
     877             : 
     878             :     // Temporaer zu setzen fuer Transformationen am Bezugsobjekt
     879             :     void SetGlueReallyAbsolute(bool bOn);
     880             :     void NbcRotateGluePoints(const Point& rRef, long nWink, double sn, double cs);
     881             :     void NbcMirrorGluePoints(const Point& rRef1, const Point& rRef2);
     882             :     void NbcShearGluePoints (const Point& rRef, long nWink, double tn, bool bVShear);
     883             : 
     884             :     // Objekt ist eine Kante?
     885             :     virtual bool IsEdge() const;
     886             : 
     887             :     // bTail1=TRUE: Linienanfang, sonst LinienEnde
     888             :     // pObj=NULL: Disconnect
     889             :     virtual void ConnectToNode(bool bTail1, SdrObject* pObj);
     890             :     virtual void DisconnectFromNode(bool bTail1);
     891             :     virtual SdrObject* GetConnectedNode(bool bTail1) const;
     892             : 
     893             :     /** sets the writing mode of the object's context
     894             : 
     895             :         Objects which itself do not support different writing modes will ignore this call.
     896             : 
     897             :         Objects which support different writing modes, but have an own, explicit writing mode set,
     898             :         will also ignore this call.
     899             : 
     900             :         Objects which support different writing modes, and whose own mode is set to css.text.WritingMode2.CONTEXT,
     901             :         will use the given writing mode to calculate their "effective writing mode".
     902             : 
     903             :         The behaviour of this method is undefined if you pass css.text.WritingMode2.CONTEXT.
     904             : 
     905             :         @param _nContextWritingMode
     906             :             the effective writing mode of the context of the object
     907             :     */
     908             :     virtual void    SetContextWritingMode( const sal_Int16 _nContextWritingMode );
     909             : 
     910             :     // Wenn ein Objekt in der Lage ist, sich in ein Polygon oder in eine
     911             :     // Bezierkurve (oder beides) zu verwandeln, dann sollten die folgenden
     912             :     // Methoden ueberladen werden.
     913             :     // Z.B. Ein RectObj mit Strichstaerke 10, SOLID_PEN in Polygon wandeln:
     914             :     // Im Modus bLineToArea=false soll ein PolyObj mit 4 Stuetzstellen,
     915             :     // Strichstaerke 10 und SOLiD_PEN erzeugt werden.
     916             :     // Im Modus bLineToArea=true dagegen soll das generierte Obj immer ein
     917             :     // LinienAttribut NULL_PEN haben, und die Linie (auch Linienmuster) selbst
     918             :     // durch Polygonflaechen emuliert werden, die dadurch anschliessend vom
     919             :     // Anwender manipuliert werden koennen. Das RectObj kann sich somit also
     920             :     // nur korrekt konvertieren, wenn es als Flaechenattribut NULL_BRUSH
     921             :     // besitzt. Es muesste in diesem Fall dann:
     922             :     // - SOLID_BRUSH mit der Farbe des gesetzten Pen setzen
     923             :     // - NULL_PEN setzen
     924             :     // - PolyPolygon mit 2 Polygonen zu je 4 Stuetzstellen generieren.
     925             :     // Der Returnwert ist jeweils ein SdrObject*, da als Rueckgabe zur Not
     926             :     // auch Gruppenobjekte erlaubt sind (z.B. fuer SdrTextObj).
     927             :     // Bei der Konvertierung von TextObj nach PathObj wird es wohl so sein,
     928             :     // dass beide Modi (bLineToArea=true/false) identisch sind.
     929             :     // Defaulted sind diese Methoden auf "Ich kann das nicht" (FALSE/NULL).
     930             :     virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
     931             :     SdrObject* ConvertToPolyObj(bool bBezier, bool bLineToArea) const;
     932             : 
     933             :     // convert this path object to contour object; bForceLineDash converts even
     934             :     // when there is no filled new polygon created from line-to-polygon conversion,
     935             :     // specially used for XLINE_DASH and 3D conversion
     936             :     SdrObject* ConvertToContourObj(SdrObject* pRet, bool bForceLineDash = false) const;
     937             :     SdrObject* ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDash = false) const;
     938             : 
     939             :     // TRUE: Referenz auf ein Obj
     940             :     bool IsVirtualObj() const;
     941             : 
     942             :     // true=Obj kann warsch. gefuellt werden; false=Obj kann warsch. Linienenden haben.
     943             :     // ungueltig, wenn es sich um ein GroupObj handelt.
     944             :     bool IsClosedObj() const;
     945             : 
     946             :     bool IsEdgeObj() const;
     947             :     bool Is3DObj() const;
     948             :     bool IsUnoObj() const;
     949             :     void SetMarkProtect(bool bProt);
     950             :     bool IsMarkProtect() const;
     951             :     void SetInserted(bool bIns);
     952             :     bool IsInserted() const;
     953             :     void SetMoveProtect(bool bProt);
     954             :     bool IsMoveProtect() const;
     955             :     void SetResizeProtect(bool bProt);
     956             :     bool IsResizeProtect() const;
     957             :     void SetPrintable(bool bPrn);
     958             :     bool IsPrintable() const;
     959             :     void SetVisible(bool bVisible);
     960             :     bool IsVisible() const;
     961             :     void SetEmptyPresObj(bool bEpt);
     962             :     bool IsEmptyPresObj() const;
     963             :     void SetNotVisibleAsMaster(bool bFlg);
     964             :     bool IsNotVisibleAsMaster() const;
     965             : 
     966             :     // #i25616#
     967             :     bool LineIsOutsideGeometry() const;
     968             : 
     969             :     // #i25616#
     970             :     bool DoesSupportTextIndentingOnLineWidthChange() const;
     971             : 
     972             :     // applikationsspeziefische Daten
     973             :     sal_uInt16 GetUserDataCount() const;
     974             :     SdrObjUserData* GetUserData(sal_uInt16 nNum) const;
     975             : 
     976             :     void AppendUserData(SdrObjUserData* pData);
     977             : 
     978             :     // Delete entfernt den Record aus der Liste und ruft
     979             :     // ein delete (FreeMem+Dtor).
     980             :     void DeleteUserData(sal_uInt16 nNum);
     981             : 
     982             :     // ItemPool fuer dieses Objekt wechseln
     983             :     void MigrateItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
     984             : 
     985             :     ////////////////////////////////////////////////////////////////////////////////////////////////////
     986             :     // access to the UNO representation of the shape
     987             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape();
     988       10547 :     ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface > getWeakUnoShape() const { return maWeakUnoShape; }
     989             : 
     990             :     static SdrObject* getSdrObjectFromXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xInt );
     991             : 
     992             :     /** Sets a new UNO representation of the shape
     993             :       *
     994             :       * This is only a public interface function. The actual work is
     995             :       * done by impl_setUnoShape().
     996             :       *
     997             :       * Calling this function is only allowed for the UNO representation
     998             :       * itself!
     999             :       */
    1000             :     void setUnoShape(
    1001             :             const com::sun::star::uno::Reference<
    1002             :                 com::sun::star::uno::XInterface>& _rxUnoShape);
    1003             : 
    1004             :     /** retrieves the instance responsible for notifying changes in the properties of the shape associated with
    1005             :         the SdrObject
    1006             : 
    1007             :         @precond
    1008             :             There already exists an SvxShape instance associated with the SdrObject
    1009             :         @throws ::com::sun::star::uno::RuntimeException
    1010             :             if there does nt yet exists an SvxShape instance associated with the SdrObject.
    1011             :     */
    1012             :     ::svx::PropertyChangeNotifier&
    1013             :         getShapePropertyChangeNotifier();
    1014             : 
    1015             :     /** notifies a change in the given property, to all applicable listeners registered at the associated SvxShape
    1016             : 
    1017             :         This method is equivalent to calling getShapePropertyChangeNotifier().notifyPropertyChange( _eProperty ),
    1018             :         exception that it is allowed to be called when there does not yet exist an associated SvxShape - in which
    1019             :         case the method will silently return without doing anything.
    1020             :     */
    1021             :     void    notifyShapePropertyChange( const ::svx::ShapeProperty _eProperty ) const;
    1022             : 
    1023             :     ////////////////////////////////////////////////////////////////////////////////////////////////////
    1024             :     //
    1025             :     // transformation interface for StarOfficeAPI. This implements support for
    1026             :     // homogen 3x3 matrices containing the transformation of the SdrObject. At the
    1027             :     // moment it contains a shearX, rotation and translation, but for setting all linear
    1028             :     // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
    1029             :     //
    1030             :     // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
    1031             :     // with the base geometry and returns TRUE. Otherwise it returns FALSE.
    1032             :     virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const;
    1033             : 
    1034             :     // sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
    1035             :     // If it's an SdrPathObj it will use the provided geometry information. The Polygon has
    1036             :     // to use (0,0) as upper left and will be scaled to the given size in the matrix.
    1037             :     virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
    1038             : 
    1039             :     // #116168#
    1040             :     // Give info if object is in destruction
    1041             :     bool IsInDestruction() const;
    1042             : 
    1043             :     // return if fill is != XFILL_NONE
    1044             :     bool HasFillStyle() const;
    1045             :     bool HasLineStyle() const;
    1046             : 
    1047             :     // on import of OLE object from MS documents the BLIP size might be retrieved,
    1048             :     // the following methods are used to control it;
    1049             :     // usually this data makes no sence after the import is finished, since the object
    1050             :     // might be resized
    1051             :     Rectangle GetBLIPSizeRectangle() const;
    1052             :     void SetBLIPSizeRectangle( const Rectangle& aRect );
    1053             : 
    1054             : protected:
    1055             :     /** Sets a new UNO shape
    1056             :       *
    1057             :       * The default implementation of this function sets the new UNO
    1058             :       * shape. Derived classes should override the function to handle
    1059             :       * any other actions that are needed when the shape is being
    1060             :       * changed.
    1061             :       *
    1062             :       * The implementation _must_ call the same method of its parent
    1063             :       * class (preferably as the first step)!
    1064             :       */
    1065             :     virtual void    impl_setUnoShape( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxUnoShape );
    1066             : 
    1067             :     /**
    1068             :      Helper function for reimplementing Clone().
    1069             :     */
    1070             :     template< typename T > T* CloneHelper() const;
    1071             : 
    1072             : private:
    1073             :     /** only for internal use!
    1074             :     */
    1075             :     SvxShape* getSvxShape() const;
    1076             : 
    1077             :     /** do not use directly, always use getSvxShape() if you have to! */
    1078             :     SvxShape*   mpSvxShape;
    1079             :     ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface >
    1080             :                 maWeakUnoShape;
    1081             : };
    1082             : 
    1083             : //************************************************************
    1084             : //   SdrDummyObj
    1085             : //
    1086             : // Wer sich eigene Objekte schafft muss einen Link in der Klasse
    1087             : // SdrObjFactory setzen. Der Handler hat folgendes aussehen:
    1088             : //    void Hdl(SdrObjFactory*)
    1089             : // Er muss sich aus der uebergebenen Instanz die Werte nInventor und
    1090             : // nIdentifier ansehen und entsprechend mit new eine Zeichenobjektinstanz
    1091             : // erzeugen. Einen Zeiger auf diese Instanz hat er in der Membervariablen
    1092             : // pNewObj zu hinterlassen.
    1093             : //
    1094             : //************************************************************
    1095             : 
    1096             : class SVX_DLLPUBLIC SdrObjFactory
    1097             : {
    1098             : public:
    1099             :     sal_uInt32                      nInventor;
    1100             :     sal_uInt16                      nIdentifier;
    1101             : 
    1102             :     // fuer MakeNewObj():
    1103             :     SdrPage*                    pPage;
    1104             :     SdrModel*                   pModel;
    1105             :     SdrObject*                  pNewObj;
    1106             : 
    1107             :     // fuer MakeNewObjUserData():
    1108             :     SdrObject*                  pObj;
    1109             :     SdrObjUserData*             pNewData;
    1110             : 
    1111             : private:
    1112             :     SVX_DLLPRIVATE SdrObjFactory(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pNewPage, SdrModel* pNewModel);
    1113             : 
    1114             : public:
    1115             :     static SdrObject* MakeNewObject(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pPage, SdrModel* pModel=NULL);
    1116             :     static void InsertMakeObjectHdl(const Link& rLink);
    1117             :     static void RemoveMakeObjectHdl(const Link& rLink);
    1118             :     static void InsertMakeUserDataHdl(const Link& rLink);
    1119             :     static void RemoveMakeUserDataHdl(const Link& rLink);
    1120             : };
    1121             : 
    1122             : typedef tools::WeakReference< SdrObject > SdrObjectWeakRef;
    1123             : 
    1124           4 : template< typename T > T* SdrObject::CloneHelper() const
    1125             : {
    1126             :     OSL_ASSERT( typeid( T ) == typeid( *this ));
    1127           4 :     T* pObj = dynamic_cast< T* >( SdrObjFactory::MakeNewObject(GetObjInventor(),GetObjIdentifier(),NULL));
    1128           4 :     if (pObj!=NULL)
    1129           4 :         *pObj=*static_cast< const T* >( this );
    1130           4 :     return pObj;
    1131             : }
    1132             : 
    1133             : #endif //_SVDOBJ_HXX
    1134             : 
    1135             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10