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