fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / chart2 / source / controller / dialogs / tp_DataSource.hxx
blob59b92bf840c3836ccbeeb9162b2b68f1d07a6acf
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_DATASOURCE_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_DATASOURCE_HXX
22 #include <svtools/wizardmachine.hxx>
24 #include "DialogModel.hxx"
25 #include "TabPageNotifiable.hxx"
27 #include <vcl/edit.hxx>
28 #include <vcl/lstbox.hxx>
29 #include <vcl/button.hxx>
30 #include <vcl/fixed.hxx>
31 #include <svtools/svtabbx.hxx>
32 #include <svtools/treelistbox.hxx>
33 #include <com/sun/star/chart2/XChartDocument.hpp>
34 #include <com/sun/star/chart2/XDiagram.hpp>
35 #include <com/sun/star/chart2/data/XDataProvider.hpp>
36 #include <com/sun/star/chart2/XDataSeries.hpp>
37 #include <com/sun/star/sheet/XRangeSelection.hpp>
39 #include <utility>
40 #include <vector>
42 #include "RangeSelectionListener.hxx"
44 namespace chart
47 class ChartTypeTemplateProvider;
48 class DialogModel;
50 class DataSourceTabPage :
51 public ::svt::OWizardPage,
52 public RangeSelectionListenerParent
54 public:
55 explicit DataSourceTabPage(
56 vcl::Window * pParent,
57 DialogModel & rDialogModel,
58 ChartTypeTemplateProvider* pTemplateProvider,
59 Dialog * pParentDialog,
60 bool bHideDescription = false );
61 virtual ~DataSourceTabPage();
62 virtual void dispose() SAL_OVERRIDE;
64 void commitPage();
66 protected:
67 // OWizardPage
68 virtual void ActivatePage() SAL_OVERRIDE;
69 virtual bool commitPage( ::svt::WizardTypes::CommitPageReason eReason ) SAL_OVERRIDE;
71 //TabPage
72 virtual void DeactivatePage() SAL_OVERRIDE;
74 virtual void initializePage() SAL_OVERRIDE;
76 DECL_LINK( SeriesSelectionChangedHdl, void* );
77 DECL_LINK( RoleSelectionChangedHdl, void* );
78 DECL_LINK( MainRangeButtonClickedHdl, void* );
79 DECL_LINK( CategoriesRangeButtonClickedHdl, void* );
80 DECL_LINK( AddButtonClickedHdl, void* );
81 DECL_LINK( RemoveButtonClickedHdl, void* );
82 DECL_LINK( RangeModifiedHdl, Edit* );
83 DECL_LINK( RangeUpdateDataHdl, Edit* );
84 DECL_LINK( UpButtonClickedHdl, void* );
85 DECL_LINK( DownButtonClickedHdl, void* );
87 // ____ RangeSelectionListenerParent ____
88 virtual void listeningFinished( const OUString & rNewRange ) SAL_OVERRIDE;
89 virtual void disposingRangeSelection() SAL_OVERRIDE;
91 void updateControlState();
93 protected:
94 /** updates the internal data according to the content of the given edit
95 field. If pField is 0, all relevant fields are used
97 @return
98 <TRUE/> if the text from the field is a valid format to the internal
99 data was valid
101 bool updateModelFromControl( Edit * pField = 0 );
103 ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XRangeSelectionListener >
104 getSelectionRangeListener();
106 /** @return </sal_True>, if the edit field contains a valid range entry. If no
107 XCellRangesAccess can be obtained, </sal_False> is returned.
109 bool isRangeFieldContentValid( Edit & rEdit );
111 /** @return </sal_True>, if the tab-page is in a consistent (commitable) state
113 bool isValid();
114 void setDirty();
116 void updateControlsFromDialogModel();
118 void fillSeriesListBox();
119 void fillRoleListBox();
121 private:
122 VclPtr<FixedText> m_pFT_CAPTION;
123 VclPtr<FixedText> m_pFT_SERIES;
124 VclPtr<SvTreeListBox> m_pLB_SERIES;
125 VclPtr<PushButton> m_pBTN_ADD;
126 VclPtr<PushButton> m_pBTN_REMOVE;
127 VclPtr<PushButton> m_pBTN_UP;
128 VclPtr<PushButton> m_pBTN_DOWN;
130 VclPtr<FixedText> m_pFT_ROLE;
131 VclPtr<SvTabListBox> m_pLB_ROLE;
132 VclPtr<FixedText> m_pFT_RANGE;
133 VclPtr<Edit> m_pEDT_RANGE;
134 VclPtr<PushButton> m_pIMB_RANGE_MAIN;
136 VclPtr<FixedText> m_pFT_CATEGORIES;
137 VclPtr<FixedText> m_pFT_DATALABELS;//used for xy charts
138 VclPtr<Edit> m_pEDT_CATEGORIES;
139 VclPtr<PushButton> m_pIMB_RANGE_CAT;
141 OUString m_aFixedTextRange;
143 ChartTypeTemplateProvider * m_pTemplateProvider;
144 DialogModel & m_rDialogModel;
145 VclPtr<Edit> m_pCurrentRangeChoosingField;
146 bool m_bIsDirty;
147 sal_Int32 m_nLastChartTypeGroupIndex;
149 VclPtr<Dialog> m_pParentDialog;
150 TabPageNotifiable * m_pTabPageNotifiable;
153 } // namespace chart
155 // INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_DATASOURCE_HXX
156 #endif
158 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */