Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / cui / source / options / cfgchart.hxx
blobd3f995ef9b013c2c651f2d9e4e7d01f7137a2725
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
32 #include <vector>
34 class SvxChartColorTable
36 private:
37 ::std::vector< XColorEntry > m_aColorEntries;
38 int nNextElementNumber;
39 String sDefaultNamePrefix;
40 String sDefaultNamePostfix;
42 public:
43 SvxChartColorTable();
44 explicit SvxChartColorTable( const SvxChartColorTable & _rSource );
46 // accessors
47 size_t size() const;
48 const XColorEntry & operator[]( size_t _nIndex ) const;
49 ColorData getColorData( size_t _nIndex ) const;
51 // mutators
52 void clear();
53 void append( const XColorEntry & _rEntry );
54 void remove( size_t _nIndex );
55 void replace( size_t _nIndex, const XColorEntry & _rEntry );
56 void useDefault();
57 String getDefaultName(size_t _nIndex);
59 // comparison
60 bool operator==( const SvxChartColorTable & _rOther ) const;
63 // ====================
64 // all options
65 // ====================
66 class SvxChartOptions : public ::utl::ConfigItem
68 private:
69 SvxChartColorTable maDefColors;
70 sal_Bool mbIsInitialized;
72 ::com::sun::star::uno::Sequence< ::rtl::OUString >
73 maPropertyNames;
75 inline ::com::sun::star::uno::Sequence< ::rtl::OUString > GetPropertyNames() const
76 { return maPropertyNames; }
77 sal_Bool RetrieveOptions();
79 public:
80 SvxChartOptions();
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 // ====================
91 // items
92 // ====================
93 class SvxChartColorTableItem : public SfxPoolItem
95 public:
96 TYPEINFO();
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 );
108 private:
109 SvxChartColorTable m_aColorTable;
112 #endif // _SVX_CFGCHART_HXX
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */