merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / inc / dataview.hxx
blobc622189b6f1a37e494815c5dcb19773536cf625e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dataview.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBAUI_DATAVIEW_HXX
31 #define DBAUI_DATAVIEW_HXX
33 #ifndef _SV_WINDOW_HXX
34 #include <vcl/window.hxx>
35 #endif
36 #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
37 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
38 #endif
39 #ifndef INCLUDED_SVTOOLS_ACCELERATOREXECUTE_HXX
40 #include <svtools/acceleratorexecute.hxx>
41 #endif
42 #include <memory>
43 #include "dbaccessdllapi.h"
45 class FixedLine;
46 class SvtMiscOptions;
47 namespace dbaui
49 class IController;
50 class DBACCESS_DLLPUBLIC ODataView : public Window
52 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory; // the service factory to work with
54 protected:
55 IController& m_rController; // the controller in where we resides in
56 FixedLine* m_pSeparator; // our separator above the toolbox (may be NULL)
57 ::std::auto_ptr< ::svt::AcceleratorExecute> m_pAccel;
59 public:
60 ODataView( Window* pParent,
61 IController& _rController,
62 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ,
63 WinBits nStyle = 0 );
64 virtual ~ODataView();
66 /// late construction
67 virtual void Construct();
68 // initialize will be called when after the controller finished his initialize method
69 virtual void initialize(){}
70 // window overridables
71 virtual long PreNotify( NotifyEvent& rNEvt );
72 virtual void StateChanged( StateChangedType nStateChange );
73 virtual void DataChanged( const DataChangedEvent& rDCEvt );
75 inline IController& getCommandController() const { return m_rController; }
77 /** will be called when the controls need to be resized.
79 virtual void resizeControls(const Size& /*_rDiff*/) { Resize(); }
81 void enableSeparator( const sal_Bool _bEnable = sal_True );
82 sal_Bool isSeparatorEnabled() const { return NULL != m_pSeparator; }
84 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() { return m_xServiceFactory;}
86 // the default implementation simply calls resizeAll( GetSizePixel() )
87 virtual void Resize();
89 void attachFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame);
90 protected:
91 // window overridables
92 virtual void Paint( const Rectangle& _rRect );
94 /// re-arrange all controls, including the toolbox, it's separator, and the "real view"
95 virtual void resizeAll( const Rectangle& _rPlayground );
97 // re-arrange the controls belonging to the document itself
98 virtual void resizeDocumentView( Rectangle& _rPlayground );
101 #endif // DBAUI_DATAVIEW_HXX