merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / relationdesign / RelationDesignView.cxx
blob7fabf5deb035b08a7828a32ba493a4f1dfad5bac
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: RelationDesignView.cxx,v $
10 * $Revision: 1.16 $
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_RELATIONDESIGNVIEW_HXX
34 #include "RelationDesignView.hxx"
35 #endif
36 #ifndef DBAUI_RELATION_TABLEVIEW_HXX
37 #include "RelationTableView.hxx"
38 #endif
39 #ifndef DBAUI_RELATIONCONTROLLER_HXX
40 #include "RelationController.hxx"
41 #endif
42 #ifndef _UNDO_HXX
43 #include <svtools/undo.hxx>
44 #endif
45 #ifndef _SV_SVAPP_HXX
46 #include <vcl/svapp.hxx>
47 #endif
48 #ifndef _SV_MSGBOX_HXX
49 #include <vcl/msgbox.hxx>
50 #endif
51 #ifndef DBACCESS_UI_BROWSER_ID_HXX
52 #include "browserids.hxx"
53 #endif
54 #ifndef _DBU_REL_HRC_
55 #include "dbu_rel.hrc"
56 #endif
57 #ifndef _COMPHELPER_TYPES_HXX_
58 #include <comphelper/types.hxx>
59 #endif
60 #ifndef _CONNECTIVITY_DBTOOLS_HXX_
61 #include <connectivity/dbtools.hxx>
62 #endif
63 #ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_
64 #include <com/sun/star/sdbc/DataType.hpp>
65 #endif
66 #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
67 #include <com/sun/star/container/XNameAccess.hpp>
68 #endif
69 #ifndef DBAUI_RTABLECONNECTION_HXX
70 #include "RTableConnection.hxx"
71 #endif
72 #ifndef DBAUI_CONNECTIONLINE_HXX
73 #include "ConnectionLine.hxx"
74 #endif
75 #ifndef DBAUI_CONNECTIONLINEDATA_HXX
76 #include "ConnectionLineData.hxx"
77 #endif
78 #ifndef DBAUI_RTABLECONNECTIONDATA_HXX
79 #include "RTableConnectionData.hxx"
80 #endif
81 #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
82 #include "dbustrings.hrc"
83 #endif
84 #ifndef _COMPHELPER_EXTRACT_HXX_
85 #include <comphelper/extract.hxx>
86 #endif
87 #ifndef DBAUI_TOOLS_HXX
88 #include "UITools.hxx"
89 #endif
90 #ifndef _TOOLS_DEBUG_HXX
91 #include <tools/debug.hxx>
92 #endif
94 using namespace ::dbaui;
95 using namespace ::com::sun::star::uno;
96 using namespace ::com::sun::star::lang;
97 using namespace ::com::sun::star::sdbc;
98 using namespace ::com::sun::star::beans;
99 using namespace ::com::sun::star::container;
101 DBG_NAME(ORelationDesignView)
102 ORelationDesignView::ORelationDesignView(Window* _pParent, ORelationController& _rController,const Reference< XMultiServiceFactory >& _rFactory)
103 :OJoinDesignView( _pParent, _rController, _rFactory )
105 DBG_CTOR(ORelationDesignView,NULL);
107 // -----------------------------------------------------------------------------
108 ORelationDesignView::~ORelationDesignView()
110 DBG_DTOR(ORelationDesignView,NULL);
112 // -------------------------------------------------------------------------
113 void ORelationDesignView::Construct()
115 m_pTableView = new ORelationTableView(m_pScrollWindow,this);
116 OJoinDesignView::Construct();
118 // -----------------------------------------------------------------------------
119 void ORelationDesignView::initialize()
121 m_pTableView->clearLayoutInformation();
122 m_pTableView->ReSync();
124 OJoinDesignView::initialize();
126 // -----------------------------------------------------------------------------
127 long ORelationDesignView::PreNotify( NotifyEvent& rNEvt )
129 long nDone = 0L;
130 if(rNEvt.GetType() == EVENT_GETFOCUS)
132 if(!m_pTableView->HasChildPathFocus())
134 m_pTableView->GrabTabWinFocus();
135 nDone = 1L;
138 if(!nDone)
139 nDone = OJoinDesignView::PreNotify(rNEvt);
140 return nDone;
142 // -----------------------------------------------------------------------------
143 void ORelationDesignView::GetFocus()
145 OJoinDesignView::GetFocus();
146 if ( m_pTableView && m_pTableView->IsVisible() && !m_pTableView->GetTabWinMap()->empty() )
147 m_pTableView->GrabTabWinFocus();
149 // -----------------------------------------------------------------------------