xref: /AOO41X/main/xmloff/source/chart/ColorPropertySet.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef XMLOFF_COLORPROPERTYSET_HXX
28 #define XMLOFF_COLORPROPERTYSET_HXX
29 
30 #include <cppuhelper/implbase2.hxx>
31 
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include <com/sun/star/beans/XPropertyState.hpp>
34 
35 namespace xmloff
36 {
37 namespace chart
38 {
39 
40 class ColorPropertySet : public ::cppu::WeakImplHelper2<
41         ::com::sun::star::beans::XPropertySet,
42         ::com::sun::star::beans::XPropertyState >
43 {
44 public:
45     // if bFillColor == false, the color is a LineColor
46 	explicit ColorPropertySet( sal_Int32 nColor, bool bFillColor = true );
47 	virtual ~ColorPropertySet();
48 
49     void setColor( sal_Int32 nColor );
50     sal_Int32 getColor();
51 
52 protected:
53     // ____ XPropertySet ____
54     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
55         throw (::com::sun::star::uno::RuntimeException);
56     virtual void SAL_CALL setPropertyValue(
57         const ::rtl::OUString& aPropertyName,
58         const ::com::sun::star::uno::Any& aValue )
59         throw (::com::sun::star::beans::UnknownPropertyException,
60                ::com::sun::star::beans::PropertyVetoException,
61                ::com::sun::star::lang::IllegalArgumentException,
62                ::com::sun::star::lang::WrappedTargetException,
63                ::com::sun::star::uno::RuntimeException);
64     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
65         const ::rtl::OUString& PropertyName )
66         throw (::com::sun::star::beans::UnknownPropertyException,
67                ::com::sun::star::lang::WrappedTargetException,
68                ::com::sun::star::uno::RuntimeException);
69     virtual void SAL_CALL addPropertyChangeListener(
70         const ::rtl::OUString& aPropertyName,
71         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
72         throw (::com::sun::star::beans::UnknownPropertyException,
73                ::com::sun::star::lang::WrappedTargetException,
74                ::com::sun::star::uno::RuntimeException);
75     virtual void SAL_CALL removePropertyChangeListener(
76         const ::rtl::OUString& aPropertyName,
77         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
78         throw (::com::sun::star::beans::UnknownPropertyException,
79                ::com::sun::star::lang::WrappedTargetException,
80                ::com::sun::star::uno::RuntimeException);
81     virtual void SAL_CALL addVetoableChangeListener(
82         const ::rtl::OUString& PropertyName,
83         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
84         throw (::com::sun::star::beans::UnknownPropertyException,
85                ::com::sun::star::lang::WrappedTargetException,
86                ::com::sun::star::uno::RuntimeException);
87     virtual void SAL_CALL removeVetoableChangeListener(
88         const ::rtl::OUString& PropertyName,
89         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
90         throw (::com::sun::star::beans::UnknownPropertyException,
91                ::com::sun::star::lang::WrappedTargetException,
92                ::com::sun::star::uno::RuntimeException);
93 
94     // ____ XPropertyState ____
95     virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(
96         const ::rtl::OUString& PropertyName )
97         throw (::com::sun::star::beans::UnknownPropertyException,
98                ::com::sun::star::uno::RuntimeException);
99     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates(
100         const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName )
101         throw (::com::sun::star::beans::UnknownPropertyException,
102                ::com::sun::star::uno::RuntimeException);
103     virtual void SAL_CALL setPropertyToDefault(
104         const ::rtl::OUString& PropertyName )
105         throw (::com::sun::star::beans::UnknownPropertyException,
106                ::com::sun::star::uno::RuntimeException);
107     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault(
108         const ::rtl::OUString& aPropertyName )
109         throw (::com::sun::star::beans::UnknownPropertyException,
110                ::com::sun::star::lang::WrappedTargetException,
111                ::com::sun::star::uno::RuntimeException);
112 
113 private:
114     ::com::sun::star::uno::Reference<
115             ::com::sun::star::beans::XPropertySetInfo > m_xInfo;
116     ::rtl::OUString  m_aColorPropName;
117     sal_Int32        m_nColor;
118     bool             m_bIsFillColor;
119     sal_Int32        m_nDefaultColor;
120 };
121 
122 } //  namespace chart
123 } //  namespace xmloff
124 
125 // XMLOFF_COLORPROPERTYSET_HXX
126 #endif
127