LibreOffice Module svx (master)  1
attributeproperties.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SVX_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
21 #define INCLUDED_SVX_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
22 
23 #include <svl/lstner.hxx>
24 #include <svl/stylesheetuser.hxx>
26 
27 
28 namespace sdr::properties
29  {
31  {
32  // core to set parent at SfxItemSet and to execute the hard attribute computations
33  void ImpSetParentAtSfxItemSet(bool bDontRemoveHardAttr);
34 
35  // add style sheet, do all the necessary handling
36  void ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
37 
38  // remove StyleSheet, do all the necessary handling
39  void ImpRemoveStyleSheet();
40 
41  protected:
42  // the StyleSheet of this object
44 
45  // create a new itemset
46  virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& pPool) override;
47 
48  // Do the ItemChange, may do special handling
49  virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override;
50 
51  // react on ItemSet changes
52  virtual void ItemSetChanged(const SfxItemSet*) override;
53 
54  public:
55  // basic constructor
56  explicit AttributeProperties(SdrObject& rObj);
57 
58  // constructor for copying, but using new object
60 
61  // Clone() operator, normally just calls the local copy constructor
62  virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override;
63 
64  // Get the local ItemSet. This directly returns the local ItemSet of the object. No
65  // merging of ItemSets is done for e.g. Group objects.
66  virtual const SfxItemSet& GetObjectItemSet() const override;
67 
68  // destructor
69  virtual ~AttributeProperties() override;
70 
71  // set a new StyleSheet and broadcast
72  virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override;
73 
74  // get the installed StyleSheet
75  virtual SfxStyleSheet* GetStyleSheet() const override;
76 
77  // force all attributes which come from styles to hard attributes
78  // to be able to live without the style.
79  virtual void ForceStyleToHardAttributes() override;
80 
81  // This is the Notify(...) from 2nd base class SfxListener
82  virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
83 
84  virtual bool isUsedByModel() const override;
85  };
86 
87 } // end of namespace sdr::properties
88 
89 
90 #endif // INCLUDED_SVX_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
91 
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SfxStyleSheet * GetStyleSheet() const override
virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool &pPool) override
virtual bool isUsedByModel() const override
virtual void ItemSetChanged(const SfxItemSet *) override
virtual const SfxItemSet & GetObjectItemSet() const override
void ImpAddStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr) override
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
Abstract DrawObject.
Definition: svdobj.hxx:259
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual void ForceStyleToHardAttributes() override
void ImpSetParentAtSfxItemSet(bool bDontRemoveHardAttr)
virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem *pNewItem=nullptr) override