Debian Codegraph @

chart2/source/controller/dialogs/tp_ChartColorPalette.hxx

raw
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 <sfx2/tabdlg.hxx>
23 #include <ChartColorPalettes.hxx>
24
25 namespace chart
26 {
27 class ChartModel;
28 class ChartColorPaletteHelper;
29
30 // This tab page is used to set up data series colors according to a given color palette
31 // It is present in the Chart Format Dialog for several chart elements.
32 class ChartColorPaletteTabPage final : public SfxTabPage
33 {
34 public:
35 ChartColorPaletteTabPage(weld::Container* pPage, weld::DialogController* pController,
36 const SfxItemSet& rInAttrs);
37 ~ChartColorPaletteTabPage() override;
38
39 static std::unique_ptr<SfxTabPage>
40 Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rInAttrs);
41
42 bool FillItemSet(SfxItemSet* pOutAttrs) override;
43 void Reset(const SfxItemSet* rInAttrs) override;
44 DeactivateRC DeactivatePage(SfxItemSet* pItemSet) override;
45
46 void init(const rtl::Reference<ChartModel>& xChartModel);
47
48 private:
49 void selectItem(ChartColorPaletteType eType, sal_uInt32 nIndex) const;
50 void initColorPalettes() const;
51
52 private:
53 rtl::Reference<ChartModel> mxChartModel;
54 std::unique_ptr<ChartColorPaletteHelper> mxHelper;
55 std::unique_ptr<ChartColorPalettes> mxColorfulPalettes;
56 std::unique_ptr<ChartColorPalettes> mxMonoPalettes;
57
58 DECL_LINK(SelectColorfulPaletteHdl, weld::IconView&, bool);
59 DECL_LINK(SelectMonoPaletteHdl, weld::IconView&, bool);
60 static sal_uInt32 SelectPaletteHdl(const std::unique_ptr<ChartColorPalettes>& xValueSet);
61 };
62 } //namespace chart
63
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */