1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: svdoattr.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #ifndef SVX_XFILLIT0_HXX //autogen
35 #include <bf_svx/xfillit0.hxx>
38 #ifndef _SVX_XFLASIT_HXX //autogen
39 #include <bf_svx/xflasit.hxx>
42 #ifndef _SVX_XLINEIT0_HXX //autogen
43 #include <bf_svx/xlineit0.hxx>
46 #ifndef _SVX_XLNASIT_HXX //autogen
47 #include <bf_svx/xlnasit.hxx>
51 #include <bf_svx/svdobj.hxx>
55 #include <bf_svx/svdattr.hxx>
59 //************************************************************
60 // Vorausdeklarationen
61 //************************************************************
70 //************************************************************
72 //************************************************************
74 class SdrAttrObj
: public SdrObject
76 friend class SdrOutliner
;
80 SfxStyleSheet
*mpStyleSheet
;
81 SfxItemSet
*mpObjectItemSet
;
83 void ImpDeleteItemSet();
84 void ImpForceItemSet();
87 // Strichstaerke ermitteln. Keine Linie -> 0.
88 INT32
ImpGetLineWdt() const;
90 // Feststellen, wieviel wegen der Linienenden auf's BoundRect draufaddiert werden muss.
91 INT32
ImpGetLineEndAdd() const;
93 // HitTest auf's Linienende
94 // ueber nSin/nCos wird der Winkel vorgegeben
96 // Schattenabstand ermitteln. FALSE=Kein Schatten.
97 FASTBOOL
ImpGetShadowDist(sal_Int32
& nXDist
, sal_Int32
& nYDist
) const;
99 // ggf. Schattenversatz zum BoundRect draufaddieren
100 void ImpAddShadowToBoundRect();
102 // Line und Fill Attribute fuer Schatten setzen.
103 // Return=FALSE: kein Schatten attributiert.
104 FASTBOOL
ImpSetShadowAttributes( const SfxItemSet
& rSet
, SfxItemSet
& rShadowSet
) const;
106 // Zuhoeren, ob sich ein StyleSheet aendert
107 virtual void SFX_NOTIFY(SfxBroadcaster
& rBC
, const TypeId
& rBCType
, const SfxHint
& rHint
, const TypeId
& rHintType
);
108 virtual void RemoveStyleSheet();
109 virtual void AddStyleSheet(SfxStyleSheet
* pNewStyleSheet
, FASTBOOL bDontRemoveHardAttr
);
111 // aus NULL-AttrPointern Pointer auf defaults machen
112 virtual void ForceDefaultAttr();
114 virtual ~SdrAttrObj();
119 // Feststellen, ob bFilledObj && Fuellung!=FillNone
120 BOOL
HasFill() const;
122 // Feststellen, ob Linie!=LineNone
123 BOOL
HasLine() const;
125 virtual const Rectangle
& GetSnapRect() const;
126 virtual void operator=(const SdrObject
& rObj
);
127 virtual void WriteData(SvStream
& rOut
) const;
128 virtual void ReadData(const SdrObjIOHeader
& rHead
, SvStream
& rIn
);
129 virtual void SetModel(SdrModel
* pNewModel
);
131 // pre- and postprocessing for objects for saving
132 virtual void PreSave();
133 virtual void PostSave();
136 virtual const SfxItemSet
& GetItemSet() const;
137 virtual SfxItemSet
* CreateNewItemSet(SfxItemPool
& rPool
);
139 // syntactical sugar for ItemSet accesses
140 const SfxItemSet
& GetUnmergedItemSet() const;
142 // t support routines for ItemSet access. NULL pointer means clear item.
143 virtual void ItemChange(const sal_uInt16 nWhich
, const SfxPoolItem
* pNewItem
= 0);
144 virtual void ItemSetChanged(const SfxItemSet
& rSet
);
146 virtual SfxStyleSheet
* GetStyleSheet() const;
147 virtual void SetStyleSheet(SfxStyleSheet
* pNewStyleSheet
, FASTBOOL bDontRemoveHardAttr
);
148 virtual void NbcSetStyleSheet(SfxStyleSheet
* pNewStyleSheet
, FASTBOOL bDontRemoveHardAttr
);
151 // ItemPool fuer dieses Objekt wechseln
152 virtual void MigrateItemPool(SfxItemPool
* pSrcPool
, SfxItemPool
* pDestPool
, SdrModel
* pNewModel
= NULL
);
155 ////////////////////////////////////////////////////////////////////////////////////////////////////
157 }//end of namespace binfilter
158 #endif //_SVDOATTR_HXX