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 _SBX_BRWVIEW_HXX
21 : #define _SBX_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 "dataview.hxx"
29 : #include <unotools/eventlisteneradapter.hxx>
30 :
31 :
32 : namespace com { namespace sun { namespace star { namespace awt {
33 : class XControl;
34 : class XControlContainer;
35 : class XControlModel;
36 : }}}}
37 :
38 : // =========================================================================
39 : class Splitter;
40 :
41 : namespace dbaui
42 : {
43 : class DBTreeView;
44 : class SbaGridControl;
45 :
46 : class UnoDataBrowserView : public ODataView, public ::utl::OEventListenerAdapter
47 : {
48 : protected:
49 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > m_xGrid; // our grid's UNO representation
50 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > m_xMe; // our own UNO representation
51 : DBTreeView* m_pTreeView;
52 : Splitter* m_pSplitter;
53 : mutable SbaGridControl* m_pVclControl; // our grid's VCL representation
54 : Window* m_pStatus;
55 :
56 : DECL_LINK( SplitHdl, void* );
57 : // attribute access
58 : public:
59 0 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > getGridControl() const { return m_xGrid; }
60 : SbaGridControl* getVclControl() const;
61 :
62 : public:
63 : UnoDataBrowserView( Window* pParent,
64 : IController& _rController,
65 : const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& );
66 : virtual ~UnoDataBrowserView();
67 :
68 : /// late construction
69 : virtual void Construct(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel);
70 :
71 : /** as columns may be hidden there is a difference between a columns model pos and its view pos
72 : so we you may use these translation function
73 : */
74 : sal_uInt16 View2ModelPos(sal_uInt16 nPos) const;
75 : /// for the same reason the view column count isn't the same as the model column count
76 :
77 : void setSplitter(Splitter* _pSplitter);
78 : void setTreeView(DBTreeView* _pTreeView);
79 :
80 : void showStatus( const String& _rStatus );
81 : void hideStatus();
82 :
83 0 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > getContainer() { return m_xMe; }
84 :
85 : protected:
86 : virtual long PreNotify( NotifyEvent& rNEvt );
87 : virtual void GetFocus();
88 : virtual void resizeDocumentView(Rectangle& rRect);
89 : virtual void _disposing( const ::com::sun::star::lang::EventObject& _rSource );
90 :
91 : private:
92 : using ODataView::Construct;
93 : };
94 :
95 : class BrowserViewStatusDisplay
96 : {
97 : protected:
98 : UnoDataBrowserView* m_pView;
99 :
100 : public:
101 : BrowserViewStatusDisplay( UnoDataBrowserView* _pView, const String& _rStatus );
102 : ~BrowserViewStatusDisplay( );
103 : };
104 : }
105 : #endif // _SBX_BRWVIEW_HXX
106 :
107 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|