Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / cui / source / options / optchart.hxx
blobf8b0dcb8f1f4eef54c41b2c3232cedad6769a6b7
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 INCLUDED_CUI_SOURCE_OPTIONS_OPTCHART_HXX
21 #define INCLUDED_CUI_SOURCE_OPTIONS_OPTCHART_HXX
23 #include <sfx2/tabdlg.hxx>
24 #include <svtools/valueset.hxx>
25 #include <svx/xtable.hxx>
26 #include <svx/PaletteManager.hxx>
27 #include <vcl/customweld.hxx>
29 #include "cfgchart.hxx"
31 typedef std::vector<Color> ImpColorList;
33 class SvxDefaultColorOptPage : public SfxTabPage
35 private:
36 std::unique_ptr<SvxChartOptions> m_SvxChartOptionsUniquePtr;
37 // no reason to use a cloned SfxItem here (SvxChartColorTableItem)
38 // that just leads to non-const SfxItem and potential trouble
39 std::unique_ptr<SvxChartColorTable> m_SvxChartColorTableUniquePtr;
41 ImpColorList aColorList;
42 PaletteManager aPaletteManager;
44 std::unique_ptr<weld::TreeView> m_xLbChartColors;
45 std::unique_ptr<weld::ComboBox> m_xLbPaletteSelector;
46 std::unique_ptr<weld::Button> m_xPBDefault;
47 std::unique_ptr<weld::Button> m_xPBAdd;
48 std::unique_ptr<weld::Button> m_xPBRemove;
49 std::unique_ptr<ColorValueSet> m_xValSetColorBox;
50 std::unique_ptr<weld::CustomWeld> m_xValSetColorBoxWin;
52 DECL_LINK(ResetToDefaults, weld::Button&, void);
53 DECL_LINK(AddChartColor, weld::Button&, void);
54 DECL_LINK(RemoveChartColor, weld::Button&, void);
55 DECL_LINK(BoxClickedHdl, SvtValueSet*, void);
56 DECL_LINK(SelectPaletteLbHdl, weld::ComboBox&, void);
58 void FillPaletteLB();
60 private:
61 void InsertColorEntry(const XColorEntry& rEntry, sal_Int32 nPos = -1);
62 void RemoveColorEntry(sal_Int32 nPos);
63 void ModifyColorEntry(const XColorEntry& rEntry, sal_Int32 nPos);
64 void ClearColorEntries();
65 void FillBoxChartColorLB();
67 public:
68 SvxDefaultColorOptPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
69 virtual ~SvxDefaultColorOptPage() override;
71 void Construct();
73 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rInAttrs );
74 virtual bool FillItemSet( SfxItemSet* rOutAttrs ) override;
75 virtual void Reset( const SfxItemSet* rInAttrs ) override;
77 void SaveChartOptions();
80 #endif // INCLUDED_CUI_SOURCE_OPTIONS_OPTCHART_HXX
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */