Bump version to 6.4.7.2.M8
[LibreOffice.git] / svx / inc / sdr / properties / attributeproperties.hxx
blobaa02c9484696faf4b2a90661303d4e99bac1dd75
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVX_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
21 #define INCLUDED_SVX_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
23 #include <svl/lstner.hxx>
24 #include <svl/stylesheetuser.hxx>
25 #include <svx/sdr/properties/defaultproperties.hxx>
28 namespace sdr
30 namespace properties
32 class AttributeProperties : public DefaultProperties, public SfxListener, public svl::StyleSheetUser
34 // core to set parent at SfxItemSet and to execute the hard attribute computations
35 void ImpSetParentAtSfxItemSet(bool bDontRemoveHardAttr);
37 // add style sheet, do all the necessary handling
38 void ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
40 // remove StyleSheet, do all the necessary handling
41 void ImpRemoveStyleSheet();
43 protected:
44 // the StyleSheet of this object
45 SfxStyleSheet* mpStyleSheet;
47 // create a new itemset
48 virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& pPool) override;
50 // Do the ItemChange, may do special handling
51 virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override;
53 // react on ItemSet changes
54 virtual void ItemSetChanged(const SfxItemSet& rSet) override;
56 public:
57 // basic constructor
58 explicit AttributeProperties(SdrObject& rObj);
60 // constructor for copying, but using new object
61 AttributeProperties(const AttributeProperties& rProps, SdrObject& rObj);
63 // Clone() operator, normally just calls the local copy constructor
64 virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override;
66 // Get the local ItemSet. This directly returns the local ItemSet of the object. No
67 // merging of ItemSets is done for e.g. Group objects.
68 virtual const SfxItemSet& GetObjectItemSet() const override;
70 // destructor
71 virtual ~AttributeProperties() override;
73 // set a new StyleSheet and broadcast
74 virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override;
76 // get the installed StyleSheet
77 virtual SfxStyleSheet* GetStyleSheet() const override;
79 // force all attributes which come from styles to hard attributes
80 // to be able to live without the style.
81 virtual void ForceStyleToHardAttributes() override;
83 // This is the Notify(...) from 2nd base class SfxListener
84 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
86 virtual bool isUsedByModel() const override;
88 } // end of namespace properties
89 } // end of namespace sdr
92 #endif // INCLUDED_SVX_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */