Branch data 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 : :
41 : : using namespace ::com::sun::star::uno;
42 : : using namespace ::com::sun::star::lang;
43 : : using namespace ::com::sun::star::i18n;
44 : : using namespace ::com::sun::star::sdbc;
45 : : using namespace ::com::sun::star::beans;
46 : : using namespace ::com::sun::star::container;
47 : : using namespace ::com::sun::star::util;
48 : :
49 : : namespace dbaui
50 : : {
51 : :
52 : : // =============================================================================
53 : : // = OJoinDesignView
54 : : // =============================================================================
55 : : // -----------------------------------------------------------------------------
56 : 0 : OJoinDesignView::OJoinDesignView(Window* _pParent, OJoinController& _rController,const Reference< XMultiServiceFactory >& _rFactory)
57 : : :ODataView( _pParent, _rController, _rFactory )
58 : : ,m_pTableView(NULL)
59 : 0 : ,m_rController( _rController )
60 : : {
61 [ # # ][ # # ]: 0 : m_pScrollWindow = new OScrollWindowHelper(this);
62 : 0 : }
63 : : // -----------------------------------------------------------------------------
64 : 0 : OJoinDesignView::~OJoinDesignView()
65 : : {
66 : : SAL_WNODEPRECATED_DECLARATIONS_PUSH
67 : 0 : ::std::auto_ptr<Window> aT3(m_pScrollWindow);
68 : : SAL_WNODEPRECATED_DECLARATIONS_POP
69 : 0 : m_pScrollWindow = NULL;
70 : : SAL_WNODEPRECATED_DECLARATIONS_PUSH
71 : 0 : ::std::auto_ptr<Window> aT2(m_pTableView);
72 : : SAL_WNODEPRECATED_DECLARATIONS_POP
73 [ # # ][ # # ]: 0 : m_pTableView = NULL;
74 [ # # ]: 0 : }
75 : : // -------------------------------------------------------------------------
76 : 0 : void OJoinDesignView::Construct()
77 : : {
78 : 0 : m_pScrollWindow->setTableView(m_pTableView);
79 : 0 : m_pScrollWindow->Show();
80 : 0 : m_pTableView->Show();
81 : :
82 [ # # ]: 0 : SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
83 : :
84 : 0 : ODataView::Construct();
85 : 0 : }
86 : : // -----------------------------------------------------------------------------
87 : 0 : void OJoinDesignView::initialize()
88 : : {
89 : 0 : }
90 : : // -------------------------------------------------------------------------
91 : 0 : void OJoinDesignView::resizeDocumentView(Rectangle& _rPlayground)
92 : : {
93 [ # # ]: 0 : m_pScrollWindow->SetPosSizePixel( _rPlayground.TopLeft(), _rPlayground.GetSize() );
94 : :
95 : : // just for completeness: there is no space left, we occupied it all ...
96 : 0 : _rPlayground.SetPos( _rPlayground.BottomRight() );
97 [ # # ]: 0 : _rPlayground.SetSize( Size( 0, 0 ) );
98 : 0 : }
99 : : // -----------------------------------------------------------------------------
100 : 0 : void OJoinDesignView::setReadOnly(sal_Bool /*_bReadOnly*/)
101 : : {
102 : 0 : }
103 : : // -----------------------------------------------------------------------------
104 : 0 : void OJoinDesignView::SaveTabWinUIConfig(OTableWindow* pWin)
105 : : {
106 : 0 : getController().SaveTabWinPosSize(pWin, m_pScrollWindow->GetHScrollBar()->GetThumbPos(), m_pScrollWindow->GetVScrollBar()->GetThumbPos());
107 : 0 : }
108 : : // -----------------------------------------------------------------------------
109 : 0 : void OJoinDesignView::KeyInput( const KeyEvent& rEvt )
110 : : {
111 [ # # ][ # # ]: 0 : if ( m_pTableView && m_pTableView->IsVisible() )
[ # # ]
112 : 0 : m_pTableView->KeyInput( rEvt );
113 : : else
114 : 0 : ODataView::KeyInput(rEvt);
115 : 0 : }
116 : : // -----------------------------------------------------------------------------
117 : :
118 : : } // namespace dbaui
119 : :
120 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|