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