Line data Source code
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 : #ifndef CHART_IMPLOPROPERTYSET_HXX
20 : #define CHART_IMPLOPROPERTYSET_HXX
21 :
22 : #include <com/sun/star/beans/PropertyState.hpp>
23 : #include <com/sun/star/uno/Sequence.hxx>
24 : #include <com/sun/star/style/XStyle.hpp>
25 :
26 : #include <map>
27 : #include <vector>
28 :
29 : namespace property
30 : {
31 : namespace impl
32 : {
33 :
34 1866 : class ImplOPropertySet
35 : {
36 : public:
37 : ImplOPropertySet();
38 : explicit ImplOPropertySet( const ImplOPropertySet & rOther );
39 :
40 : /** supports states DIRECT_VALUE and DEFAULT_VALUE
41 : */
42 : ::com::sun::star::beans::PropertyState
43 : GetPropertyStateByHandle( sal_Int32 nHandle ) const;
44 :
45 : ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState >
46 : GetPropertyStatesByHandle( const ::std::vector< sal_Int32 > & aHandles ) const;
47 :
48 : void SetPropertyToDefault( sal_Int32 nHandle );
49 : void SetPropertiesToDefault( const ::std::vector< sal_Int32 > & aHandles );
50 : void SetAllPropertiesToDefault();
51 :
52 : /** @param rValue is set to the value for the property given in nHandle. If
53 : the property is not set, the style chain is searched for any
54 : instance set there. If there was no value found either in the
55 : property set itself or any of its styles, rValue remains
56 : unchanged and false is returned.
57 :
58 : @return false if the property is default, true otherwise.
59 : */
60 : bool GetPropertyValueByHandle(
61 : ::com::sun::star::uno::Any & rValue,
62 : sal_Int32 nHandle ) const;
63 :
64 : void SetPropertyValueByHandle( sal_Int32 nHandle,
65 : const ::com::sun::star::uno::Any & rValue,
66 : ::com::sun::star::uno::Any * pOldValue = NULL );
67 :
68 : bool SetStyle( const ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle > & xStyle );
69 : ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >
70 : GetStyle() const;
71 :
72 : typedef
73 : ::std::map< sal_Int32, ::com::sun::star::uno::Any >
74 : tPropertyMap;
75 :
76 : private:
77 : void cloneInterfaceProperties();
78 :
79 : tPropertyMap m_aProperties;
80 : ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >
81 : m_xStyle;
82 : };
83 :
84 : } // namespace impl
85 : } // namespace chart
86 :
87 : // CHART_IMPLOPROPERTYSET_HXX
88 : #endif
89 :
90 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|