update dev300-m58
[ooovba.git] / dbaccess / source / ui / querydesign / JoinDesignView.cxx
blobfab7b3d2516e52e963735d42f75afc5b54f70699
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: JoinDesignView.cxx,v $
10 * $Revision: 1.23 $
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"
35 #endif
36 #ifndef DBAUI_JOINTABLEVIEW_HXX
37 #include "JoinTableView.hxx"
38 #endif
39 #ifndef DBAUI_JOINCONTROLLER_HXX
40 #include "JoinController.hxx"
41 #endif
42 #ifndef _UNDO_HXX
43 #include <svtools/undo.hxx>
44 #endif
45 #ifndef DBAUI_QYDLGTAB_HXX
46 #include "adtabdlg.hxx"
47 #endif
48 #ifndef _SV_SVAPP_HXX
49 #include <vcl/svapp.hxx>
50 #endif
51 #ifndef _SV_MSGBOX_HXX
52 #include <vcl/msgbox.hxx>
53 #endif
54 #ifndef DBACCESS_UI_BROWSER_ID_HXX
55 #include "browserids.hxx"
56 #endif
57 #ifndef _DBU_QRY_HRC_
58 #include "dbu_qry.hrc"
59 #endif
60 #ifndef _COMPHELPER_TYPES_HXX_
61 #include <comphelper/types.hxx>
62 #endif
63 #ifndef _CONNECTIVITY_DBTOOLS_HXX_
64 #include <connectivity/dbtools.hxx>
65 #endif
66 #ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_
67 #include <com/sun/star/sdbc/DataType.hpp>
68 #endif
69 #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
70 #include <com/sun/star/container/XNameAccess.hpp>
71 #endif
72 #ifndef DBAUI_TABLECONNECTION_HXX
73 #include "TableConnection.hxx"
74 #endif
75 #ifndef DBAUI_CONNECTIONLINE_HXX
76 #include "ConnectionLine.hxx"
77 #endif
78 #ifndef DBAUI_CONNECTIONLINEDATA_HXX
79 #include "ConnectionLineData.hxx"
80 #endif
81 #ifndef DBAUI_TABLECONNECTIONDATA_HXX
82 #include "TableConnectionData.hxx"
83 #endif
84 #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
85 #include "dbustrings.hrc"
86 #endif
87 #ifndef _COMPHELPER_EXTRACT_HXX_
88 #include <comphelper/extract.hxx>
89 #endif
90 #ifndef DBAUI_TOOLS_HXX
91 #include "UITools.hxx"
92 #endif
93 #ifndef DBAUI_JOINTABLEVIEW_HXX
94 #include "JoinTableView.hxx"
95 #endif
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;
106 namespace dbaui
109 // =============================================================================
110 // = OJoinDesignView
111 // =============================================================================
112 // -----------------------------------------------------------------------------
113 OJoinDesignView::OJoinDesignView(Window* _pParent, OJoinController& _rController,const Reference< XMultiServiceFactory >& _rFactory)
114 :ODataView( _pParent, _rController, _rFactory )
115 ,m_pTableView(NULL)
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);
126 m_pTableView = NULL;
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 );
167 else
168 ODataView::KeyInput(rEvt);
170 // -----------------------------------------------------------------------------
172 } // namespace dbaui