LibreOffice Module cui (master) 1
cfgchart.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <svl/poolitem.hxx>
23#include <svx/xtable.hxx>
24#include <vector>
25
27{
28private:
29 std::vector< XColorEntry > m_aColorEntries;
30
31public:
32 // accessors
33 size_t size() const;
34 const XColorEntry & operator[]( size_t _nIndex ) const;
35 Color getColor( size_t _nIndex ) const;
36
37 // mutators
38 void clear();
39 void append( const XColorEntry & _rEntry );
40 void remove( size_t _nIndex );
41 void replace( size_t _nIndex, const XColorEntry & _rEntry );
42 void useDefault();
43 static OUString getDefaultName(size_t _nIndex);
44
45 // comparison
46 bool operator==( const SvxChartColorTable & _rOther ) const;
47};
48
49
50// all options
51
53{
55 void SetDefaultColors( const SvxChartColorTable& aCol );
56};
57
58
59// items
60// Make Item read-only (no non-const access methods). Two reasons:
61// (1) Preparation for Item refactor
62// (2) Dangerous due to SfxItem may not be what you expect (e.g. when
63// ::Set in SfxItemSet, not your instance may be used there, no control
64// about what will happen without deep knowledge about SfxItems/SfxItemSets)
66{
67public:
68 SvxChartColorTableItem( sal_uInt16 nWhich, SvxChartColorTable );
69
70 virtual SvxChartColorTableItem* Clone( SfxItemPool *pPool = nullptr ) const override;
71 virtual bool operator==( const SfxPoolItem& ) const override;
72
74
75private:
77};
78
79/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SvxChartColorTableItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: cfgchart.cxx:223
SvxChartColorTableItem(sal_uInt16 nWhich, SvxChartColorTable)
Definition: cfgchart.cxx:217
const SvxChartColorTable & GetColorList() const
Definition: cfgchart.hxx:73
SvxChartColorTable m_aColorTable
Definition: cfgchart.hxx:76
virtual bool operator==(const SfxPoolItem &) const override
Definition: cfgchart.cxx:228
void remove(size_t _nIndex)
Definition: cfgchart.cxx:72
bool operator==(const SvxChartColorTable &_rOther) const
Definition: cfgchart.cxx:140
std::vector< XColorEntry > m_aColorEntries
Definition: cfgchart.hxx:29
size_t size() const
Definition: cfgchart.cxx:34
void replace(size_t _nIndex, const XColorEntry &_rEntry)
Definition: cfgchart.cxx:83
const XColorEntry & operator[](size_t _nIndex) const
Definition: cfgchart.cxx:39
static OUString getDefaultName(size_t _nIndex)
Definition: cfgchart.cxx:116
void append(const XColorEntry &_rEntry)
Definition: cfgchart.cxx:67
Color getColor(size_t _nIndex) const
Definition: cfgchart.cxx:50
void SetDefaultColors(const SvxChartColorTable &aCol)
Definition: cfgchart.cxx:199
SvxChartColorTable GetDefaultColors()
Definition: cfgchart.cxx:163