1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef CHART2_DATASOURCEDIALOG_HXX
24 #define CHART2_DATASOURCEDIALOG_HXX
25 
26 // header for class TabDialog
27 #include <vcl/tabdlg.hxx>
28 // header for class TabControl
29 #include <vcl/tabctrl.hxx>
30 // header for class OKButton
31 #ifndef _SV_BUTTON_HXX
32 #include <vcl/button.hxx>
33 #endif
34 
35 #include "TabPageNotifiable.hxx"
36 #include <com/sun/star/uno/XComponentContext.hpp>
37 #include <com/sun/star/chart2/XChartDocument.hpp>
38 
39 // for auto_ptr
40 #include <memory>
41 
42 namespace chart
43 {
44 
45 class DataSourceTabControl;
46 class RangeChooserTabPage;
47 class DataSourceTabPage;
48 class ChartTypeTemplateProvider;
49 class DialogModel;
50 
51 class DataSourceDialog :
52         public TabDialog,
53         public TabPageNotifiable
54 {
55 public:
56 	explicit DataSourceDialog(
57         Window * pParent,
58         const ::com::sun::star::uno::Reference<
59             ::com::sun::star::chart2::XChartDocument > & xChartDocument,
60         const ::com::sun::star::uno::Reference<
61             ::com::sun::star::uno::XComponentContext > & xContext );
62 	virtual ~DataSourceDialog();
63 
64     // from Dialog (base of TabDialog)
65     virtual short Execute();
66 
67     // TabPageNotifiable
68     virtual void setInvalidPage( TabPage * pTabPage );
69     virtual void setValidPage( TabPage * pTabPage );
70 
71 protected:
72     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
73         m_xChartDocument;
74     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
75         m_xContext;
76     ::std::auto_ptr< ChartTypeTemplateProvider >  m_apDocTemplateProvider;
77     ::std::auto_ptr< DialogModel >                m_apDialogModel;
78 
79 private:
80     DataSourceTabControl* m_pTabControl;
81     OKButton		      m_aBtnOK;
82 	CancelButton	      m_aBtnCancel;
83 	HelpButton		      m_aBtnHelp;
84 
85     RangeChooserTabPage * m_pRangeChooserTabePage;
86     DataSourceTabPage *   m_pDataSourceTabPage;
87     bool                  m_bRangeChooserTabIsValid;
88     bool                  m_bDataSourceTabIsValid;
89 
90     static sal_uInt16         m_nLastPageId;
91 };
92 
93 } //  namespace chart
94 
95 // CHART2_DATASOURCEDIALOG_HXX
96 #endif
97