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>
26
27
28namespace sdr::properties
29 {
30 class AttributeProperties : public DefaultProperties, public SfxListener, public svl::StyleSheetUser
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
40
41 protected:
42 // create a new itemset
43 virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& pPool) override;
44
45 // Do the ItemChange, may do special handling
46 virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override;
47
48 // react on ItemSet changes
49 virtual void ItemSetChanged(o3tl::span< const SfxPoolItem* const > aChangedItems, sal_uInt16 nDeletedWhich) override;
50
51 // apply the correct SfyStyleSheet from SdrObject's SdrModel
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,
73 bool bBroadcast) override;
74
75 // get the installed StyleSheet
76 virtual SfxStyleSheet* GetStyleSheet() const override;
77
78 // force all attributes which come from styles to hard attributes
79 // to be able to live without the style.
80 virtual void ForceStyleToHardAttributes() override;
81
82 // This is the Notify(...) from 2nd base class SfxListener
83 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
84
85 virtual bool isUsedByModel() const override;
86 private:
87 // the StyleSheet of this object
89 };
90
91} // end of namespace sdr::properties
92
93
94#endif // INCLUDED_SVX_SDR_PROPERTIES_ATTRIBUTEPROPERTIES_HXX
95
96/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Abstract DrawObject.
Definition: svdobj.hxx:260
void ImpSetParentAtSfxItemSet(bool bDontRemoveHardAttr)
virtual void ItemSetChanged(o3tl::span< const SfxPoolItem *const > aChangedItems, sal_uInt16 nDeletedWhich) override
virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool &pPool) override
void ImpAddStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem *pNewItem=nullptr) override
virtual void ForceStyleToHardAttributes() override
virtual const SfxItemSet & GetObjectItemSet() const override
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast) override
virtual SfxStyleSheet * GetStyleSheet() const override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual bool isUsedByModel() const override