1*96de5490SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*96de5490SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*96de5490SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*96de5490SAndrew Rist  * distributed with this work for additional information
6*96de5490SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*96de5490SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*96de5490SAndrew Rist  * "License"); you may not use this file except in compliance
9*96de5490SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*96de5490SAndrew Rist  *
11*96de5490SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*96de5490SAndrew Rist  *
13*96de5490SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*96de5490SAndrew Rist  * software distributed under the License is distributed on an
15*96de5490SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*96de5490SAndrew Rist  * KIND, either express or implied.  See the License for the
17*96de5490SAndrew Rist  * specific language governing permissions and limitations
18*96de5490SAndrew Rist  * under the License.
19*96de5490SAndrew Rist  *
20*96de5490SAndrew Rist  *************************************************************/
21*96de5490SAndrew Rist 
22*96de5490SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_dbaccess.hxx"
26cdf0e10cSrcweir #ifndef DBAUI_RELATIONDESIGNVIEW_HXX
27cdf0e10cSrcweir #include "RelationDesignView.hxx"
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir #ifndef DBAUI_RELATION_TABLEVIEW_HXX
30cdf0e10cSrcweir #include "RelationTableView.hxx"
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #ifndef DBAUI_RELATIONCONTROLLER_HXX
33cdf0e10cSrcweir #include "RelationController.hxx"
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir #ifndef _UNDO_HXX
36cdf0e10cSrcweir #include <svl/undo.hxx>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #ifndef _SV_SVAPP_HXX
39cdf0e10cSrcweir #include <vcl/svapp.hxx>
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #ifndef _SV_MSGBOX_HXX
42cdf0e10cSrcweir #include <vcl/msgbox.hxx>
43cdf0e10cSrcweir #endif
44cdf0e10cSrcweir #ifndef DBACCESS_UI_BROWSER_ID_HXX
45cdf0e10cSrcweir #include "browserids.hxx"
46cdf0e10cSrcweir #endif
47cdf0e10cSrcweir #ifndef _DBU_REL_HRC_
48cdf0e10cSrcweir #include "dbu_rel.hrc"
49cdf0e10cSrcweir #endif
50cdf0e10cSrcweir #ifndef _COMPHELPER_TYPES_HXX_
51cdf0e10cSrcweir #include <comphelper/types.hxx>
52cdf0e10cSrcweir #endif
53cdf0e10cSrcweir #ifndef _CONNECTIVITY_DBTOOLS_HXX_
54cdf0e10cSrcweir #include <connectivity/dbtools.hxx>
55cdf0e10cSrcweir #endif
56cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_
57cdf0e10cSrcweir #include <com/sun/star/sdbc/DataType.hpp>
58cdf0e10cSrcweir #endif
59cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
60cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
61cdf0e10cSrcweir #endif
62cdf0e10cSrcweir #ifndef DBAUI_RTABLECONNECTION_HXX
63cdf0e10cSrcweir #include "RTableConnection.hxx"
64cdf0e10cSrcweir #endif
65cdf0e10cSrcweir #ifndef DBAUI_CONNECTIONLINE_HXX
66cdf0e10cSrcweir #include "ConnectionLine.hxx"
67cdf0e10cSrcweir #endif
68cdf0e10cSrcweir #ifndef DBAUI_CONNECTIONLINEDATA_HXX
69cdf0e10cSrcweir #include "ConnectionLineData.hxx"
70cdf0e10cSrcweir #endif
71cdf0e10cSrcweir #ifndef DBAUI_RTABLECONNECTIONDATA_HXX
72cdf0e10cSrcweir #include "RTableConnectionData.hxx"
73cdf0e10cSrcweir #endif
74cdf0e10cSrcweir #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
75cdf0e10cSrcweir #include "dbustrings.hrc"
76cdf0e10cSrcweir #endif
77cdf0e10cSrcweir #ifndef _COMPHELPER_EXTRACT_HXX_
78cdf0e10cSrcweir #include <comphelper/extract.hxx>
79cdf0e10cSrcweir #endif
80cdf0e10cSrcweir #ifndef DBAUI_TOOLS_HXX
81cdf0e10cSrcweir #include "UITools.hxx"
82cdf0e10cSrcweir #endif
83cdf0e10cSrcweir #ifndef _TOOLS_DEBUG_HXX
84cdf0e10cSrcweir #include <tools/debug.hxx>
85cdf0e10cSrcweir #endif
86cdf0e10cSrcweir 
87cdf0e10cSrcweir using namespace ::dbaui;
88cdf0e10cSrcweir using namespace ::com::sun::star::uno;
89cdf0e10cSrcweir using namespace ::com::sun::star::lang;
90cdf0e10cSrcweir using namespace ::com::sun::star::sdbc;
91cdf0e10cSrcweir using namespace ::com::sun::star::beans;
92cdf0e10cSrcweir using namespace ::com::sun::star::container;
93cdf0e10cSrcweir 
94cdf0e10cSrcweir DBG_NAME(ORelationDesignView)
95cdf0e10cSrcweir ORelationDesignView::ORelationDesignView(Window* _pParent, ORelationController& _rController,const Reference< XMultiServiceFactory >& _rFactory)
96cdf0e10cSrcweir 	:OJoinDesignView( _pParent, _rController, _rFactory )
97cdf0e10cSrcweir {
98cdf0e10cSrcweir 	DBG_CTOR(ORelationDesignView,NULL);
99cdf0e10cSrcweir }
100cdf0e10cSrcweir // -----------------------------------------------------------------------------
101cdf0e10cSrcweir ORelationDesignView::~ORelationDesignView()
102cdf0e10cSrcweir {
103cdf0e10cSrcweir 	DBG_DTOR(ORelationDesignView,NULL);
104cdf0e10cSrcweir }
105cdf0e10cSrcweir // -------------------------------------------------------------------------
106cdf0e10cSrcweir void ORelationDesignView::Construct()
107cdf0e10cSrcweir {
108cdf0e10cSrcweir 	m_pTableView	= new ORelationTableView(m_pScrollWindow,this);
109cdf0e10cSrcweir 	OJoinDesignView::Construct();
110cdf0e10cSrcweir }
111cdf0e10cSrcweir // -----------------------------------------------------------------------------
112cdf0e10cSrcweir void ORelationDesignView::initialize()
113cdf0e10cSrcweir {
114cdf0e10cSrcweir 	m_pTableView->clearLayoutInformation();
115cdf0e10cSrcweir 	m_pTableView->ReSync();
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 	OJoinDesignView::initialize();
118cdf0e10cSrcweir }
119cdf0e10cSrcweir // -----------------------------------------------------------------------------
120cdf0e10cSrcweir long ORelationDesignView::PreNotify( NotifyEvent& rNEvt )
121cdf0e10cSrcweir {
122cdf0e10cSrcweir 	long nDone = 0L;
123cdf0e10cSrcweir 	if(rNEvt.GetType() == EVENT_GETFOCUS)
124cdf0e10cSrcweir 	{
125cdf0e10cSrcweir 		if(!m_pTableView->HasChildPathFocus())
126cdf0e10cSrcweir 		{
127cdf0e10cSrcweir 			m_pTableView->GrabTabWinFocus();
128cdf0e10cSrcweir 			nDone = 1L;
129cdf0e10cSrcweir 		}
130cdf0e10cSrcweir 	}
131cdf0e10cSrcweir 	if(!nDone)
132cdf0e10cSrcweir 		nDone = OJoinDesignView::PreNotify(rNEvt);
133cdf0e10cSrcweir 	return nDone;
134cdf0e10cSrcweir }
135cdf0e10cSrcweir // -----------------------------------------------------------------------------
136cdf0e10cSrcweir void ORelationDesignView::GetFocus()
137cdf0e10cSrcweir {
138cdf0e10cSrcweir 	OJoinDesignView::GetFocus();
139cdf0e10cSrcweir 	if ( m_pTableView && m_pTableView->IsVisible() && !m_pTableView->GetTabWinMap()->empty() )
140cdf0e10cSrcweir 		m_pTableView->GrabTabWinFocus();
141cdf0e10cSrcweir }
142cdf0e10cSrcweir // -----------------------------------------------------------------------------
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 
146cdf0e10cSrcweir 
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 
149cdf0e10cSrcweir 
150