1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_DEFAULTPROPERTIES_HXX
21 #define INCLUDED_SVX_SDR_PROPERTIES_DEFAULTPROPERTIES_HXX
23 #include <svx/sdr/properties/properties.hxx>
24 #include <svx/svxdllapi.h>
32 class SVX_DLLPUBLIC DefaultProperties
: public BaseProperties
35 // the to be used ItemSet
36 SfxItemSet
* mpItemSet
;
38 // create a new itemset
39 virtual SfxItemSet
* CreateObjectSpecificItemSet(SfxItemPool
& rPool
) SAL_OVERRIDE
;
41 // test changeability for a single item
42 virtual bool AllowItemChange(const sal_uInt16 nWhich
, const SfxPoolItem
* pNewItem
= 0) const SAL_OVERRIDE
;
44 // Do the ItemChange, may do special handling
45 virtual void ItemChange(const sal_uInt16 nWhich
, const SfxPoolItem
* pNewItem
= 0) SAL_OVERRIDE
;
47 // Called after ItemChange() is done for all items.
48 virtual void PostItemChange(const sal_uInt16 nWhich
) SAL_OVERRIDE
;
50 // react on ItemSet changes
51 virtual void ItemSetChanged(const SfxItemSet
& rSet
) SAL_OVERRIDE
;
55 explicit DefaultProperties(SdrObject
& rObj
);
57 // constructor for copying, but using new object
58 DefaultProperties(const DefaultProperties
& rProps
, SdrObject
& rObj
);
61 virtual ~DefaultProperties();
63 // Clone() operator, normally just calls the local copy constructor
64 virtual BaseProperties
& Clone(SdrObject
& rObj
) const SAL_OVERRIDE
;
67 virtual const SfxItemSet
& GetObjectItemSet() const SAL_OVERRIDE
;
70 virtual void SetObjectItem(const SfxPoolItem
& rItem
) SAL_OVERRIDE
;
72 // set single item direct, do not do any notifies or things like that
73 virtual void SetObjectItemDirect(const SfxPoolItem
& rItem
) SAL_OVERRIDE
;
76 virtual void ClearObjectItem(const sal_uInt16 nWhich
= 0) SAL_OVERRIDE
;
78 // clear single item direct, do not do any notifies or things like that.
79 // Also supports complete deleteion of items when default parameter 0 is used.
80 virtual void ClearObjectItemDirect(const sal_uInt16 nWhich
= 0) SAL_OVERRIDE
;
82 // set complete item set
83 virtual void SetObjectItemSet(const SfxItemSet
& rSet
) SAL_OVERRIDE
;
85 // set a new StyleSheet and broadcast
86 virtual void SetStyleSheet(SfxStyleSheet
* pNewStyleSheet
, bool bDontRemoveHardAttr
) SAL_OVERRIDE
;
88 // get the installed StyleSheet
89 virtual SfxStyleSheet
* GetStyleSheet() const SAL_OVERRIDE
;
91 // force default attributes for a specific object type, called from
92 // DefaultProperties::GetObjectItemSet() if a new ItemSet is created.
93 // Default implementation does nothing.
94 virtual void ForceDefaultAttributes();
96 // Scale the included ItemSet.
97 virtual void Scale(const Fraction
& rScale
) SAL_OVERRIDE
;
99 } // end of namespace properties
100 } // end of namespace sdr
102 #endif // INCLUDED_SVX_SDR_PROPERTIES_DEFAULTPROPERTIES_HXX
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */