LibreOffice Module chart2 (master) 1
tp_DataSource.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#pragma once
20
21#include <DataSeries.hxx>
22#include <ChartType.hxx>
23
24#include <vcl/wizardmachine.hxx>
25
27
28namespace com::sun::star::chart2 { class XChartType; }
29namespace com::sun::star::chart2 { class XDataSeries; }
30
31namespace chart { class TabPageNotifiable; }
32
33namespace chart
34{
35class ChartType;
36class ChartTypeTemplateProvider;
37class DataSeries;
38class DialogModel;
39
41{
42public:
43 OUString m_sRole;
44
47
50};
51
52class DataSourceTabPage final :
53 public ::vcl::OWizardPage,
55{
56public:
57 explicit DataSourceTabPage(weld::Container* pPage, weld::DialogController* pController,
58 DialogModel & rDialogModel,
59 ChartTypeTemplateProvider* pTemplateProvider,
60 bool bHideDescription = false);
61 virtual ~DataSourceTabPage() override;
62
63 virtual void Activate() override;
64
65 void commitPage();
66
67private:
68 // OWizardPage
69 virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason eReason ) override;
70
71 //TabPage
72 virtual void Deactivate() override;
73
74 virtual void initializePage() override;
75
76 DECL_LINK( SeriesSelectionChangedHdl, weld::TreeView&, void );
77 DECL_LINK( RoleSelectionChangedHdl, weld::TreeView&, void );
78 DECL_LINK( MainRangeButtonClickedHdl, weld::Button&, void );
79 DECL_LINK( CategoriesRangeButtonClickedHdl, weld::Button&, void );
80 DECL_LINK( AddButtonClickedHdl, weld::Button&, void );
81 DECL_LINK( RemoveButtonClickedHdl, weld::Button&, void );
82 DECL_LINK( RangeModifiedHdl, weld::Entry&, void );
83 DECL_LINK( UpButtonClickedHdl, weld::Button&, void );
84 DECL_LINK( DownButtonClickedHdl, weld::Button&, void );
85
86 // ____ RangeSelectionListenerParent ____
87 virtual void listeningFinished( const OUString & rNewRange ) override;
88 virtual void disposingRangeSelection() override;
89
90 void InsertRoleLBEntry(const OUString& rRole, const OUString& rRange);
91
92 void updateControlState();
93
101 bool updateModelFromControl(const weld::Entry* pField = nullptr);
102
107
110 bool isValid();
111 void setDirty();
112
114
115 void fillSeriesListBox();
116 void fillRoleListBox();
117
118 std::vector<std::unique_ptr<SeriesEntry>> m_aEntries;
119
121
126
127 TabPageNotifiable * m_pTabPageNotifiable;
128
129 std::unique_ptr<weld::Label> m_xFT_CAPTION;
130 std::unique_ptr<weld::Label> m_xFT_SERIES;
131 std::unique_ptr<weld::TreeView> m_xLB_SERIES;
132 std::unique_ptr<weld::Button> m_xBTN_ADD;
133 std::unique_ptr<weld::Button> m_xBTN_REMOVE;
134 std::unique_ptr<weld::Button> m_xBTN_UP;
135 std::unique_ptr<weld::Button> m_xBTN_DOWN;
136 std::unique_ptr<weld::Label> m_xFT_ROLE;
137 std::unique_ptr<weld::TreeView> m_xLB_ROLE;
138 std::unique_ptr<weld::Label> m_xFT_RANGE;
139 std::unique_ptr<weld::Entry> m_xEDT_RANGE;
140 std::unique_ptr<weld::Button> m_xIMB_RANGE_MAIN;
141 std::unique_ptr<weld::Label> m_xFT_CATEGORIES;
142 std::unique_ptr<weld::Label> m_xFT_DATALABELS;//used for xy charts
143 std::unique_ptr<weld::Entry> m_xEDT_CATEGORIES;
144 std::unique_ptr<weld::Button> m_xIMB_RANGE_CAT;
145};
146
147} // namespace chart
148
149/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool isRangeFieldContentValid(weld::Entry &rEdit)
std::unique_ptr< weld::Label > m_xFT_SERIES
DECL_LINK(DownButtonClickedHdl, weld::Button &, void)
TabPageNotifiable * m_pTabPageNotifiable
virtual void initializePage() override
virtual void listeningFinished(const OUString &rNewRange) override
std::unique_ptr< weld::Label > m_xFT_CAPTION
DECL_LINK(RoleSelectionChangedHdl, weld::TreeView &, void)
std::unique_ptr< weld::Button > m_xBTN_UP
DECL_LINK(RangeModifiedHdl, weld::Entry &, void)
DECL_LINK(SeriesSelectionChangedHdl, weld::TreeView &, void)
std::unique_ptr< weld::Button > m_xBTN_REMOVE
std::unique_ptr< weld::TreeView > m_xLB_SERIES
std::unique_ptr< weld::Button > m_xBTN_ADD
std::unique_ptr< weld::Label > m_xFT_RANGE
std::unique_ptr< weld::Entry > m_xEDT_CATEGORIES
std::unique_ptr< weld::Entry > m_xEDT_RANGE
bool updateModelFromControl(const weld::Entry *pField=nullptr)
updates the internal data according to the content of the given edit field.
std::unique_ptr< weld::Button > m_xIMB_RANGE_MAIN
std::unique_ptr< weld::Label > m_xFT_CATEGORIES
std::vector< std::unique_ptr< SeriesEntry > > m_aEntries
DECL_LINK(CategoriesRangeButtonClickedHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xBTN_DOWN
virtual void Deactivate() override
ChartTypeTemplateProvider * m_pTemplateProvider
weld::Entry * m_pCurrentRangeChoosingField
std::unique_ptr< weld::Label > m_xFT_DATALABELS
DECL_LINK(UpButtonClickedHdl, weld::Button &, void)
virtual void Activate() override
std::unique_ptr< weld::Button > m_xIMB_RANGE_CAT
std::unique_ptr< weld::Label > m_xFT_ROLE
DataSourceTabPage(weld::Container *pPage, weld::DialogController *pController, DialogModel &rDialogModel, ChartTypeTemplateProvider *pTemplateProvider, bool bHideDescription=false)
DECL_LINK(MainRangeButtonClickedHdl, weld::Button &, void)
virtual void disposingRangeSelection() override
virtual ~DataSourceTabPage() override
void InsertRoleLBEntry(const OUString &rRole, const OUString &rRange)
DECL_LINK(RemoveButtonClickedHdl, weld::Button &, void)
DECL_LINK(AddButtonClickedHdl, weld::Button &, void)
std::unique_ptr< weld::TreeView > m_xLB_ROLE
rtl::Reference< ::chart::ChartType > m_xChartType
the chart type that contains the series (via XDataSeriesContainer)
rtl::Reference< ::chart::DataSeries > m_xDataSeries
the corresponding data series