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