Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / include / svx / sdasitm.hxx
blob3fd8bd3cb4f68e2fad3344610c69d2421737c031
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_SDASITM_HXX
21 #define INCLUDED_SVX_SDASITM_HXX
23 #include <svx/svddef.hxx>
24 #include <svx/sdooitm.hxx>
25 #include <svl/stritem.hxx>
26 #include <com/sun/star/uno/Sequence.hxx>
27 #include <com/sun/star/beans/PropertyValue.hpp>
28 #include <com/sun/star/uno/Any.hxx>
29 #include <rtl/ustring.hxx>
30 #include <boost/unordered_map.hpp>
31 #include <map>
32 #include <svx/svxdllapi.h>
34 class SdrCustomShapeEngineItem : public SfxStringItem
36 public :
37 SdrCustomShapeEngineItem();
40 class SdrCustomShapeDataItem : public SfxStringItem
42 public :
43 SdrCustomShapeDataItem();
46 class SVX_DLLPUBLIC SdrCustomShapeGeometryItem : public SfxPoolItem
48 public:
49 typedef std::pair < const OUString, const OUString > PropertyPair;
51 private:
52 struct SVX_DLLPUBLIC PropertyEq
54 bool operator()( const OUString&, const OUString& ) const;
56 struct SVX_DLLPUBLIC PropertyPairEq
58 bool operator()( const SdrCustomShapeGeometryItem::PropertyPair&, const SdrCustomShapeGeometryItem::PropertyPair& ) const;
60 struct SVX_DLLPUBLIC PropertyPairHash
62 size_t operator()( const SdrCustomShapeGeometryItem::PropertyPair& ) const;
64 typedef boost::unordered_map < PropertyPair, sal_Int32, PropertyPairHash, PropertyPairEq > PropertyPairHashMap;
65 typedef boost::unordered_map< OUString, sal_Int32, OUStringHash, PropertyEq > PropertyHashMap;
67 PropertyHashMap aPropHashMap;
68 PropertyPairHashMap aPropPairHashMap;
70 com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aPropSeq;
72 public :
74 TYPEINFO_OVERRIDE();
76 SdrCustomShapeGeometryItem();
77 SdrCustomShapeGeometryItem( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
78 SdrCustomShapeGeometryItem( SvStream& rIn, sal_uInt16 nVersion );
79 virtual ~SdrCustomShapeGeometryItem();
81 virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
82 virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePresentation,
83 SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric,
84 OUString &rText, const IntlWrapper * = 0) const SAL_OVERRIDE;
86 virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItem ) const SAL_OVERRIDE;
87 virtual SvStream& Store( SvStream&, sal_uInt16 nVersion ) const SAL_OVERRIDE;
89 virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const SAL_OVERRIDE;
90 virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const SAL_OVERRIDE;
92 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
93 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
95 const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& GetGeometry() const;
97 com::sun::star::uno::Any* GetPropertyValueByName( const OUString& rPropName );
98 com::sun::star::uno::Any* GetPropertyValueByName( const OUString& rPropName, const OUString& rPropName2 );
100 void SetPropertyValue( const com::sun::star::beans::PropertyValue& rPropVal );
101 void SetPropertyValue( const OUString& rSequenceName, const com::sun::star::beans::PropertyValue& rPropVal );
103 void ClearPropertyValue( const OUString& rPropertyName );
106 class SdrCustomShapeReplacementURLItem : public SfxStringItem
108 public :
109 SdrCustomShapeReplacementURLItem();
113 // class SdrTextWordWrapItem
115 class SdrTextWordWrapItem : public SdrOnOffItem {
116 public:
117 SdrTextWordWrapItem( bool bAuto = false ): SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, bAuto ) {}
118 SdrTextWordWrapItem( SvStream& rIn ) : SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, rIn ) {}
122 // class SdrTextAutoGrowSizeItem
124 class SdrTextAutoGrowSizeItem : public SdrOnOffItem {
125 public:
126 SdrTextAutoGrowSizeItem( bool bAuto = false ): SdrOnOffItem( SDRATTR_TEXT_AUTOGROWSIZE, bAuto ) {}
127 SdrTextAutoGrowSizeItem( SvStream& rIn ) : SdrOnOffItem( SDRATTR_TEXT_AUTOGROWSIZE, rIn ) {}
130 // some useful inline methods
132 inline bool SdrCustomShapeGeometryItem::PropertyEq::operator()( const OUString& r1, const OUString& r2 ) const
134 return r1.equals( r2 );
137 inline bool SdrCustomShapeGeometryItem::PropertyPairEq::operator()( const SdrCustomShapeGeometryItem::PropertyPair& r1, const SdrCustomShapeGeometryItem::PropertyPair& r2 ) const
139 return ( r1.first.equals( r2.first ) ) && ( r1.second.equals( r2.second ) );
142 inline size_t SdrCustomShapeGeometryItem::PropertyPairHash::operator()( const SdrCustomShapeGeometryItem::PropertyPair &r1 ) const
144 return (size_t)r1.first.hashCode() + r1.second.hashCode();
147 #endif
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */