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 "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>
41 :
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;
49 :
50 : namespace dbaui
51 : {
52 :
53 : // OJoinDesignView
54 0 : OJoinDesignView::OJoinDesignView(Window* _pParent, OJoinController& _rController,const Reference< XComponentContext >& _rxContext)
55 : :ODataView( _pParent, _rController, _rxContext )
56 : ,m_pTableView(NULL)
57 0 : ,m_rController( _rController )
58 : {
59 0 : m_pScrollWindow = new OScrollWindowHelper(this);
60 0 : }
61 :
62 0 : OJoinDesignView::~OJoinDesignView()
63 : {
64 0 : boost::scoped_ptr<Window> aT3(m_pScrollWindow);
65 0 : m_pScrollWindow = NULL;
66 0 : boost::scoped_ptr<Window> aT2(m_pTableView);
67 0 : m_pTableView = NULL;
68 0 : }
69 :
70 0 : void OJoinDesignView::Construct()
71 : {
72 0 : m_pScrollWindow->setTableView(m_pTableView);
73 0 : m_pScrollWindow->Show();
74 0 : m_pTableView->Show();
75 :
76 0 : SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
77 :
78 0 : ODataView::Construct();
79 0 : }
80 :
81 0 : void OJoinDesignView::initialize()
82 : {
83 0 : }
84 :
85 0 : void OJoinDesignView::resizeDocumentView(Rectangle& _rPlayground)
86 : {
87 0 : m_pScrollWindow->SetPosSizePixel( _rPlayground.TopLeft(), _rPlayground.GetSize() );
88 :
89 : // just for completeness: there is no space left, we occupied it all ...
90 0 : _rPlayground.SetPos( _rPlayground.BottomRight() );
91 0 : _rPlayground.SetSize( Size( 0, 0 ) );
92 0 : }
93 :
94 0 : void OJoinDesignView::setReadOnly(sal_Bool /*_bReadOnly*/)
95 : {
96 0 : }
97 :
98 0 : void OJoinDesignView::SaveTabWinUIConfig(OTableWindow* pWin)
99 : {
100 0 : getController().SaveTabWinPosSize(pWin, m_pScrollWindow->GetHScrollBar()->GetThumbPos(), m_pScrollWindow->GetVScrollBar()->GetThumbPos());
101 0 : }
102 :
103 0 : void OJoinDesignView::KeyInput( const KeyEvent& rEvt )
104 : {
105 0 : if ( m_pTableView && m_pTableView->IsVisible() )
106 0 : m_pTableView->KeyInput( rEvt );
107 : else
108 0 : ODataView::KeyInput(rEvt);
109 0 : }
110 :
111 : } // namespace dbaui
112 :
113 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|