1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _SCH_DGRDATA_HXX
29*cdf0e10cSrcweir #define _SCH_DGRDATA_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <svl/lstner.hxx>
32*cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
33*cdf0e10cSrcweir #include <vcl/toolbox.hxx>
34*cdf0e10cSrcweir #include <comphelper/stl_types.hxx>
35*cdf0e10cSrcweir #include <vcl/dialog.hxx>
36*cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir #include <memory>
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir namespace com { namespace sun { namespace star {
41*cdf0e10cSrcweir     namespace chart2 {
42*cdf0e10cSrcweir         class XChartDocument;
43*cdf0e10cSrcweir     }
44*cdf0e10cSrcweir }}}
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir namespace chart
47*cdf0e10cSrcweir {
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir class DataBrowser;
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir class DataEditor : public ModalDialog
52*cdf0e10cSrcweir {
53*cdf0e10cSrcweir public:
54*cdf0e10cSrcweir     DataEditor( Window* pParent,
55*cdf0e10cSrcweir                 const ::com::sun::star::uno::Reference<
56*cdf0e10cSrcweir                     ::com::sun::star::chart2::XChartDocument > & xChartDoc,
57*cdf0e10cSrcweir                 const ::com::sun::star::uno::Reference<
58*cdf0e10cSrcweir                     ::com::sun::star::uno::XComponentContext > & xContext );
59*cdf0e10cSrcweir     virtual ~DataEditor();
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir     // Window
62*cdf0e10cSrcweir     virtual void Resize();
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir     // Dialog
65*cdf0e10cSrcweir 	virtual sal_Bool Close();
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir     void SetReadOnly( bool bReadOnly );
68*cdf0e10cSrcweir     bool ApplyChangesToModel();
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir private:
71*cdf0e10cSrcweir     bool                            m_bReadOnly;
72*cdf0e10cSrcweir     ::std::auto_ptr< DataBrowser >  m_apBrwData;
73*cdf0e10cSrcweir     ToolBox                         m_aTbxData;
74*cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
75*cdf0e10cSrcweir             ::com::sun::star::chart2::XChartDocument > m_xChartDoc;
76*cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
77*cdf0e10cSrcweir         m_xContext;
78*cdf0e10cSrcweir     ImageList       m_aToolboxImageList;
79*cdf0e10cSrcweir     ImageList       m_aToolboxImageListHighContrast;
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir     /// handles actions of the toolbox
82*cdf0e10cSrcweir     DECL_LINK( ToolboxHdl, void* );
83*cdf0e10cSrcweir     /// is called, if the cursor of the table has moved
84*cdf0e10cSrcweir     DECL_LINK( BrowserCursorMovedHdl, void*);
85*cdf0e10cSrcweir     /// this is called if MiscOptions change, esp. High-Contrast mode
86*cdf0e10cSrcweir     DECL_LINK( MiscHdl, void* );
87*cdf0e10cSrcweir     /// is called when the contents of the edit cell changes
88*cdf0e10cSrcweir     DECL_LINK( CellModified, void* );
89*cdf0e10cSrcweir     /// is called when the width of any column in the edit browsebox has changed
90*cdf0e10cSrcweir     DECL_LINK( BrowserColumnResized, void* );
91*cdf0e10cSrcweir     /// is called when the browser view was scrolled, @todo: only call on horizontal scroll
92*cdf0e10cSrcweir     DECL_LINK( BrowserContentScrolled, void* );
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir     void UpdateData();
95*cdf0e10cSrcweir     void ApplyImageList();
96*cdf0e10cSrcweir     /// moved and resizes the series name control etc. to fit the dimensions of the edit browsebox
97*cdf0e10cSrcweir //     void ImplAdjustHeaderControls( bool bRefreshFromModel );
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir     /** notifySystemWindow adds or remove the given window pToRegister at the Systemwindow found when search pWindow.
100*cdf0e10cSrcweir         @param  pWindow
101*cdf0e10cSrcweir             The window which is used to search for the SystemWindow.
102*cdf0e10cSrcweir         @param  pToRegister
103*cdf0e10cSrcweir             The window which should be added or removed on the TaskPaneList.
104*cdf0e10cSrcweir         @param  rMemFunc
105*cdf0e10cSrcweir             The member function which should be called at the SystemWindow when found.
106*cdf0e10cSrcweir             Possible values are:
107*cdf0e10cSrcweir             ::comphelper::mem_fun(&TaskPaneList::AddWindow)
108*cdf0e10cSrcweir             ::comphelper::mem_fun(&TaskPaneList::RemoveWindow)
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir         @note this code is taken from dbaccess/source/ui/inc/UITools.hxx
111*cdf0e10cSrcweir     */
112*cdf0e10cSrcweir     void notifySystemWindow( Window* pWindow,
113*cdf0e10cSrcweir                              Window* pToRegister,
114*cdf0e10cSrcweir                              ::comphelper::mem_fun1_t< TaskPaneList, Window* > rMemFunc );
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir     void AdaptBrowseBoxSize();
117*cdf0e10cSrcweir };
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir } // namespace chart
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir #endif	// _SCH_DGRDATA_HXX
122