1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: JoinDesignView.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_dbaccess.hxx"
33 #ifndef DBAUI_JOINDESIGNVIEW_HXX
34 #include "JoinDesignView.hxx"
36 #ifndef DBAUI_JOINTABLEVIEW_HXX
37 #include "JoinTableView.hxx"
39 #ifndef DBAUI_JOINCONTROLLER_HXX
40 #include "JoinController.hxx"
43 #include <svtools/undo.hxx>
45 #ifndef DBAUI_QYDLGTAB_HXX
46 #include "adtabdlg.hxx"
49 #include <vcl/svapp.hxx>
51 #ifndef _SV_MSGBOX_HXX
52 #include <vcl/msgbox.hxx>
54 #ifndef DBACCESS_UI_BROWSER_ID_HXX
55 #include "browserids.hxx"
58 #include "dbu_qry.hrc"
60 #ifndef _COMPHELPER_TYPES_HXX_
61 #include <comphelper/types.hxx>
63 #ifndef _CONNECTIVITY_DBTOOLS_HXX_
64 #include <connectivity/dbtools.hxx>
66 #ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_
67 #include <com/sun/star/sdbc/DataType.hpp>
69 #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
70 #include <com/sun/star/container/XNameAccess.hpp>
72 #ifndef DBAUI_TABLECONNECTION_HXX
73 #include "TableConnection.hxx"
75 #ifndef DBAUI_CONNECTIONLINE_HXX
76 #include "ConnectionLine.hxx"
78 #ifndef DBAUI_CONNECTIONLINEDATA_HXX
79 #include "ConnectionLineData.hxx"
81 #ifndef DBAUI_TABLECONNECTIONDATA_HXX
82 #include "TableConnectionData.hxx"
84 #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
85 #include "dbustrings.hrc"
87 #ifndef _COMPHELPER_EXTRACT_HXX_
88 #include <comphelper/extract.hxx>
90 #ifndef DBAUI_TOOLS_HXX
91 #include "UITools.hxx"
93 #ifndef DBAUI_JOINTABLEVIEW_HXX
94 #include "JoinTableView.hxx"
96 // #include <com/sun/star/util/URL.hdl>
98 using namespace ::com::sun::star::uno
;
99 using namespace ::com::sun::star::lang
;
100 using namespace ::com::sun::star::i18n
;
101 using namespace ::com::sun::star::sdbc
;
102 using namespace ::com::sun::star::beans
;
103 using namespace ::com::sun::star::container
;
104 using namespace ::com::sun::star::util
;
109 // =============================================================================
111 // =============================================================================
112 // -----------------------------------------------------------------------------
113 OJoinDesignView::OJoinDesignView(Window
* _pParent
, OJoinController
& _rController
,const Reference
< XMultiServiceFactory
>& _rFactory
)
114 :ODataView( _pParent
, _rController
, _rFactory
)
116 ,m_rController( _rController
)
118 m_pScrollWindow
= new OScrollWindowHelper(this);
120 // -----------------------------------------------------------------------------
121 OJoinDesignView::~OJoinDesignView()
123 ::std::auto_ptr
<Window
> aT3(m_pScrollWindow
);
124 m_pScrollWindow
= NULL
;
125 ::std::auto_ptr
<Window
> aT2(m_pTableView
);
128 // -------------------------------------------------------------------------
129 void OJoinDesignView::Construct()
131 m_pScrollWindow
->setTableView(m_pTableView
);
132 m_pScrollWindow
->Show();
133 m_pTableView
->Show();
135 SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
137 ODataView::Construct();
139 // -----------------------------------------------------------------------------
140 void OJoinDesignView::initialize()
142 // getAddTableDialog()->Update();
144 // -------------------------------------------------------------------------
145 void OJoinDesignView::resizeDocumentView(Rectangle
& _rPlayground
)
147 m_pScrollWindow
->SetPosSizePixel( _rPlayground
.TopLeft(), _rPlayground
.GetSize() );
149 // just for completeness: there is no space left, we occupied it all ...
150 _rPlayground
.SetPos( _rPlayground
.BottomRight() );
151 _rPlayground
.SetSize( Size( 0, 0 ) );
153 // -----------------------------------------------------------------------------
154 void OJoinDesignView::setReadOnly(sal_Bool
/*_bReadOnly*/)
157 // -----------------------------------------------------------------------------
158 void OJoinDesignView::SaveTabWinUIConfig(OTableWindow
* pWin
)
160 getController().SaveTabWinPosSize(pWin
, m_pScrollWindow
->GetHScrollBar()->GetThumbPos(), m_pScrollWindow
->GetVScrollBar()->GetThumbPos());
162 // -----------------------------------------------------------------------------
163 void OJoinDesignView::KeyInput( const KeyEvent
& rEvt
)
165 if ( m_pTableView
&& m_pTableView
->IsVisible() )
166 m_pTableView
->KeyInput( rEvt
);
168 ODataView::KeyInput(rEvt
);
170 // -----------------------------------------------------------------------------