LibreOffice Module cui (master)  1
optchart.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 #ifndef INCLUDED_CUI_SOURCE_OPTIONS_OPTCHART_HXX
21 #define INCLUDED_CUI_SOURCE_OPTIONS_OPTCHART_HXX
22 
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>
28 
29 #include "cfgchart.hxx"
30 
31 typedef std::vector<Color> ImpColorList;
32 
34 {
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;
40 
43 
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;
51 
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);
57 
58  void FillPaletteLB();
59 
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();
66 
67 public:
68  SvxDefaultColorOptPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
69  virtual ~SvxDefaultColorOptPage() override;
70  virtual void dispose() override;
71 
72  void Construct();
73 
74  static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rInAttrs );
75  virtual bool FillItemSet( SfxItemSet* rOutAttrs ) override;
76  virtual void Reset( const SfxItemSet* rInAttrs ) override;
77 
78  void SaveChartOptions();
79 };
80 
81 #endif // INCLUDED_CUI_SOURCE_OPTIONS_OPTCHART_HXX
82 
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ImpColorList aColorList
Definition: optchart.hxx:41
std::vector< Color > ImpColorList
Definition: optchart.hxx:31
std::unique_ptr< weld::Button > m_xPBRemove
Definition: optchart.hxx:48
std::unique_ptr< SvxChartOptions > m_SvxChartOptionsUniquePtr
Definition: optchart.hxx:36
std::unique_ptr< weld::ComboBox > m_xLbPaletteSelector
Definition: optchart.hxx:45
void RemoveColorEntry(sal_Int32 nPos)
Definition: optchart.cxx:59
std::unique_ptr< SvxChartColorTable > m_SvxChartColorTableUniquePtr
Definition: optchart.hxx:39
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rInAttrs)
Definition: optchart.cxx:151
virtual ~SvxDefaultColorOptPage() override
Definition: optchart.cxx:131
PaletteManager aPaletteManager
Definition: optchart.hxx:42
std::unique_ptr< weld::Button > m_xPBDefault
Definition: optchart.hxx:46
void InsertColorEntry(const XColorEntry &rEntry, sal_Int32 nPos=-1)
Definition: optchart.cxx:31
void ModifyColorEntry(const XColorEntry &rEntry, sal_Int32 nPos)
Definition: optchart.cxx:73
virtual void Reset(const SfxItemSet *rInAttrs) override
Definition: optchart.cxx:166
std::unique_ptr< weld::CustomWeld > m_xValSetColorBoxWin
Definition: optchart.hxx:50
std::unique_ptr< weld::Button > m_xPBAdd
Definition: optchart.hxx:47
std::unique_ptr< ColorValueSet > m_xValSetColorBox
Definition: optchart.hxx:49
virtual void dispose() override
Definition: optchart.cxx:136
std::unique_ptr< weld::TreeView > m_xLbChartColors
Definition: optchart.hxx:44
DECL_LINK(ResetToDefaults, weld::Button &, void)
virtual bool FillItemSet(SfxItemSet *rOutAttrs) override
Definition: optchart.cxx:156
SvxDefaultColorOptPage(TabPageParent pParent, const SfxItemSet &rInAttrs)
Definition: optchart.cxx:92