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