Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_BRWVIEW_HXX
21 : #define INCLUDED_DBACCESS_SOURCE_UI_INC_BRWVIEW_HXX
22 :
23 : #include <vcl/window.hxx>
24 :
25 : #include <tools/resid.hxx>
26 :
27 : #include <com/sun/star/awt/PosSize.hpp>
28 : #include <dbaccess/dataview.hxx>
29 : #include <unotools/eventlisteneradapter.hxx>
30 :
31 : namespace com { namespace sun { namespace star { namespace awt {
32 : class XControl;
33 : class XControlContainer;
34 : class XControlModel;
35 : }}}}
36 :
37 : class Splitter;
38 :
39 : namespace dbaui
40 : {
41 : class DBTreeView;
42 : class SbaGridControl;
43 :
44 : class UnoDataBrowserView : public ODataView, public ::utl::OEventListenerAdapter
45 : {
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 : DBTreeView* m_pTreeView;
50 : Splitter* m_pSplitter;
51 : mutable SbaGridControl* m_pVclControl; // our grid's VCL representation
52 : vcl::Window* m_pStatus;
53 :
54 : DECL_LINK( SplitHdl, void* );
55 : // attribute access
56 : public:
57 47 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > getGridControl() const { return m_xGrid; }
58 : SbaGridControl* getVclControl() const;
59 :
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 :
66 : /// late construction
67 : virtual void Construct(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel);
68 :
69 : /** as columns may be hidden there is a difference between a columns model pos and its view pos
70 : so we you may use these translation function
71 : */
72 : sal_uInt16 View2ModelPos(sal_uInt16 nPos) const;
73 : /// for the same reason the view column count isn't the same as the model column count
74 :
75 : void setSplitter(Splitter* _pSplitter);
76 : void setTreeView(DBTreeView* _pTreeView);
77 :
78 : void showStatus( const OUString& _rStatus );
79 : void hideStatus();
80 :
81 2 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > getContainer() { return m_xMe; }
82 :
83 : protected:
84 : virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
85 : virtual void GetFocus() SAL_OVERRIDE;
86 : virtual void resizeDocumentView(Rectangle& rRect) SAL_OVERRIDE;
87 : virtual void _disposing( const ::com::sun::star::lang::EventObject& _rSource ) SAL_OVERRIDE;
88 :
89 : private:
90 : using ODataView::Construct;
91 : };
92 :
93 : class BrowserViewStatusDisplay
94 : {
95 : protected:
96 : UnoDataBrowserView* m_pView;
97 :
98 : public:
99 : BrowserViewStatusDisplay( UnoDataBrowserView* _pView, const OUString& _rStatus );
100 : ~BrowserViewStatusDisplay( );
101 : };
102 : }
103 : #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_BRWVIEW_HXX
104 :
105 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|