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