1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef DBAUI_QUERYCONTAINERWINDOW_HXX
29 #define DBAUI_QUERYCONTAINERWINDOW_HXX
30 
31 #ifndef _SV_WINDOW_HXX
32 #include <vcl/window.hxx>
33 #endif
34 #ifndef _SV_SPLIT_HXX
35 #include <vcl/split.hxx>
36 #endif
37 #ifndef DBAUI_DATAVIEW_HXX
38 #include "dataview.hxx"
39 #endif
40 #ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
41 #include <com/sun/star/frame/XFrame.hpp>
42 #endif
43 #ifndef DBAUI_QUERYVIEWSWITCH_HXX
44 #include "QueryViewSwitch.hxx"
45 #endif
46 #ifndef _SV_DOCKWIN_HXX
47 #include <vcl/dockwin.hxx>
48 #endif
49 
50 class FixedLine;
51 //.........................................................................
52 namespace dbaui
53 {
54 //.........................................................................
55 
56 	//=====================================================================
57 	//= OBeamer
58 	//=====================================================================
59 	// tempoaray class until the beamer is implemented
60 	class OBeamer : public DockingWindow
61 	{
62 	public:
63 		OBeamer(Window* _pParent) : DockingWindow(_pParent,0){}
64 	};
65 
66 	//=====================================================================
67 	//= OQueryContainerWindow
68 	//=====================================================================
69 	class OQueryContainerWindow : public ODataView
70 	{
71 		OQueryViewSwitch*	m_pViewSwitch;
72 		OBeamer*			m_pBeamer;
73 		Splitter*			m_pSplitter;
74 		::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >	m_xBeamer;
75 
76 		DECL_LINK( SplitHdl, void* );
77 	public:
78 		OQueryContainerWindow(Window* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
79 		~OQueryContainerWindow();
80 
81 		virtual void Construct();
82 
83 		virtual long		PreNotify( NotifyEvent& rNEvt );
84 
85 		// show the beamer
86 		void	showPreview(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame);
87 			// called when the beamer has been disposed
88 		void	disposingPreview();
89 
90 		::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
91 				getPreviewFrame() const { return m_xBeamer; }
92 
93 		OQueryDesignView*	getDesignView() { return m_pViewSwitch->getDesignView(); }
94 
95 		sal_Bool isCutAllowed()		{ return m_pViewSwitch->isCutAllowed(); }
96 		sal_Bool isPasteAllowed()	{ return m_pViewSwitch->isPasteAllowed(); }
97 		sal_Bool isCopyAllowed()	{ return m_pViewSwitch->isCopyAllowed(); }
98 		void copy()					{ m_pViewSwitch->copy(); }
99 		void cut()					{ m_pViewSwitch->cut(); }
100 		void paste()				{ m_pViewSwitch->paste(); }
101 
102 		void clear()														{ m_pViewSwitch->clear(); }
103 		sal_Bool isSlotEnabled( sal_Int32 _nSlotId )						{ return m_pViewSwitch->isSlotEnabled( _nSlotId ); }
104 		void	 setSlotEnabled( sal_Int32 _nSlotId, sal_Bool _bEnable )	{ m_pViewSwitch->setSlotEnabled( _nSlotId, _bEnable ); }
105 		void	 setNoneVisbleRow(sal_Int32 _nRows)							{ m_pViewSwitch->setNoneVisbleRow( _nRows); }
106 
107 		void setReadOnly( sal_Bool _bReadOnly )								{ m_pViewSwitch->setReadOnly( _bReadOnly ); }
108 
109 		sal_Bool checkStatement()											{ return m_pViewSwitch->checkStatement( ); }
110 		::rtl::OUString getStatement()										{ return m_pViewSwitch->getStatement( ); }
111 		void setStatement( const ::rtl::OUString& _rsStatement )			{ m_pViewSwitch->setStatement( _rsStatement ); }
112 
113 		void    initialize()												{ m_pViewSwitch->initialize(); }
114 		void    SaveUIConfig()												{ m_pViewSwitch->SaveUIConfig(); }
115         bool    reset( ::dbtools::SQLExceptionInfo* _pErrorInfo )           { return m_pViewSwitch->reset( _pErrorInfo ); }
116 
117 		bool    switchView( ::dbtools::SQLExceptionInfo* _pErrorInfo );
118         void    forceInitialView();
119 
120 		virtual void GetFocus();
121 
122 	protected:
123 		// re-arrange the controls belonging to the document itself
124 		virtual void resizeAll( const Rectangle& _rPlayground );
125 
126 		// arrange dericed classes controls in the rectangle given
127 		virtual void resizeDocumentView(Rectangle& _rPlayground);
128 	};
129 	// end of temp classes
130 
131 //.........................................................................
132 }	// namespace dbaui
133 //.........................................................................
134 
135 #endif // DBAUI_QUERYCONTAINERWINDOW_HXX
136 
137