Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svx / svdoattr.hxx
blobf273729e66d1bd2f1362fe5b9750afeba62fb3d5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: svdoattr.hxx,v $
10 * $Revision: 1.6 $
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 ************************************************************************/
31 #ifndef _SVDOATTR_HXX
32 #define _SVDOATTR_HXX
34 #ifndef SVX_XFILLIT0_HXX //autogen
35 #include <bf_svx/xfillit0.hxx>
36 #endif
38 #ifndef _SVX_XFLASIT_HXX //autogen
39 #include <bf_svx/xflasit.hxx>
40 #endif
42 #ifndef _SVX_XLINEIT0_HXX //autogen
43 #include <bf_svx/xlineit0.hxx>
44 #endif
46 #ifndef _SVX_XLNASIT_HXX //autogen
47 #include <bf_svx/xlnasit.hxx>
48 #endif
50 #ifndef _SVDOBJ_HXX
51 #include <bf_svx/svdobj.hxx>
52 #endif
54 #ifndef _SVDATTR_HXX
55 #include <bf_svx/svdattr.hxx>
56 #endif
57 namespace binfilter {
59 //************************************************************
60 // Vorausdeklarationen
61 //************************************************************
63 class SfxPoolItem;
64 class SfxSetItem;
65 class SfxItemSet;
66 class SfxItemPool;
68 class SdrOutliner;
70 //************************************************************
71 // SdrAttrObj
72 //************************************************************
74 class SdrAttrObj : public SdrObject
76 friend class SdrOutliner;
78 protected:
79 Rectangle maSnapRect;
80 SfxStyleSheet *mpStyleSheet;
81 SfxItemSet *mpObjectItemSet;
83 void ImpDeleteItemSet();
84 void ImpForceItemSet();
86 protected:
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();
113 SdrAttrObj();
114 virtual ~SdrAttrObj();
116 public:
117 TYPEINFO();
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();
135 // ItemSet access
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