masterfix DEV300: #i10000# build fix
[LibreOffice.git] / cui / source / options / cfgchart.hxx
blob2ca899035192f59ff2e704868dd3bbd401a67219
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>
40 #include <vector>
42 class SvxChartColorTable
44 private:
45 ::std::vector< XColorEntry > m_aColorEntries;
47 public:
48 SvxChartColorTable();
49 explicit SvxChartColorTable( const SvxChartColorTable & _rSource );
51 // accessors
52 size_t size() const;
53 const XColorEntry & operator[]( size_t _nIndex ) const;
54 ColorData getColorData( size_t _nIndex ) const;
56 // mutators
57 void clear();
58 void append( const XColorEntry & _rEntry );
59 void replace( size_t _nIndex, const XColorEntry & _rEntry );
60 void useDefault();
62 // comparison
63 bool operator==( const SvxChartColorTable & _rOther ) const;
66 // ====================
67 // all options
68 // ====================
69 class SvxChartOptions : public ::utl::ConfigItem
71 private:
72 SvxChartColorTable maDefColors;
73 sal_Bool mbIsInitialized;
75 ::com::sun::star::uno::Sequence< ::rtl::OUString >
76 maPropertyNames;
78 inline ::com::sun::star::uno::Sequence< ::rtl::OUString > GetPropertyNames() const
79 { return maPropertyNames; }
80 sal_Bool RetrieveOptions();
82 public:
83 SvxChartOptions();
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 // ====================
94 // items
95 // ====================
96 class SvxChartColorTableItem : public SfxPoolItem
98 public:
99 TYPEINFO();
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 );
111 private:
112 SvxChartColorTable m_aColorTable;
115 #endif // _SVX_CFGCHART_HXX