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 : 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;
53 :
54 : DECL_LINK( SplitHdl, void* );
55 : // attribute access
56 : public:
57 22 : ::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 : virtual void dispose() SAL_OVERRIDE;
66 :
67 : /// late construction
68 : void Construct(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel);
69 :
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
72 : */
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
75 :
76 : void setSplitter(Splitter* _pSplitter);
77 : void setTreeView(DBTreeView* _pTreeView);
78 :
79 : void showStatus( const OUString& _rStatus );
80 : void hideStatus();
81 :
82 1 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > getContainer() { return m_xMe; }
83 :
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;
89 :
90 : private:
91 : using ODataView::Construct;
92 : };
93 :
94 : class BrowserViewStatusDisplay
95 : {
96 : protected:
97 : VclPtr<UnoDataBrowserView> m_pView;
98 :
99 : public:
100 : BrowserViewStatusDisplay( UnoDataBrowserView* _pView, const OUString& _rStatus );
101 : ~BrowserViewStatusDisplay( );
102 : };
103 : }
104 : #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_BRWVIEW_HXX
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|