1*de7b3f82SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*de7b3f82SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*de7b3f82SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*de7b3f82SAndrew Rist * distributed with this work for additional information 6*de7b3f82SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*de7b3f82SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*de7b3f82SAndrew Rist * "License"); you may not use this file except in compliance 9*de7b3f82SAndrew Rist * with the License. You may obtain a copy of the License at 10*de7b3f82SAndrew Rist * 11*de7b3f82SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*de7b3f82SAndrew Rist * 13*de7b3f82SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*de7b3f82SAndrew Rist * software distributed under the License is distributed on an 15*de7b3f82SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*de7b3f82SAndrew Rist * KIND, either express or implied. See the License for the 17*de7b3f82SAndrew Rist * specific language governing permissions and limitations 18*de7b3f82SAndrew Rist * under the License. 19*de7b3f82SAndrew Rist * 20*de7b3f82SAndrew Rist *************************************************************/ 21*de7b3f82SAndrew Rist 22*de7b3f82SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SCH_DGRDATA_HXX 25cdf0e10cSrcweir #define _SCH_DGRDATA_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <svl/lstner.hxx> 28cdf0e10cSrcweir #include <svtools/stdctrl.hxx> 29cdf0e10cSrcweir #include <vcl/toolbox.hxx> 30cdf0e10cSrcweir #include <comphelper/stl_types.hxx> 31cdf0e10cSrcweir #include <vcl/dialog.hxx> 32cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include <memory> 35cdf0e10cSrcweir 36cdf0e10cSrcweir namespace com { namespace sun { namespace star { 37cdf0e10cSrcweir namespace chart2 { 38cdf0e10cSrcweir class XChartDocument; 39cdf0e10cSrcweir } 40cdf0e10cSrcweir }}} 41cdf0e10cSrcweir 42cdf0e10cSrcweir namespace chart 43cdf0e10cSrcweir { 44cdf0e10cSrcweir 45cdf0e10cSrcweir class DataBrowser; 46cdf0e10cSrcweir 47cdf0e10cSrcweir class DataEditor : public ModalDialog 48cdf0e10cSrcweir { 49cdf0e10cSrcweir public: 50cdf0e10cSrcweir DataEditor( Window* pParent, 51cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 52cdf0e10cSrcweir ::com::sun::star::chart2::XChartDocument > & xChartDoc, 53cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 54cdf0e10cSrcweir ::com::sun::star::uno::XComponentContext > & xContext ); 55cdf0e10cSrcweir virtual ~DataEditor(); 56cdf0e10cSrcweir 57cdf0e10cSrcweir // Window 58cdf0e10cSrcweir virtual void Resize(); 59cdf0e10cSrcweir 60cdf0e10cSrcweir // Dialog 61cdf0e10cSrcweir virtual sal_Bool Close(); 62cdf0e10cSrcweir 63cdf0e10cSrcweir void SetReadOnly( bool bReadOnly ); 64cdf0e10cSrcweir bool ApplyChangesToModel(); 65cdf0e10cSrcweir 66cdf0e10cSrcweir private: 67cdf0e10cSrcweir bool m_bReadOnly; 68cdf0e10cSrcweir ::std::auto_ptr< DataBrowser > m_apBrwData; 69cdf0e10cSrcweir ToolBox m_aTbxData; 70cdf0e10cSrcweir ::com::sun::star::uno::Reference< 71cdf0e10cSrcweir ::com::sun::star::chart2::XChartDocument > m_xChartDoc; 72cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > 73cdf0e10cSrcweir m_xContext; 74cdf0e10cSrcweir ImageList m_aToolboxImageList; 75cdf0e10cSrcweir ImageList m_aToolboxImageListHighContrast; 76cdf0e10cSrcweir 77cdf0e10cSrcweir /// handles actions of the toolbox 78cdf0e10cSrcweir DECL_LINK( ToolboxHdl, void* ); 79cdf0e10cSrcweir /// is called, if the cursor of the table has moved 80cdf0e10cSrcweir DECL_LINK( BrowserCursorMovedHdl, void*); 81cdf0e10cSrcweir /// this is called if MiscOptions change, esp. High-Contrast mode 82cdf0e10cSrcweir DECL_LINK( MiscHdl, void* ); 83cdf0e10cSrcweir /// is called when the contents of the edit cell changes 84cdf0e10cSrcweir DECL_LINK( CellModified, void* ); 85cdf0e10cSrcweir /// is called when the width of any column in the edit browsebox has changed 86cdf0e10cSrcweir DECL_LINK( BrowserColumnResized, void* ); 87cdf0e10cSrcweir /// is called when the browser view was scrolled, @todo: only call on horizontal scroll 88cdf0e10cSrcweir DECL_LINK( BrowserContentScrolled, void* ); 89cdf0e10cSrcweir 90cdf0e10cSrcweir void UpdateData(); 91cdf0e10cSrcweir void ApplyImageList(); 92cdf0e10cSrcweir /// moved and resizes the series name control etc. to fit the dimensions of the edit browsebox 93cdf0e10cSrcweir // void ImplAdjustHeaderControls( bool bRefreshFromModel ); 94cdf0e10cSrcweir 95cdf0e10cSrcweir /** notifySystemWindow adds or remove the given window pToRegister at the Systemwindow found when search pWindow. 96cdf0e10cSrcweir @param pWindow 97cdf0e10cSrcweir The window which is used to search for the SystemWindow. 98cdf0e10cSrcweir @param pToRegister 99cdf0e10cSrcweir The window which should be added or removed on the TaskPaneList. 100cdf0e10cSrcweir @param rMemFunc 101cdf0e10cSrcweir The member function which should be called at the SystemWindow when found. 102cdf0e10cSrcweir Possible values are: 103cdf0e10cSrcweir ::comphelper::mem_fun(&TaskPaneList::AddWindow) 104cdf0e10cSrcweir ::comphelper::mem_fun(&TaskPaneList::RemoveWindow) 105cdf0e10cSrcweir 106cdf0e10cSrcweir @note this code is taken from dbaccess/source/ui/inc/UITools.hxx 107cdf0e10cSrcweir */ 108cdf0e10cSrcweir void notifySystemWindow( Window* pWindow, 109cdf0e10cSrcweir Window* pToRegister, 110cdf0e10cSrcweir ::comphelper::mem_fun1_t< TaskPaneList, Window* > rMemFunc ); 111cdf0e10cSrcweir 112cdf0e10cSrcweir void AdaptBrowseBoxSize(); 113cdf0e10cSrcweir }; 114cdf0e10cSrcweir 115cdf0e10cSrcweir } // namespace chart 116cdf0e10cSrcweir 117cdf0e10cSrcweir #endif // _SCH_DGRDATA_HXX 118