xref: /aoo42x/main/dbaccess/inc/dataview.hxx (revision cdf0e10c)
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 #ifndef DBAUI_DATAVIEW_HXX
28 #define DBAUI_DATAVIEW_HXX
29 
30 #include "dbaccessdllapi.h"
31 
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 #include <svtools/acceleratorexecute.hxx>
34 #include <vcl/fixed.hxx>
35 
36 #include <memory>
37 
38 class FixedLine;
39 class SvtMiscOptions;
40 namespace dbaui
41 {
42 	class IController;
43 	class DBACCESS_DLLPUBLIC ODataView :	public Window
44 	{
45 		::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >	m_xServiceFactory;	// the service factory to work with
46 
47 	protected:
48 		IController&        m_rController;	// the controller in where we resides in
49         FixedLine           m_aSeparator;
50 		::std::auto_ptr< ::svt::AcceleratorExecute> m_pAccel;
51 
52 	public:
53 		ODataView(	Window* pParent,
54 					IController& _rController,
55 					const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ,
56 					WinBits nStyle = 0 );
57 		virtual ~ODataView();
58 
59 		/// late construction
60 		virtual void Construct();
61 		// initialize will be called when after the controller finished his initialize method
62 		virtual void initialize(){}
63 		// window overridables
64 		virtual long PreNotify( NotifyEvent& rNEvt );
65 		virtual void StateChanged( StateChangedType nStateChange );
66 		virtual void DataChanged( const DataChangedEvent& rDCEvt );
67 
68 		inline IController& getCommandController() const { return m_rController; }
69 
70 		/** will be called when the controls need to be resized.
71 		*/
72 		virtual void resizeControls(const Size& /*_rDiff*/) { Resize(); }
73 
74 		::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() { return m_xServiceFactory;}
75 
76 		// the default implementation simply calls resizeAll( GetSizePixel() )
77 		virtual void Resize();
78 
79 		void attachFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame);
80 	protected:
81 		// window overridables
82 		virtual void Paint( const Rectangle& _rRect );
83 
84 		/// re-arrange all controls, including the toolbox, it's separator, and the "real view"
85 		virtual void resizeAll( const Rectangle& _rPlayground );
86 
87 		// re-arrange the controls belonging to the document itself
88 		virtual void resizeDocumentView( Rectangle& _rPlayground );
89 	};
90 }
91 #endif // DBAUI_DATAVIEW_HXX
92 
93