1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tp_DataSource.hxx,v $
10 * $Revision: 1.4.44.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef CHART2_DATASOURCETABPAGE_HXX
31 #define CHART2_DATASOURCETABPAGE_HXX
33 #include <svtools/wizardmachine.hxx>
35 #include "DialogModel.hxx"
36 #include "TabPageNotifiable.hxx"
38 // header for class Edit
39 #include <vcl/edit.hxx>
40 // header for class ListBox
41 #include <vcl/lstbox.hxx>
42 // header for class PushButton, OKButton, CancelButton, HelpButton
43 #ifndef _SV_BUTTON_HXX
44 #include <vcl/button.hxx>
46 // header for class FixedText, FixedLine
47 #include <vcl/fixed.hxx>
48 // header for class SvTabListBox
49 #include <svtools/svtabbx.hxx>
50 // header for class SvTreeListBox
51 #include <svtools/svtreebx.hxx>
52 #include <com/sun/star/chart2/XChartDocument.hpp>
53 #include <com/sun/star/chart2/XDiagram.hpp>
54 #include <com/sun/star/chart2/data/XDataProvider.hpp>
55 #include <com/sun/star/chart2/XDataSeries.hpp>
56 #include <com/sun/star/sheet/XRangeSelection.hpp>
62 #include "RangeSelectionListener.hxx"
63 #include "RangeSelectionButton.hxx"
64 #include "RangeEdit.hxx"
66 namespace com
{ namespace sun
{ namespace star
{
74 class ChartTypeTemplateProvider
;
77 class DataSourceTabPage
:
78 public ::svt::OWizardPage
,
79 public RangeSelectionListenerParent
82 explicit DataSourceTabPage(
84 DialogModel
& rDialogModel
,
85 ChartTypeTemplateProvider
* pTemplateProvider
,
86 Dialog
* pParentDialog
,
87 bool bHideDescription
= false );
88 virtual ~DataSourceTabPage();
94 virtual void ActivatePage();
95 virtual sal_Bool
commitPage( CommitPageReason eReason
);
98 virtual void DeactivatePage();
100 virtual void initializePage();
102 DECL_LINK( SeriesSelectionChangedHdl
, void* );
103 DECL_LINK( RoleSelectionChangedHdl
, void* );
104 DECL_LINK( MainRangeButtonClickedHdl
, void* );
105 DECL_LINK( CategoriesRangeButtonClickedHdl
, void* );
106 DECL_LINK( AddButtonClickedHdl
, void* );
107 DECL_LINK( RemoveButtonClickedHdl
, void* );
108 DECL_LINK( RangeModifiedHdl
, Edit
* );
109 DECL_LINK( RangeUpdateDataHdl
, Edit
* );
110 DECL_LINK( UpButtonClickedHdl
, void* );
111 DECL_LINK( DownButtonClickedHdl
, void* );
113 // ____ RangeSelectionListenerParent ____
114 virtual void listeningFinished( const ::rtl::OUString
& rNewRange
);
115 virtual void disposingRangeSelection();
117 void updateControlState();
120 /** updates the internal data according to the content of the given edit
121 field. If pField is 0, all relevant fields are used
124 <TRUE/> if the text from the field is a valid format to the internal
127 bool updateModelFromControl( Edit
* pField
= 0 );
129 ::com::sun::star::uno::Reference
< ::com::sun::star::sheet::XRangeSelectionListener
>
130 getSelectionRangeListener();
132 /** @return </TRUE>, if the edit field contains a valid range entry. if no
133 XCellRangesAccess can be obtained, </TRUE> is returned.
135 bool isRangeFieldContentValid( Edit
& rEdit
);
137 /** @return </TRUE>, if the tab-page is in a consistent (commitable) state
142 void updateControlsFromDialogModel();
144 void fillSeriesListBox();
145 void fillRoleListBox();
148 FixedText m_aFT_CAPTION
;
149 FixedText m_aFT_SERIES
;
150 ::std::auto_ptr
< SvTreeListBox
> m_apLB_SERIES
;
151 PushButton m_aBTN_ADD
;
152 PushButton m_aBTN_REMOVE
;
153 PushButton m_aBTN_UP
;
154 PushButton m_aBTN_DOWN
;
156 FixedText m_aFT_ROLE
;
157 SvTabListBox m_aLB_ROLE
;
158 FixedText m_aFT_RANGE
;
159 RangeEdit m_aEDT_RANGE
;
160 RangeSelectionButton m_aIMB_RANGE_MAIN
;
162 FixedText m_aFT_CATEGORIES
;
163 FixedText m_aFT_DATALABELS
;//used for xy charts
164 RangeEdit m_aEDT_CATEGORIES
;
165 RangeSelectionButton m_aIMB_RANGE_CAT
;
167 ::rtl::OUString m_aFixedTextRange
;
169 ChartTypeTemplateProvider
* m_pTemplateProvider
;
170 DialogModel
& m_rDialogModel
;
171 Edit
* m_pCurrentRangeChoosingField
;
173 sal_Int32 m_nLastChartTypeGroupIndex
;
175 Dialog
* m_pParentDialog
;
176 TabPageNotifiable
* m_pTabPageNotifiable
;
181 // CHART2_DATASOURCETABPAGE_HXX