Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SVX_CFGCHART_HXX
30 : : #define _SVX_CFGCHART_HXX
31 : :
32 : : // header for TYPEINFO
33 : : #include <tools/rtti.hxx>
34 : : // header for ConfigItem
35 : : #include <unotools/configitem.hxx>
36 : : // header for SfxPoolItem
37 : : #include <svl/poolitem.hxx>
38 : : // header for XColorEntry
39 : : #include <svx/xtable.hxx>
40 : :
41 : : #include <vector>
42 : :
43 [ # # ][ # # ]: 0 : class SvxChartColorTable
[ # # ][ # # ]
44 : : {
45 : : private:
46 : : ::std::vector< XColorEntry > m_aColorEntries;
47 : : int nNextElementNumber;
48 : : String sDefaultNamePrefix;
49 : : String sDefaultNamePostfix;
50 : :
51 : : public:
52 : : SvxChartColorTable();
53 : : explicit SvxChartColorTable( const SvxChartColorTable & _rSource );
54 : :
55 : : // accessors
56 : : size_t size() const;
57 : : const XColorEntry & operator[]( size_t _nIndex ) const;
58 : : ColorData getColorData( size_t _nIndex ) const;
59 : :
60 : : // mutators
61 : : void clear();
62 : : void append( const XColorEntry & _rEntry );
63 : : void remove( size_t _nIndex );
64 : : void replace( size_t _nIndex, const XColorEntry & _rEntry );
65 : : void useDefault();
66 : : String getDefaultName(size_t _nIndex);
67 : :
68 : : // comparison
69 : : bool operator==( const SvxChartColorTable & _rOther ) const;
70 : : };
71 : :
72 : : // ====================
73 : : // all options
74 : : // ====================
75 : : class SvxChartOptions : public ::utl::ConfigItem
76 : : {
77 : : private:
78 : : SvxChartColorTable maDefColors;
79 : : sal_Bool mbIsInitialized;
80 : :
81 : : ::com::sun::star::uno::Sequence< ::rtl::OUString >
82 : : maPropertyNames;
83 : :
84 : 0 : inline ::com::sun::star::uno::Sequence< ::rtl::OUString > GetPropertyNames() const
85 : 0 : { return maPropertyNames; }
86 : : sal_Bool RetrieveOptions();
87 : :
88 : : public:
89 : : SvxChartOptions();
90 : : virtual ~SvxChartOptions();
91 : :
92 : : const SvxChartColorTable& GetDefaultColors();
93 : : void SetDefaultColors( const SvxChartColorTable& aCol );
94 : :
95 : : virtual void Commit();
96 : : virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& _rPropertyNames);
97 : : };
98 : :
99 : : // ====================
100 : : // items
101 : : // ====================
102 [ # # ][ # # ]: 0 : class SvxChartColorTableItem : public SfxPoolItem
103 : : {
104 : : public:
105 : : TYPEINFO();
106 : : SvxChartColorTableItem( sal_uInt16 nWhich, const SvxChartColorTable& );
107 : : SvxChartColorTableItem( const SvxChartColorTableItem& );
108 : :
109 : : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
110 : : virtual int operator==( const SfxPoolItem& ) const;
111 : : void SetOptions( SvxChartOptions* pOpts ) const;
112 : :
113 : : const SvxChartColorTable & GetColorList() const ;
114 : : SvxChartColorTable & GetColorList();
115 : : void ReplaceColorByIndex( size_t _nIndex, const XColorEntry & _rEntry );
116 : :
117 : : private:
118 : : SvxChartColorTable m_aColorTable;
119 : : };
120 : :
121 : : #endif // _SVX_CFGCHART_HXX
122 : :
123 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|