Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : : #ifndef DBAUI_DATAVIEW_HXX
20 : : #define DBAUI_DATAVIEW_HXX
21 : :
22 : : #include "dbaccessdllapi.h"
23 : :
24 : : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
25 : : #include <svtools/acceleratorexecute.hxx>
26 : : #include <sal/macros.h>
27 : : #include <vcl/fixed.hxx>
28 : :
29 : : #include <memory>
30 : :
31 : : class FixedLine;
32 : : namespace dbaui
33 : : {
34 : : class IController;
35 : : class DBACCESS_DLLPUBLIC ODataView : public Window
36 : : {
37 : : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory; // the service factory to work with
38 : :
39 : : protected:
40 : : IController& m_rController; // the controller in where we resides in
41 : : FixedLine m_aSeparator;
42 : : ::std::auto_ptr< ::svt::AcceleratorExecute> m_pAccel;
43 : :
44 : : public:
45 : : ODataView( Window* pParent,
46 : : IController& _rController,
47 : : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ,
48 : : WinBits nStyle = 0 );
49 : : virtual ~ODataView();
50 : :
51 : : /// late construction
52 : : virtual void Construct();
53 : : // initialize will be called when after the controller finished his initialize method
54 : 0 : virtual void initialize(){}
55 : : // window overridables
56 : : virtual long PreNotify( NotifyEvent& rNEvt );
57 : : virtual void StateChanged( StateChangedType nStateChange );
58 : : virtual void DataChanged( const DataChangedEvent& rDCEvt );
59 : :
60 : 0 : inline IController& getCommandController() const { return m_rController; }
61 : :
62 : : /** will be called when the controls need to be resized.
63 : : */
64 : 0 : virtual void resizeControls(const Size& /*_rDiff*/) { Resize(); }
65 : :
66 : 2 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() { return m_xServiceFactory;}
67 : :
68 : : // the default implementation simply calls resizeAll( GetSizePixel() )
69 : : virtual void Resize();
70 : :
71 : : void attachFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame);
72 : : protected:
73 : : // window overridables
74 : : virtual void Paint( const Rectangle& _rRect );
75 : :
76 : : /// re-arrange all controls, including the toolbox, it's separator, and the "real view"
77 : : virtual void resizeAll( const Rectangle& _rPlayground );
78 : :
79 : : // re-arrange the controls belonging to the document itself
80 : : virtual void resizeDocumentView( Rectangle& _rPlayground );
81 : : };
82 : : }
83 : : #endif // DBAUI_DATAVIEW_HXX
84 : :
85 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|