Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / dbaccess / source / ui / inc / brwview.hxx
blobd20d90231b088c52ce2bbd38913fdc747d33ef10
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_BRWVIEW_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_INC_BRWVIEW_HXX
23 #include <vcl/window.hxx>
25 #include <tools/resid.hxx>
27 #include <com/sun/star/awt/PosSize.hpp>
28 #include <dbaccess/dataview.hxx>
29 #include <unotools/eventlisteneradapter.hxx>
31 namespace com { namespace sun { namespace star { namespace awt {
32 class XControl;
33 class XControlContainer;
34 class XControlModel;
35 }}}}
37 class Splitter;
39 namespace dbaui
41 class DBTreeView;
42 class SbaGridControl;
44 class UnoDataBrowserView : public ODataView, public ::utl::OEventListenerAdapter
46 protected:
47 css::uno::Reference< css::awt::XControl > m_xGrid; // our grid's UNO representation
48 css::uno::Reference< css::awt::XControlContainer > m_xMe; // our own UNO representation
49 VclPtr<DBTreeView> m_pTreeView;
50 VclPtr<Splitter> m_pSplitter;
51 mutable VclPtr<SbaGridControl> m_pVclControl; // our grid's VCL representation
52 VclPtr<vcl::Window> m_pStatus;
54 DECL_LINK_TYPED( SplitHdl, Splitter*, void );
55 // attribute access
56 public:
57 const css::uno::Reference< css::awt::XControl >& getGridControl() const { return m_xGrid; }
58 SbaGridControl* getVclControl() const;
60 public:
61 UnoDataBrowserView( vcl::Window* pParent,
62 IController& _rController,
63 const css::uno::Reference< css::uno::XComponentContext >& );
64 virtual ~UnoDataBrowserView();
65 virtual void dispose() override;
67 /// late construction
68 void Construct(const css::uno::Reference< css::awt::XControlModel >& xModel);
70 /** as columns may be hidden there is a difference between a columns model pos and its view pos
71 so we you may use these translation function
73 sal_uInt16 View2ModelPos(sal_uInt16 nPos) const;
74 /// for the same reason the view column count isn't the same as the model column count
76 void setSplitter(Splitter* _pSplitter);
77 void setTreeView(DBTreeView* _pTreeView);
79 void showStatus( const OUString& _rStatus );
80 void hideStatus();
82 const css::uno::Reference< css::awt::XControlContainer >& getContainer() { return m_xMe; }
84 protected:
85 virtual bool PreNotify( NotifyEvent& rNEvt ) override;
86 virtual void GetFocus() override;
87 virtual void resizeDocumentView(Rectangle& rRect) override;
88 virtual void _disposing( const css::lang::EventObject& _rSource ) override;
90 private:
91 using ODataView::Construct;
94 class BrowserViewStatusDisplay
96 protected:
97 VclPtr<UnoDataBrowserView> m_pView;
99 public:
100 BrowserViewStatusDisplay( UnoDataBrowserView* _pView, const OUString& _rStatus );
101 ~BrowserViewStatusDisplay( );
104 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_BRWVIEW_HXX
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */