Use correct object
[LibreOffice.git] / cui / source / options / optchart.hxx
blob22a01495b276d24bc92f903a366d7276e01c7a9c
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 #pragma once
22 #include <sfx2/tabdlg.hxx>
23 #include <svtools/valueset.hxx>
24 #include <svx/xtable.hxx>
25 #include <svx/PaletteManager.hxx>
26 #include <vcl/customweld.hxx>
28 #include "cfgchart.hxx"
30 typedef std::vector<Color> ImpColorList;
32 class SvxDefaultColorOptPage : public SfxTabPage
34 private:
35 // no reason to use a cloned SfxItem here (SvxChartColorTableItem)
36 // that just leads to non-const SfxItem and potential trouble
37 std::unique_ptr<SvxChartColorTable> m_SvxChartColorTableUniquePtr;
39 ImpColorList aColorList;
40 PaletteManager aPaletteManager;
42 std::unique_ptr<weld::TreeView> m_xLbChartColors;
43 std::unique_ptr<weld::ComboBox> m_xLbPaletteSelector;
44 std::unique_ptr<weld::Button> m_xPBDefault;
45 std::unique_ptr<weld::Button> m_xPBAdd;
46 std::unique_ptr<weld::Button> m_xPBRemove;
47 std::unique_ptr<SvxColorValueSet> m_xValSetColorBox;
48 std::unique_ptr<weld::CustomWeld> m_xValSetColorBoxWin;
50 DECL_LINK(ResetToDefaults, weld::Button&, void);
51 DECL_LINK(AddChartColor, weld::Button&, void);
52 DECL_LINK(RemoveChartColor, weld::Button&, void);
53 DECL_LINK(BoxClickedHdl, ValueSet*, void);
54 DECL_LINK(SelectPaletteLbHdl, weld::ComboBox&, void);
56 void FillPaletteLB();
58 private:
59 void InsertColorEntry(const XColorEntry& rEntry, sal_Int32 nPos = -1);
60 void RemoveColorEntry(sal_Int32 nPos);
61 void ModifyColorEntry(const XColorEntry& rEntry, sal_Int32 nPos);
62 void ClearColorEntries();
63 void FillBoxChartColorLB();
65 public:
66 SvxDefaultColorOptPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
67 virtual ~SvxDefaultColorOptPage() override;
69 void Construct();
71 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rInAttrs );
73 virtual OUString GetAllStrings() override;
75 virtual bool FillItemSet( SfxItemSet* rOutAttrs ) override;
76 virtual void Reset( const SfxItemSet* rInAttrs ) override;
78 void SaveChartOptions();
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */