xref: /AOO41X/main/svx/inc/svx/sdr/properties/attributeproperties.hxx (revision 3334a7e6acdae9820fa1a6f556bb10129a8de6b2)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
25 #define _SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
26 
27 #include <svl/lstner.hxx>
28 #include <svx/sdr/properties/defaultproperties.hxx>
29 #include "svx/svxdllapi.h"
30 
31 //////////////////////////////////////////////////////////////////////////////
32 
33 namespace sdr
34 {
35     namespace properties
36     {
37         class SVX_DLLPUBLIC AttributeProperties : public DefaultProperties, public SfxListener
38         {
39             // add style sheet, do all the necessary handling
40             void ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
41 
42             // remove StyleSheet, do all the necessary handling
43             void ImpRemoveStyleSheet();
44 
45         protected:
46             // the SytleSheet of this object
47             SfxStyleSheet*                                  mpStyleSheet;
48 
49             // create a new itemset
50             virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& pPool);
51 
52             // Do the ItemChange, may do special handling
53             virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0);
54 
55             // react on ItemSet changes
56             virtual void ItemSetChanged(const SfxItemSet& rSet);
57 
58         public:
59             // basic constructor
60             AttributeProperties(SdrObject& rObj);
61 
62             // constructor for copying, but using new object
63             AttributeProperties(const AttributeProperties& rProps, SdrObject& rObj);
64 
65             // Clone() operator, normally just calls the local copy constructor
66             virtual BaseProperties& Clone(SdrObject& rObj) const;
67 
68             // destructor
69             virtual ~AttributeProperties();
70 
71             // set a new StyleSheet and broadcast
72             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
73 
74             // get the installed StyleSheet
75             virtual SfxStyleSheet* GetStyleSheet() const;
76 
77             // Move properties to a new ItemPool.
78             virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
79 
80             // Set new model.
81             virtual void SetModel(SdrModel* pOldModel, SdrModel* pNewModel);
82 
83             // force all attributes which come from styles to hard attributes
84             // to be able to live without the style.
85             virtual void ForceStyleToHardAttributes();
86 
87             // This is the Notify(...) from 2nd base class SfxListener
88             virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
89         };
90     } // end of namespace properties
91 } // end of namespace sdr
92 
93 //////////////////////////////////////////////////////////////////////////////
94 
95 #endif //_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
96 
97 // eof
98