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
29 {
30  namespace properties
31  {
33  {
34  // core to set parent at SfxItemSet and to execute the hard attribute computations
35  void ImpSetParentAtSfxItemSet(bool bDontRemoveHardAttr);
36 
37  // add style sheet, do all the necessary handling
38  void ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
39 
40  // remove StyleSheet, do all the necessary handling
41  void ImpRemoveStyleSheet();
42 
43  protected:
44  // the StyleSheet of this object
46 
47  // create a new itemset
48  virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& pPool) override;
49 
50  // Do the ItemChange, may do special handling
51  virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override;
52 
53  // react on ItemSet changes
54  virtual void ItemSetChanged(const SfxItemSet& rSet) override;
55 
56  public:
57  // basic constructor
58  explicit AttributeProperties(SdrObject& rObj);
59 
60  // constructor for copying, but using new object
62 
63  // Clone() operator, normally just calls the local copy constructor
64  virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override;
65 
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;
69 
70  // destructor
71  virtual ~AttributeProperties() override;
72 
73  // set a new StyleSheet and broadcast
74  virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override;
75 
76  // get the installed StyleSheet
77  virtual SfxStyleSheet* GetStyleSheet() const override;
78 
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;
82 
83  // This is the Notify(...) from 2nd base class SfxListener
84  virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
85 
86  virtual bool isUsedByModel() const override;
87  };
88  } // end of namespace properties
89 } // end of namespace sdr
90 
91 
92 #endif // INCLUDED_SVX_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
93 
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SfxStyleSheet * GetStyleSheet() const override
virtual bool isUsedByModel() const 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:312
virtual void ItemSetChanged(const SfxItemSet &rSet) override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual void ForceStyleToHardAttributes() override
virtual std::unique_ptr< SfxItemSet > CreateObjectSpecificItemSet(SfxItemPool &pPool) override
void ImpSetParentAtSfxItemSet(bool bDontRemoveHardAttr)
virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem *pNewItem=nullptr) override