1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 #ifndef _SVX_CFGCHART_HXX
29 #define _SVX_CFGCHART_HXX
31 // header for TYPEINFO
32 #include <tools/rtti.hxx>
33 // header for ConfigItem
34 #include <unotools/configitem.hxx>
35 // header for SfxPoolItem
36 #include <svl/poolitem.hxx>
37 // header for XColorEntry
38 #include <svx/xtable.hxx>
42 class SvxChartColorTable
45 ::std::vector
< XColorEntry
> m_aColorEntries
;
49 explicit SvxChartColorTable( const SvxChartColorTable
& _rSource
);
53 const XColorEntry
& operator[]( size_t _nIndex
) const;
54 ColorData
getColorData( size_t _nIndex
) const;
58 void append( const XColorEntry
& _rEntry
);
59 void replace( size_t _nIndex
, const XColorEntry
& _rEntry
);
63 bool operator==( const SvxChartColorTable
& _rOther
) const;
66 // ====================
68 // ====================
69 class SvxChartOptions
: public ::utl::ConfigItem
72 SvxChartColorTable maDefColors
;
73 sal_Bool mbIsInitialized
;
75 ::com::sun::star::uno::Sequence
< ::rtl::OUString
>
78 inline ::com::sun::star::uno::Sequence
< ::rtl::OUString
> GetPropertyNames() const
79 { return maPropertyNames
; }
80 sal_Bool
RetrieveOptions();
84 virtual ~SvxChartOptions();
86 const SvxChartColorTable
& GetDefaultColors();
87 void SetDefaultColors( const SvxChartColorTable
& aCol
);
89 virtual void Commit();
90 virtual void Notify( const com::sun::star::uno::Sequence
< rtl::OUString
>& _rPropertyNames
);
93 // ====================
95 // ====================
96 class SvxChartColorTableItem
: public SfxPoolItem
100 SvxChartColorTableItem( sal_uInt16 nWhich
, const SvxChartColorTable
& );
101 SvxChartColorTableItem( const SvxChartColorTableItem
& );
103 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
104 virtual int operator==( const SfxPoolItem
& ) const;
105 void SetOptions( SvxChartOptions
* pOpts
) const;
107 const SvxChartColorTable
& GetColorTable() const ;
108 SvxChartColorTable
& GetColorTable();
109 void ReplaceColorByIndex( size_t _nIndex
, const XColorEntry
& _rEntry
);
112 SvxChartColorTable m_aColorTable
;
115 #endif // _SVX_CFGCHART_HXX