xref: /AOO41X/main/dbaccess/source/ui/inc/querycontainerwindow.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
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 DBAUI_QUERYCONTAINERWINDOW_HXX
29*cdf0e10cSrcweir #define DBAUI_QUERYCONTAINERWINDOW_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #ifndef _SV_WINDOW_HXX
32*cdf0e10cSrcweir #include <vcl/window.hxx>
33*cdf0e10cSrcweir #endif
34*cdf0e10cSrcweir #ifndef _SV_SPLIT_HXX
35*cdf0e10cSrcweir #include <vcl/split.hxx>
36*cdf0e10cSrcweir #endif
37*cdf0e10cSrcweir #ifndef DBAUI_DATAVIEW_HXX
38*cdf0e10cSrcweir #include "dataview.hxx"
39*cdf0e10cSrcweir #endif
40*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
41*cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
42*cdf0e10cSrcweir #endif
43*cdf0e10cSrcweir #ifndef DBAUI_QUERYVIEWSWITCH_HXX
44*cdf0e10cSrcweir #include "QueryViewSwitch.hxx"
45*cdf0e10cSrcweir #endif
46*cdf0e10cSrcweir #ifndef _SV_DOCKWIN_HXX
47*cdf0e10cSrcweir #include <vcl/dockwin.hxx>
48*cdf0e10cSrcweir #endif
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir class FixedLine;
51*cdf0e10cSrcweir //.........................................................................
52*cdf0e10cSrcweir namespace dbaui
53*cdf0e10cSrcweir {
54*cdf0e10cSrcweir //.........................................................................
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir 	//=====================================================================
57*cdf0e10cSrcweir 	//= OBeamer
58*cdf0e10cSrcweir 	//=====================================================================
59*cdf0e10cSrcweir 	// tempoaray class until the beamer is implemented
60*cdf0e10cSrcweir 	class OBeamer : public DockingWindow
61*cdf0e10cSrcweir 	{
62*cdf0e10cSrcweir 	public:
63*cdf0e10cSrcweir 		OBeamer(Window* _pParent) : DockingWindow(_pParent,0){}
64*cdf0e10cSrcweir 	};
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir 	//=====================================================================
67*cdf0e10cSrcweir 	//= OQueryContainerWindow
68*cdf0e10cSrcweir 	//=====================================================================
69*cdf0e10cSrcweir 	class OQueryContainerWindow : public ODataView
70*cdf0e10cSrcweir 	{
71*cdf0e10cSrcweir 		OQueryViewSwitch*	m_pViewSwitch;
72*cdf0e10cSrcweir 		OBeamer*			m_pBeamer;
73*cdf0e10cSrcweir 		Splitter*			m_pSplitter;
74*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >	m_xBeamer;
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir 		DECL_LINK( SplitHdl, void* );
77*cdf0e10cSrcweir 	public:
78*cdf0e10cSrcweir 		OQueryContainerWindow(Window* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
79*cdf0e10cSrcweir 		~OQueryContainerWindow();
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir 		virtual void Construct();
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir 		virtual long		PreNotify( NotifyEvent& rNEvt );
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir 		// show the beamer
86*cdf0e10cSrcweir 		void	showPreview(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame);
87*cdf0e10cSrcweir 			// called when the beamer has been disposed
88*cdf0e10cSrcweir 		void	disposingPreview();
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
91*cdf0e10cSrcweir 				getPreviewFrame() const { return m_xBeamer; }
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir 		OQueryDesignView*	getDesignView() { return m_pViewSwitch->getDesignView(); }
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir 		sal_Bool isCutAllowed()		{ return m_pViewSwitch->isCutAllowed(); }
96*cdf0e10cSrcweir 		sal_Bool isPasteAllowed()	{ return m_pViewSwitch->isPasteAllowed(); }
97*cdf0e10cSrcweir 		sal_Bool isCopyAllowed()	{ return m_pViewSwitch->isCopyAllowed(); }
98*cdf0e10cSrcweir 		void copy()					{ m_pViewSwitch->copy(); }
99*cdf0e10cSrcweir 		void cut()					{ m_pViewSwitch->cut(); }
100*cdf0e10cSrcweir 		void paste()				{ m_pViewSwitch->paste(); }
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir 		void clear()														{ m_pViewSwitch->clear(); }
103*cdf0e10cSrcweir 		sal_Bool isSlotEnabled( sal_Int32 _nSlotId )						{ return m_pViewSwitch->isSlotEnabled( _nSlotId ); }
104*cdf0e10cSrcweir 		void	 setSlotEnabled( sal_Int32 _nSlotId, sal_Bool _bEnable )	{ m_pViewSwitch->setSlotEnabled( _nSlotId, _bEnable ); }
105*cdf0e10cSrcweir 		void	 setNoneVisbleRow(sal_Int32 _nRows)							{ m_pViewSwitch->setNoneVisbleRow( _nRows); }
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir 		void setReadOnly( sal_Bool _bReadOnly )								{ m_pViewSwitch->setReadOnly( _bReadOnly ); }
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir 		sal_Bool checkStatement()											{ return m_pViewSwitch->checkStatement( ); }
110*cdf0e10cSrcweir 		::rtl::OUString getStatement()										{ return m_pViewSwitch->getStatement( ); }
111*cdf0e10cSrcweir 		void setStatement( const ::rtl::OUString& _rsStatement )			{ m_pViewSwitch->setStatement( _rsStatement ); }
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir 		void    initialize()												{ m_pViewSwitch->initialize(); }
114*cdf0e10cSrcweir 		void    SaveUIConfig()												{ m_pViewSwitch->SaveUIConfig(); }
115*cdf0e10cSrcweir         bool    reset( ::dbtools::SQLExceptionInfo* _pErrorInfo )           { return m_pViewSwitch->reset( _pErrorInfo ); }
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir 		bool    switchView( ::dbtools::SQLExceptionInfo* _pErrorInfo );
118*cdf0e10cSrcweir         void    forceInitialView();
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir 		virtual void GetFocus();
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir 	protected:
123*cdf0e10cSrcweir 		// re-arrange the controls belonging to the document itself
124*cdf0e10cSrcweir 		virtual void resizeAll( const Rectangle& _rPlayground );
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir 		// arrange dericed classes controls in the rectangle given
127*cdf0e10cSrcweir 		virtual void resizeDocumentView(Rectangle& _rPlayground);
128*cdf0e10cSrcweir 	};
129*cdf0e10cSrcweir 	// end of temp classes
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir //.........................................................................
132*cdf0e10cSrcweir }	// namespace dbaui
133*cdf0e10cSrcweir //.........................................................................
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir #endif // DBAUI_QUERYCONTAINERWINDOW_HXX
136*cdf0e10cSrcweir 
137