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_GROUPPROPERTIES_HXX
25 #define _SDR_PROPERTIES_GROUPPROPERTIES_HXX
26 
27 #include <svx/sdr/properties/defaultproperties.hxx>
28 
29 /////////////////////////////////////////////////////////////////////////////
30 
31 namespace sdr
32 {
33 	namespace properties
34 	{
35 		class GroupProperties : public DefaultProperties
36 		{
37 		protected:
38 			// create a new itemset
39 			virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
40 
41 			// test changeability for a single item
42 			virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
43 
44 			// Do the ItemChange, may do special handling
45 			virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0);
46 
47 			// Called after ItemChange() is done for all items.
48 			virtual void PostItemChange(const sal_uInt16 nWhich);
49 
50 			// react on ItemSet changes
51 			virtual void ItemSetChanged(const SfxItemSet& rSet);
52 
53 		public:
54 			// basic constructor
55 			GroupProperties(SdrObject& rObj);
56 
57 			// copy constructor
58 			GroupProperties(const GroupProperties& rProps, SdrObject& rObj);
59 
60 			// destructor
61 			virtual ~GroupProperties();
62 
63 			// Clone() operator, normally just calls the local copy constructor
64 			virtual BaseProperties& Clone(SdrObject& rObj) const;
65 
66 			// get itemset
67 			virtual const SfxItemSet& GetObjectItemSet() const;
68 
69 			// get merged ItemSet. Normally, this maps directly to GetObjectItemSet(), but may
70 			// be overloaded e.g for group objects to return a merged ItemSet of the object.
71 			// When using this method the returned ItemSet may contain items in the state
72 			// SFX_ITEM_DONTCARE which means there were several such items with different
73 			// values.
74 			virtual const SfxItemSet& GetMergedItemSet() const;
75 
76 			// Set merged ItemSet. Normally, this maps to SetObjectItemSet().
77 			virtual void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
78 
79 			// set single item
80 			virtual void SetObjectItem(const SfxPoolItem& rItem);
81 
82 			// set single item direct, do not do any notifies or things like that
83 			virtual void SetObjectItemDirect(const SfxPoolItem& rItem);
84 
85 			// clear single item
86 			virtual void ClearObjectItem(const sal_uInt16 nWhich = 0);
87 
88 			// clear single item direct, do not do any notifies or things like that.
89 			// Also supports complete deleteion of items when default parameter 0 is used.
90 			virtual void ClearObjectItemDirect(const sal_uInt16 nWhich = 0);
91 
92 			// Set a single item, iterate over hierarchies if necessary.
93 			virtual void SetMergedItem(const SfxPoolItem& rItem);
94 
95 			// Clear a single item, iterate over hierarchies if necessary.
96 			virtual void ClearMergedItem(const sal_uInt16 nWhich = 0);
97 
98 			// set complete item set
99 			virtual void SetObjectItemSet(const SfxItemSet& rSet);
100 
101 			// set a new StyleSheet
102 			virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
103 
104 			// get the local StyleSheet
105 			virtual SfxStyleSheet* GetStyleSheet() const;
106 
107 			// force default attributes for a specific object type, called from
108 			// DefaultProperties::GetObjectItemSet() if a new ItemSet is created
109 			virtual void ForceDefaultAttributes();
110 
111 			// Move properties to a new ItemPool.
112 			virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
113 
114 			// force all attributes which come from styles to hard attributes
115 			// to be able to live without the style.
116 			virtual void ForceStyleToHardAttributes();
117 		};
118 	} // end of namespace properties
119 } // end of namespace sdr
120 
121 //////////////////////////////////////////////////////////////////////////////
122 
123 #endif //_SDR_PROPERTIES_GROUPPROPERTIES_HXX
124 
125 // eof
126