1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_DBACCESS_DATAVIEW_HXX
20 #define INCLUDED_DBACCESS_DATAVIEW_HXX
24 #include <com/sun/star/uno/Reference.hxx>
25 #include <dbaccess/dbaccessdllapi.h>
26 #include <rtl/ref.hxx>
27 #include <tools/wintypes.hxx>
28 #include <vcl/outdev.hxx>
29 #include <vcl/vclptr.hxx>
30 #include <vcl/window.hxx>
32 namespace com::sun::star
{
33 namespace frame
{ class XFrame
; }
34 namespace uno
{ class XComponentContext
; }
38 class AcceleratorExecute
;
42 namespace tools
{ class Rectangle
; }
47 class DBACCESS_DLLPUBLIC ODataView
: public vcl::Window
49 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
; // the service factory to work with
52 rtl::Reference
<IController
> m_xController
; // the controller where we reside in
53 ::std::unique_ptr
< ::svt::AcceleratorExecute
> m_pAccel
;
56 ODataView( vcl::Window
* pParent
,
57 IController
& _rController
,
58 const css::uno::Reference
< css::uno::XComponentContext
>& ,
60 virtual ~ODataView() override
;
61 virtual void dispose() override
;
64 virtual void Construct();
65 // initialize will be called when after the controller finished his initialize method
66 virtual void initialize(){}
67 // window overridables
68 virtual bool PreNotify( NotifyEvent
& rNEvt
) override
;
69 virtual void StateChanged( StateChangedType nStateChange
) override
;
71 IController
& getCommandController() const { return *m_xController
; }
73 const css::uno::Reference
< css::uno::XComponentContext
>& getORB() const { return m_xContext
;}
75 // the default implementation simply calls resizeAll( GetSizePixel() )
76 virtual void Resize() override
;
78 void attachFrame(const css::uno::Reference
< css::frame::XFrame
>& _xFrame
);
80 // window overridables
81 virtual void Paint( vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& _rRect
) override
;
83 /// re-arrange all controls, including the toolbox, it's separator, and the "real view"
84 virtual void resizeAll( const tools::Rectangle
& _rPlayground
);
86 // re-arrange the controls belonging to the document itself
87 virtual void resizeDocumentView( tools::Rectangle
& _rPlayground
);
90 #endif // INCLUDED_DBACCESS_DATAVIEW_HXX
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */