Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / dbaccess / source / ui / querydesign / JoinDesignView.cxx
blob81564fb9f9bbeb3e7dda21d2af18c4168bb15b72
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "JoinDesignView.hxx"
21 #include "JoinTableView.hxx"
22 #include "JoinController.hxx"
23 #include <svl/undo.hxx>
24 #include "adtabdlg.hxx"
25 #include <vcl/svapp.hxx>
26 #include <vcl/msgbox.hxx>
27 #include "browserids.hxx"
28 #include "dbu_qry.hrc"
29 #include <comphelper/types.hxx>
30 #include <connectivity/dbtools.hxx>
31 #include <com/sun/star/sdbc/DataType.hpp>
32 #include <com/sun/star/container/XNameAccess.hpp>
33 #include "TableConnection.hxx"
34 #include "ConnectionLine.hxx"
35 #include "ConnectionLineData.hxx"
36 #include "TableConnectionData.hxx"
37 #include "dbustrings.hrc"
38 #include <comphelper/extract.hxx>
39 #include "UITools.hxx"
40 #include <vcl/settings.hxx>
42 using namespace ::com::sun::star::uno;
43 using namespace ::com::sun::star::lang;
44 using namespace ::com::sun::star::i18n;
45 using namespace ::com::sun::star::sdbc;
46 using namespace ::com::sun::star::beans;
47 using namespace ::com::sun::star::container;
48 using namespace ::com::sun::star::util;
50 namespace dbaui
53 // OJoinDesignView
54 OJoinDesignView::OJoinDesignView(vcl::Window* _pParent, OJoinController& _rController,const Reference< XComponentContext >& _rxContext)
55 :ODataView( _pParent, _rController, _rxContext )
56 ,m_pTableView(nullptr)
57 ,m_rController( _rController )
59 m_pScrollWindow = VclPtr<OScrollWindowHelper>::Create(this);
62 OJoinDesignView::~OJoinDesignView()
64 disposeOnce();
67 void OJoinDesignView::dispose()
69 m_pTableView.disposeAndClear();
70 m_pScrollWindow.disposeAndClear();
71 ODataView::dispose();
74 void OJoinDesignView::Construct()
76 m_pScrollWindow->setTableView(m_pTableView);
77 m_pScrollWindow->Show();
78 m_pTableView->Show();
80 SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
82 ODataView::Construct();
85 void OJoinDesignView::initialize()
89 void OJoinDesignView::resizeDocumentView(Rectangle& _rPlayground)
91 m_pScrollWindow->SetPosSizePixel( _rPlayground.TopLeft(), _rPlayground.GetSize() );
93 // just for completeness: there is no space left, we occupied it all ...
94 _rPlayground.SetPos( _rPlayground.BottomRight() );
95 _rPlayground.SetSize( Size( 0, 0 ) );
98 void OJoinDesignView::setReadOnly(bool /*_bReadOnly*/)
102 void OJoinDesignView::SaveTabWinUIConfig(OTableWindow* pWin)
104 OJoinController::SaveTabWinPosSize(pWin, m_pScrollWindow->GetHScrollBar().GetThumbPos(), m_pScrollWindow->GetVScrollBar().GetThumbPos());
107 void OJoinDesignView::KeyInput( const KeyEvent& rEvt )
109 if ( m_pTableView && m_pTableView->IsVisible() )
110 m_pTableView->KeyInput( rEvt );
111 else
112 ODataView::KeyInput(rEvt);
115 } // namespace dbaui
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */