xref: /trunk/main/xmloff/source/chart/ColorPropertySet.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef XMLOFF_COLORPROPERTYSET_HXX
24 #define XMLOFF_COLORPROPERTYSET_HXX
25 
26 #include <cppuhelper/implbase2.hxx>
27 
28 #include <com/sun/star/beans/XPropertySet.hpp>
29 #include <com/sun/star/beans/XPropertyState.hpp>
30 
31 namespace xmloff
32 {
33 namespace chart
34 {
35 
36 class ColorPropertySet : public ::cppu::WeakImplHelper2<
37         ::com::sun::star::beans::XPropertySet,
38         ::com::sun::star::beans::XPropertyState >
39 {
40 public:
41     // if bFillColor == false, the color is a LineColor
42     explicit ColorPropertySet( sal_Int32 nColor, bool bFillColor = true );
43     virtual ~ColorPropertySet();
44 
45     void setColor( sal_Int32 nColor );
46     sal_Int32 getColor();
47 
48 protected:
49     // ____ XPropertySet ____
50     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo();
51     virtual void SAL_CALL setPropertyValue(
52         const ::rtl::OUString& aPropertyName,
53         const ::com::sun::star::uno::Any& aValue );
54     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
55         const ::rtl::OUString& PropertyName );
56     virtual void SAL_CALL addPropertyChangeListener(
57         const ::rtl::OUString& aPropertyName,
58         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener );
59     virtual void SAL_CALL removePropertyChangeListener(
60         const ::rtl::OUString& aPropertyName,
61         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener );
62     virtual void SAL_CALL addVetoableChangeListener(
63         const ::rtl::OUString& PropertyName,
64         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener );
65     virtual void SAL_CALL removeVetoableChangeListener(
66         const ::rtl::OUString& PropertyName,
67         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener );
68 
69     // ____ XPropertyState ____
70     virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(
71         const ::rtl::OUString& PropertyName );
72     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates(
73         const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName );
74     virtual void SAL_CALL setPropertyToDefault(
75         const ::rtl::OUString& PropertyName );
76     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault(
77         const ::rtl::OUString& aPropertyName );
78 
79 private:
80     ::com::sun::star::uno::Reference<
81             ::com::sun::star::beans::XPropertySetInfo > m_xInfo;
82     ::rtl::OUString  m_aColorPropName;
83     sal_Int32        m_nColor;
84     bool             m_bIsFillColor;
85     sal_Int32        m_nDefaultColor;
86 };
87 
88 } //  namespace chart
89 } //  namespace xmloff
90 
91 // XMLOFF_COLORPROPERTYSET_HXX
92 #endif
93