Bump version to 5.0-14
[LibreOffice.git] / dbaccess / source / ui / inc / brwview.hxx
blobe68ff09847c44687a51cb6a1dfd5e31405d87d07
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 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > m_xGrid; // our grid's UNO representation
48 ::com::sun::star::uno::Reference< ::com::sun::star::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( SplitHdl, void* );
55 // attribute access
56 public:
57 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > getGridControl() const { return m_xGrid; }
58 SbaGridControl* getVclControl() const;
60 public:
61 UnoDataBrowserView( vcl::Window* pParent,
62 IController& _rController,
63 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& );
64 virtual ~UnoDataBrowserView();
65 virtual void dispose() SAL_OVERRIDE;
67 /// late construction
68 void Construct(const ::com::sun::star::uno::Reference< ::com::sun::star::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 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > getContainer() { return m_xMe; }
84 protected:
85 virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
86 virtual void GetFocus() SAL_OVERRIDE;
87 virtual void resizeDocumentView(Rectangle& rRect) SAL_OVERRIDE;
88 virtual void _disposing( const ::com::sun::star::lang::EventObject& _rSource ) SAL_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: */