1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _SVX_CFGCHART_HXX
21 #define _SVX_CFGCHART_HXX
23 // header for TYPEINFO
24 #include <tools/rtti.hxx>
25 // header for ConfigItem
26 #include <unotools/configitem.hxx>
27 // header for SfxPoolItem
28 #include <svl/poolitem.hxx>
29 // header for XColorEntry
30 #include <svx/xtable.hxx>
34 class SvxChartColorTable
37 ::std::vector
< XColorEntry
> m_aColorEntries
;
38 int nNextElementNumber
;
39 String sDefaultNamePrefix
;
40 String sDefaultNamePostfix
;
44 explicit SvxChartColorTable( const SvxChartColorTable
& _rSource
);
48 const XColorEntry
& operator[]( size_t _nIndex
) const;
49 ColorData
getColorData( size_t _nIndex
) const;
53 void append( const XColorEntry
& _rEntry
);
54 void remove( size_t _nIndex
);
55 void replace( size_t _nIndex
, const XColorEntry
& _rEntry
);
57 String
getDefaultName(size_t _nIndex
);
60 bool operator==( const SvxChartColorTable
& _rOther
) const;
63 // ====================
65 // ====================
66 class SvxChartOptions
: public ::utl::ConfigItem
69 SvxChartColorTable maDefColors
;
70 sal_Bool mbIsInitialized
;
72 ::com::sun::star::uno::Sequence
< ::rtl::OUString
>
75 inline ::com::sun::star::uno::Sequence
< ::rtl::OUString
> GetPropertyNames() const
76 { return maPropertyNames
; }
77 sal_Bool
RetrieveOptions();
81 virtual ~SvxChartOptions();
83 const SvxChartColorTable
& GetDefaultColors();
84 void SetDefaultColors( const SvxChartColorTable
& aCol
);
86 virtual void Commit();
87 virtual void Notify( const com::sun::star::uno::Sequence
< rtl::OUString
>& _rPropertyNames
);
90 // ====================
92 // ====================
93 class SvxChartColorTableItem
: public SfxPoolItem
97 SvxChartColorTableItem( sal_uInt16 nWhich
, const SvxChartColorTable
& );
98 SvxChartColorTableItem( const SvxChartColorTableItem
& );
100 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
101 virtual int operator==( const SfxPoolItem
& ) const;
102 void SetOptions( SvxChartOptions
* pOpts
) const;
104 const SvxChartColorTable
& GetColorList() const ;
105 SvxChartColorTable
& GetColorList();
106 void ReplaceColorByIndex( size_t _nIndex
, const XColorEntry
& _rEntry
);
109 SvxChartColorTable m_aColorTable
;
112 #endif // _SVX_CFGCHART_HXX
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */