1*2e2212a7SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*2e2212a7SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*2e2212a7SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*2e2212a7SAndrew Rist * distributed with this work for additional information 6*2e2212a7SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*2e2212a7SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*2e2212a7SAndrew Rist * "License"); you may not use this file except in compliance 9*2e2212a7SAndrew Rist * with the License. You may obtain a copy of the License at 10*2e2212a7SAndrew Rist * 11*2e2212a7SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*2e2212a7SAndrew Rist * 13*2e2212a7SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*2e2212a7SAndrew Rist * software distributed under the License is distributed on an 15*2e2212a7SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*2e2212a7SAndrew Rist * KIND, either express or implied. See the License for the 17*2e2212a7SAndrew Rist * specific language governing permissions and limitations 18*2e2212a7SAndrew Rist * under the License. 19*2e2212a7SAndrew Rist * 20*2e2212a7SAndrew Rist *************************************************************/ 21*2e2212a7SAndrew Rist 22*2e2212a7SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SBX_BRWVIEW_HXX 25cdf0e10cSrcweir #define _SBX_BRWVIEW_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #ifndef _SV_WINDOW_HXX //autogen 28cdf0e10cSrcweir #include <vcl/window.hxx> 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir 31cdf0e10cSrcweir #ifndef _TOOLS_RESID_HXX //autogen wg. ResId 32cdf0e10cSrcweir #include <tools/resid.hxx> 33cdf0e10cSrcweir #endif 34cdf0e10cSrcweir 35cdf0e10cSrcweir #ifndef _COM_SUN_STAR_AWT_POSSIZE_HPP_ 36cdf0e10cSrcweir #include <com/sun/star/awt/PosSize.hpp> 37cdf0e10cSrcweir #endif 38cdf0e10cSrcweir #ifndef DBAUI_DATAVIEW_HXX 39cdf0e10cSrcweir #include "dataview.hxx" 40cdf0e10cSrcweir #endif 41cdf0e10cSrcweir #ifndef _UNOTOOLS_EVENTLISTENERADAPTER_HXX_ 42cdf0e10cSrcweir #include <unotools/eventlisteneradapter.hxx> 43cdf0e10cSrcweir #endif 44cdf0e10cSrcweir 45cdf0e10cSrcweir 46cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace awt { 47cdf0e10cSrcweir class XControl; 48cdf0e10cSrcweir class XControlContainer; 49cdf0e10cSrcweir class XControlModel; 50cdf0e10cSrcweir }}}} 51cdf0e10cSrcweir 52cdf0e10cSrcweir // ========================================================================= 53cdf0e10cSrcweir class ResMgr; 54cdf0e10cSrcweir class Splitter; 55cdf0e10cSrcweir 56cdf0e10cSrcweir namespace dbaui 57cdf0e10cSrcweir { 58cdf0e10cSrcweir class DBTreeView; 59cdf0e10cSrcweir class SbaGridControl; 60cdf0e10cSrcweir 61cdf0e10cSrcweir class UnoDataBrowserView : public ODataView, public ::utl::OEventListenerAdapter 62cdf0e10cSrcweir { 63cdf0e10cSrcweir protected: 64cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > m_xGrid; // our grid's UNO representation 65cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > m_xMe; // our own UNO representation 66cdf0e10cSrcweir DBTreeView* m_pTreeView; 67cdf0e10cSrcweir Splitter* m_pSplitter; 68cdf0e10cSrcweir mutable SbaGridControl* m_pVclControl; // our grid's VCL representation 69cdf0e10cSrcweir Window* m_pStatus; 70cdf0e10cSrcweir 71cdf0e10cSrcweir DECL_LINK( SplitHdl, void* ); 72cdf0e10cSrcweir // attribute access 73cdf0e10cSrcweir public: getGridControl() const74cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > getGridControl() const { return m_xGrid; } 75cdf0e10cSrcweir SbaGridControl* getVclControl() const; 76cdf0e10cSrcweir 77cdf0e10cSrcweir public: 78cdf0e10cSrcweir UnoDataBrowserView( Window* pParent, 79cdf0e10cSrcweir IController& _rController, 80cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); 81cdf0e10cSrcweir virtual ~UnoDataBrowserView(); 82cdf0e10cSrcweir 83cdf0e10cSrcweir /// late construction 84cdf0e10cSrcweir virtual void Construct(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel); 85cdf0e10cSrcweir 86cdf0e10cSrcweir /** as columns may be hidden there is a difference between a columns model pos and its view pos 87cdf0e10cSrcweir so we you may use these translation function 88cdf0e10cSrcweir */ 89cdf0e10cSrcweir sal_uInt16 View2ModelPos(sal_uInt16 nPos) const; 90cdf0e10cSrcweir /// for the same reason the view column count isn't the same as the model column count 91cdf0e10cSrcweir 92cdf0e10cSrcweir void setSplitter(Splitter* _pSplitter); 93cdf0e10cSrcweir void setTreeView(DBTreeView* _pTreeView); 94cdf0e10cSrcweir 95cdf0e10cSrcweir void showStatus( const String& _rStatus ); 96cdf0e10cSrcweir void hideStatus(); 97cdf0e10cSrcweir getContainer()98cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > getContainer() { return m_xMe; } 99cdf0e10cSrcweir 100cdf0e10cSrcweir protected: 101cdf0e10cSrcweir virtual long PreNotify( NotifyEvent& rNEvt ); 102cdf0e10cSrcweir virtual void GetFocus(); 103cdf0e10cSrcweir virtual void resizeDocumentView(Rectangle& rRect); 104cdf0e10cSrcweir virtual void _disposing( const ::com::sun::star::lang::EventObject& _rSource ); 105cdf0e10cSrcweir 106cdf0e10cSrcweir private: 107cdf0e10cSrcweir using ODataView::Construct; 108cdf0e10cSrcweir }; 109cdf0e10cSrcweir 110cdf0e10cSrcweir class BrowserViewStatusDisplay 111cdf0e10cSrcweir { 112cdf0e10cSrcweir protected: 113cdf0e10cSrcweir UnoDataBrowserView* m_pView; 114cdf0e10cSrcweir 115cdf0e10cSrcweir public: 116cdf0e10cSrcweir BrowserViewStatusDisplay( UnoDataBrowserView* _pView, const String& _rStatus ); 117cdf0e10cSrcweir ~BrowserViewStatusDisplay( ); 118cdf0e10cSrcweir }; 119cdf0e10cSrcweir } 120cdf0e10cSrcweir #endif // _SBX_BRWVIEW_HXX 121cdf0e10cSrcweir 122