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
;
39 class SbaXGridControl
;
41 class UnoDataBrowserView final
: public ODataView
, public ::utl::OEventListenerAdapter
43 rtl::Reference
< SbaXGridControl
> m_xGrid
; // our grid's UNO representation
44 css::uno::Reference
< css::awt::XControlContainer
> m_xMe
; // our own UNO representation
45 VclPtr
<InterimDBTreeListBox
> m_pTreeView
;
46 VclPtr
<Splitter
> m_pSplitter
;
47 mutable VclPtr
<SbaGridControl
> m_pVclControl
; // our grid's VCL representation
49 DECL_LINK( SplitHdl
, Splitter
*, void );
52 const rtl::Reference
< SbaXGridControl
>& getGridControl() const { return m_xGrid
; }
53 SbaGridControl
* getVclControl() const;
55 UnoDataBrowserView( vcl::Window
* pParent
,
56 IController
& _rController
,
57 const css::uno::Reference
< css::uno::XComponentContext
>& );
58 virtual ~UnoDataBrowserView() override
;
59 virtual void dispose() override
;
62 void Construct(const css::uno::Reference
< css::awt::XControlModel
>& xModel
);
64 /** as columns may be hidden there is a difference between a columns model pos and its view pos
65 so we you may use these translation function
67 sal_uInt16
View2ModelPos(sal_uInt16 nPos
) const;
68 /// for the same reason the view column count isn't the same as the model column count
70 void setSplitter(Splitter
* pSplitter
);
71 void setTreeView(InterimDBTreeListBox
* pTreeView
);
73 void showStatus( const OUString
& _rStatus
);
76 const css::uno::Reference
< css::awt::XControlContainer
>& getContainer() const { return m_xMe
; }
79 virtual bool PreNotify( NotifyEvent
& rNEvt
) override
;
80 virtual void GetFocus() override
;
81 virtual void resizeDocumentView(tools::Rectangle
& rRect
) override
;
82 virtual void _disposing( const css::lang::EventObject
& _rSource
) override
;
84 using ODataView::Construct
;
87 class BrowserViewStatusDisplay final
89 VclPtr
<UnoDataBrowserView
> m_pView
;
92 BrowserViewStatusDisplay( UnoDataBrowserView
* _pView
, const OUString
& _rStatus
);
93 ~BrowserViewStatusDisplay( );
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */