xref: /aoo41x/main/dbaccess/source/ui/inc/brwview.hxx (revision cdf0e10c)
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 _SBX_BRWVIEW_HXX
29*cdf0e10cSrcweir #define _SBX_BRWVIEW_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #ifndef _SV_WINDOW_HXX //autogen
32*cdf0e10cSrcweir #include <vcl/window.hxx>
33*cdf0e10cSrcweir #endif
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #ifndef _TOOLS_RESID_HXX //autogen wg. ResId
36*cdf0e10cSrcweir #include <tools/resid.hxx>
37*cdf0e10cSrcweir #endif
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_AWT_POSSIZE_HPP_
40*cdf0e10cSrcweir #include <com/sun/star/awt/PosSize.hpp>
41*cdf0e10cSrcweir #endif
42*cdf0e10cSrcweir #ifndef DBAUI_DATAVIEW_HXX
43*cdf0e10cSrcweir #include "dataview.hxx"
44*cdf0e10cSrcweir #endif
45*cdf0e10cSrcweir #ifndef _UNOTOOLS_EVENTLISTENERADAPTER_HXX_
46*cdf0e10cSrcweir #include <unotools/eventlisteneradapter.hxx>
47*cdf0e10cSrcweir #endif
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace awt {
51*cdf0e10cSrcweir 	class XControl;
52*cdf0e10cSrcweir 	class XControlContainer;
53*cdf0e10cSrcweir 	class XControlModel;
54*cdf0e10cSrcweir }}}}
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir // =========================================================================
57*cdf0e10cSrcweir class ResMgr;
58*cdf0e10cSrcweir class Splitter;
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir namespace dbaui
61*cdf0e10cSrcweir {
62*cdf0e10cSrcweir 	class DBTreeView;
63*cdf0e10cSrcweir 	class SbaGridControl;
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir 	class UnoDataBrowserView : public ODataView, public ::utl::OEventListenerAdapter
66*cdf0e10cSrcweir 	{
67*cdf0e10cSrcweir 	protected:
68*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > 				m_xGrid;			// our grid's UNO representation
69*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > 		m_xMe;				// our own UNO representation
70*cdf0e10cSrcweir 		DBTreeView*				m_pTreeView;
71*cdf0e10cSrcweir 		Splitter*				m_pSplitter;
72*cdf0e10cSrcweir 		mutable SbaGridControl*	m_pVclControl;	// our grid's VCL representation
73*cdf0e10cSrcweir 		Window*					m_pStatus;
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir 		DECL_LINK( SplitHdl, void* );
76*cdf0e10cSrcweir 	// attribute access
77*cdf0e10cSrcweir 	public:
78*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > 			getGridControl() const	{ return m_xGrid; }
79*cdf0e10cSrcweir 		SbaGridControl*			getVclControl() const;
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir 	public:
82*cdf0e10cSrcweir 		UnoDataBrowserView(	Window* pParent,
83*cdf0e10cSrcweir 							IController& _rController,
84*cdf0e10cSrcweir 							const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
85*cdf0e10cSrcweir 		virtual ~UnoDataBrowserView();
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir 		/// late construction
88*cdf0e10cSrcweir 		virtual void Construct(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel);
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir 		/**	as columns may be hidden there is a difference between a columns model pos and its view pos
91*cdf0e10cSrcweir 			so we you may use these translation function
92*cdf0e10cSrcweir 		*/
93*cdf0e10cSrcweir 		sal_uInt16 View2ModelPos(sal_uInt16 nPos) const;
94*cdf0e10cSrcweir 		///	for the same reason the view column count isn't the same as the model column count
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir 		void setSplitter(Splitter* _pSplitter);
97*cdf0e10cSrcweir 		void setTreeView(DBTreeView* _pTreeView);
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir 		void	showStatus( const String& _rStatus );
100*cdf0e10cSrcweir 		void	hideStatus();
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > 	 getContainer() { return m_xMe; }
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir 	protected:
105*cdf0e10cSrcweir 		virtual long PreNotify( NotifyEvent& rNEvt );
106*cdf0e10cSrcweir 		virtual void GetFocus();
107*cdf0e10cSrcweir 		virtual void resizeDocumentView(Rectangle& rRect);
108*cdf0e10cSrcweir 		virtual void _disposing( const ::com::sun::star::lang::EventObject& _rSource );
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir     private:
111*cdf0e10cSrcweir         using ODataView::Construct;
112*cdf0e10cSrcweir 	};
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir 	class BrowserViewStatusDisplay
115*cdf0e10cSrcweir 	{
116*cdf0e10cSrcweir 	protected:
117*cdf0e10cSrcweir 		UnoDataBrowserView*		m_pView;
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir 	public:
120*cdf0e10cSrcweir 		BrowserViewStatusDisplay( UnoDataBrowserView* _pView, const String& _rStatus );
121*cdf0e10cSrcweir 		~BrowserViewStatusDisplay( );
122*cdf0e10cSrcweir 	};
123*cdf0e10cSrcweir }
124*cdf0e10cSrcweir #endif // _SBX_BRWVIEW_HXX
125*cdf0e10cSrcweir 
126