Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include "RelationDesignView.hxx"
21 : #include "RelationTableView.hxx"
22 : #include "RelationController.hxx"
23 : #include <svl/undo.hxx>
24 : #include <vcl/svapp.hxx>
25 : #include <vcl/msgbox.hxx>
26 : #include "browserids.hxx"
27 : #include "dbu_rel.hrc"
28 : #include <comphelper/types.hxx>
29 : #include <connectivity/dbtools.hxx>
30 : #include <com/sun/star/sdbc/DataType.hpp>
31 : #include <com/sun/star/container/XNameAccess.hpp>
32 : #include "RTableConnection.hxx"
33 : #include "ConnectionLine.hxx"
34 : #include "ConnectionLineData.hxx"
35 : #include "RTableConnectionData.hxx"
36 : #include "dbustrings.hrc"
37 : #include <comphelper/extract.hxx>
38 : #include "UITools.hxx"
39 : #include <tools/debug.hxx>
40 :
41 : using namespace ::dbaui;
42 : using namespace ::com::sun::star::uno;
43 : using namespace ::com::sun::star::lang;
44 : using namespace ::com::sun::star::sdbc;
45 : using namespace ::com::sun::star::beans;
46 : using namespace ::com::sun::star::container;
47 :
48 0 : ORelationDesignView::ORelationDesignView(vcl::Window* _pParent, ORelationController& _rController,const Reference< XComponentContext >& _rxContext)
49 0 : :OJoinDesignView( _pParent, _rController, _rxContext )
50 : {
51 0 : }
52 :
53 0 : void ORelationDesignView::Construct()
54 : {
55 0 : m_pTableView = VclPtr<ORelationTableView>::Create(m_pScrollWindow,this);
56 0 : OJoinDesignView::Construct();
57 0 : }
58 :
59 0 : void ORelationDesignView::initialize()
60 : {
61 0 : m_pTableView->clearLayoutInformation();
62 0 : m_pTableView->ReSync();
63 :
64 0 : OJoinDesignView::initialize();
65 0 : }
66 :
67 0 : bool ORelationDesignView::PreNotify( NotifyEvent& rNEvt )
68 : {
69 0 : bool nDone = false;
70 0 : if(rNEvt.GetType() == MouseNotifyEvent::GETFOCUS)
71 : {
72 0 : if(!m_pTableView->HasChildPathFocus())
73 : {
74 0 : m_pTableView->GrabTabWinFocus();
75 0 : nDone = true;
76 : }
77 : }
78 0 : if(!nDone)
79 0 : nDone = OJoinDesignView::PreNotify(rNEvt);
80 0 : return nDone;
81 : }
82 :
83 0 : void ORelationDesignView::GetFocus()
84 : {
85 0 : OJoinDesignView::GetFocus();
86 0 : if ( m_pTableView && m_pTableView->IsVisible() && !m_pTableView->GetTabWinMap().empty() )
87 0 : m_pTableView->GrabTabWinFocus();
88 36 : }
89 :
90 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|