xref: /trunk/main/dbaccess/source/ui/inc/brwview.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SBX_BRWVIEW_HXX
29 #define _SBX_BRWVIEW_HXX
30 
31 #ifndef _SV_WINDOW_HXX //autogen
32 #include <vcl/window.hxx>
33 #endif
34 
35 #ifndef _TOOLS_RESID_HXX //autogen wg. ResId
36 #include <tools/resid.hxx>
37 #endif
38 
39 #ifndef _COM_SUN_STAR_AWT_POSSIZE_HPP_
40 #include <com/sun/star/awt/PosSize.hpp>
41 #endif
42 #ifndef DBAUI_DATAVIEW_HXX
43 #include "dataview.hxx"
44 #endif
45 #ifndef _UNOTOOLS_EVENTLISTENERADAPTER_HXX_
46 #include <unotools/eventlisteneradapter.hxx>
47 #endif
48 
49 
50 namespace com { namespace sun { namespace star { namespace awt {
51     class XControl;
52     class XControlContainer;
53     class XControlModel;
54 }}}}
55 
56 // =========================================================================
57 class ResMgr;
58 class Splitter;
59 
60 namespace dbaui
61 {
62     class DBTreeView;
63     class SbaGridControl;
64 
65     class UnoDataBrowserView : public ODataView, public ::utl::OEventListenerAdapter
66     {
67     protected:
68         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >                 m_xGrid;            // our grid's UNO representation
69         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >        m_xMe;              // our own UNO representation
70         DBTreeView*             m_pTreeView;
71         Splitter*               m_pSplitter;
72         mutable SbaGridControl* m_pVclControl;  // our grid's VCL representation
73         Window*                 m_pStatus;
74 
75         DECL_LINK( SplitHdl, void* );
76     // attribute access
77     public:
78         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >             getGridControl() const  { return m_xGrid; }
79         SbaGridControl*         getVclControl() const;
80 
81     public:
82         UnoDataBrowserView( Window* pParent,
83                             IController& _rController,
84                             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
85         virtual ~UnoDataBrowserView();
86 
87         /// late construction
88         virtual void Construct(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel);
89 
90         /** as columns may be hidden there is a difference between a columns model pos and its view pos
91             so we you may use these translation function
92         */
93         sal_uInt16 View2ModelPos(sal_uInt16 nPos) const;
94         /// for the same reason the view column count isn't the same as the model column count
95 
96         void setSplitter(Splitter* _pSplitter);
97         void setTreeView(DBTreeView* _pTreeView);
98 
99         void    showStatus( const String& _rStatus );
100         void    hideStatus();
101 
102         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >     getContainer() { return m_xMe; }
103 
104     protected:
105         virtual long PreNotify( NotifyEvent& rNEvt );
106         virtual void GetFocus();
107         virtual void resizeDocumentView(Rectangle& rRect);
108         virtual void _disposing( const ::com::sun::star::lang::EventObject& _rSource );
109 
110     private:
111         using ODataView::Construct;
112     };
113 
114     class BrowserViewStatusDisplay
115     {
116     protected:
117         UnoDataBrowserView*     m_pView;
118 
119     public:
120         BrowserViewStatusDisplay( UnoDataBrowserView* _pView, const String& _rStatus );
121         ~BrowserViewStatusDisplay( );
122     };
123 }
124 #endif // _SBX_BRWVIEW_HXX
125 
126