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 .
22 #include <vcl/window.hxx>
24 #include <dbaccess/dataview.hxx>
25 #include <unotools/eventlisteneradapter.hxx>
26 #include "dbtreelistbox.hxx"
28 namespace com::sun::star::awt
{
30 class XControlContainer
;
40 class UnoDataBrowserView final
: public ODataView
, public ::utl::OEventListenerAdapter
42 css::uno::Reference
< css::awt::XControl
> m_xGrid
; // our grid's UNO representation
43 css::uno::Reference
< css::awt::XControlContainer
> m_xMe
; // our own UNO representation
44 VclPtr
<InterimDBTreeListBox
> m_pTreeView
;
45 VclPtr
<Splitter
> m_pSplitter
;
46 mutable VclPtr
<SbaGridControl
> m_pVclControl
; // our grid's VCL representation
48 DECL_LINK( SplitHdl
, Splitter
*, void );
51 const css::uno::Reference
< css::awt::XControl
>& getGridControl() const { return m_xGrid
; }
52 SbaGridControl
* getVclControl() const;
54 UnoDataBrowserView( vcl::Window
* pParent
,
55 IController
& _rController
,
56 const css::uno::Reference
< css::uno::XComponentContext
>& );
57 virtual ~UnoDataBrowserView() override
;
58 virtual void dispose() override
;
61 void Construct(const css::uno::Reference
< css::awt::XControlModel
>& xModel
);
63 /** as columns may be hidden there is a difference between a columns model pos and its view pos
64 so we you may use these translation function
66 sal_uInt16
View2ModelPos(sal_uInt16 nPos
) const;
67 /// for the same reason the view column count isn't the same as the model column count
69 void setSplitter(Splitter
* pSplitter
);
70 void setTreeView(InterimDBTreeListBox
* pTreeView
);
72 void showStatus( const OUString
& _rStatus
);
75 const css::uno::Reference
< css::awt::XControlContainer
>& getContainer() const { return m_xMe
; }
78 virtual bool PreNotify( NotifyEvent
& rNEvt
) override
;
79 virtual void GetFocus() override
;
80 virtual void resizeDocumentView(tools::Rectangle
& rRect
) override
;
81 virtual void _disposing( const css::lang::EventObject
& _rSource
) override
;
83 using ODataView::Construct
;
86 class BrowserViewStatusDisplay final
88 VclPtr
<UnoDataBrowserView
> m_pView
;
91 BrowserViewStatusDisplay( UnoDataBrowserView
* _pView
, const OUString
& _rStatus
);
92 ~BrowserViewStatusDisplay( );
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */