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