Files
libreoffice/dbaccess/source/ui/querydesign/JoinDesignView.cxx

194 lines
6.4 KiB
C++
Raw Normal View History

2001-02-28 09:16:07 +00:00
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
2001-02-28 09:16:07 +00:00
*
* $RCSfile: JoinDesignView.cxx,v $
2001-02-28 09:16:07 +00:00
*
* $Revision: 1.18 $
2001-02-28 09:16:07 +00:00
*
* last change: $Author: hr $ $Date: 2006-06-20 03:25:36 $
2001-02-28 09:16:07 +00:00
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
2001-02-28 09:16:07 +00:00
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
2001-02-28 09:16:07 +00:00
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
2001-02-28 09:16:07 +00:00
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
2001-02-28 09:16:07 +00:00
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
2001-02-28 09:16:07 +00:00
*
************************************************************************/
#ifndef DBAUI_JOINDESIGNVIEW_HXX
#include "JoinDesignView.hxx"
#endif
#ifndef DBAUI_JOINTABLEVIEW_HXX
#include "JoinTableView.hxx"
#endif
#ifndef DBAUI_JOINCONTROLLER_HXX
#include "JoinController.hxx"
#endif
#ifndef _UNDO_HXX
#include <svtools/undo.hxx>
#endif
#ifndef DBAUI_QYDLGTAB_HXX
#include "adtabdlg.hxx"
#endif
#ifndef _SV_SVAPP_HXX
#include <vcl/svapp.hxx>
#endif
#ifndef _SV_MSGBOX_HXX
#include <vcl/msgbox.hxx>
#endif
#ifndef DBACCESS_UI_BROWSER_ID_HXX
#include "browserids.hxx"
#endif
2002-08-19 07:01:32 +00:00
#ifndef _DBU_QRY_HRC_
#include "dbu_qry.hrc"
2001-02-28 09:16:07 +00:00
#endif
#ifndef _COMPHELPER_TYPES_HXX_
#include <comphelper/types.hxx>
#endif
#ifndef _CONNECTIVITY_DBTOOLS_HXX_
#include <connectivity/dbtools.hxx>
#endif
#ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_
#include <com/sun/star/sdbc/DataType.hpp>
#endif
#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
#endif
#ifndef DBAUI_TABLECONNECTION_HXX
#include "TableConnection.hxx"
#endif
#ifndef DBAUI_CONNECTIONLINE_HXX
#include "ConnectionLine.hxx"
#endif
#ifndef DBAUI_CONNECTIONLINEDATA_HXX
#include "ConnectionLineData.hxx"
#endif
#ifndef DBAUI_TABLECONNECTIONDATA_HXX
#include "TableConnectionData.hxx"
#endif
#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
#include "dbustrings.hrc"
#endif
#ifndef _COMPHELPER_EXTRACT_HXX_
#include <comphelper/extract.hxx>
2001-02-28 09:16:07 +00:00
#endif
#ifndef DBAUI_TOOLS_HXX
#include "UITools.hxx"
#endif
#ifndef DBAUI_JOINTABLEVIEW_HXX
#include "JoinTableView.hxx"
#endif
2002-02-11 12:02:08 +00:00
// #include <com/sun/star/util/URL.hdl>
2001-02-28 09:16:07 +00:00
using namespace ::dbaui;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
2002-02-11 12:02:08 +00:00
using namespace ::com::sun::star::util;
DBG_NAME(OJoinDesignView)
2001-02-28 09:16:07 +00:00
OJoinDesignView::OJoinDesignView(Window* _pParent, OJoinController* _pController,const Reference< XMultiServiceFactory >& _rFactory)
2002-02-11 12:02:08 +00:00
:ODataView(_pParent,_pController,_rFactory)
2001-02-28 09:16:07 +00:00
,m_pTableView(NULL)
,m_pAddTabDlg(NULL)
,m_pController(_pController)
2001-02-28 09:16:07 +00:00
{
DBG_CTOR(OJoinDesignView,NULL);
2001-02-28 09:16:07 +00:00
m_pScrollWindow = new OScrollWindowHelper(this);
}
// -----------------------------------------------------------------------------
OJoinDesignView::~OJoinDesignView()
{
if ( m_pController )
m_pController->clearAddTableDialog();
2002-05-07 06:19:29 +00:00
::std::auto_ptr<Window> aT3(m_pScrollWindow);
m_pScrollWindow = NULL;
2002-05-08 12:02:11 +00:00
::std::auto_ptr<Window> aT2(m_pTableView);
m_pTableView = NULL;
::std::auto_ptr<Window> aT1(m_pAddTabDlg);
m_pAddTabDlg = NULL;
DBG_DTOR(OJoinDesignView,NULL);
2001-02-28 09:16:07 +00:00
}
// -------------------------------------------------------------------------
void OJoinDesignView::Construct()
2001-02-28 09:16:07 +00:00
{
m_pScrollWindow->setTableView(m_pTableView);
m_pScrollWindow->Show();
m_pTableView->Show();
2002-07-11 11:05:41 +00:00
m_pAddTabDlg = new OAddTableDlg(m_pScrollWindow,m_pTableView);
2001-02-28 09:16:07 +00:00
SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
ODataView::Construct();
2001-02-28 09:16:07 +00:00
}
// -----------------------------------------------------------------------------
void OJoinDesignView::initialize()
{
// getAddTableDialog()->Update();
2001-02-28 09:16:07 +00:00
}
// -------------------------------------------------------------------------
void OJoinDesignView::resizeDocumentView(Rectangle& _rPlayground)
2001-02-28 09:16:07 +00:00
{
2001-08-15 12:43:46 +00:00
m_pScrollWindow->SetPosSizePixel( _rPlayground.TopLeft(), _rPlayground.GetSize() );
2001-02-28 09:16:07 +00:00
2001-08-15 12:43:46 +00:00
// just for completeness: there is no space left, we occupied it all ...
_rPlayground.SetPos( _rPlayground.BottomRight() );
_rPlayground.SetSize( Size( 0, 0 ) );
2001-02-28 09:16:07 +00:00
}
// -----------------------------------------------------------------------------
void OJoinDesignView::setReadOnly(sal_Bool /*_bReadOnly*/)
2001-02-28 09:16:07 +00:00
{
}
// -----------------------------------------------------------------------------
void OJoinDesignView::TableDeleted(const ::rtl::OUString& /*rAliasName*/)
2001-02-28 09:16:07 +00:00
{
}
// -----------------------------------------------------------------------------
void OJoinDesignView::zoomTableView(const Fraction& _rFraction)
{
m_pTableView->SetZoom(_rFraction);
}
// -----------------------------------------------------------------------------
void OJoinDesignView::SaveUIConfig()
{
OJoinController* pCtrl = getController();
if (pCtrl)
pCtrl->SaveTabWinsPosSize( m_pTableView->GetTabWinMap(), m_pScrollWindow->GetHScrollBar()->GetThumbPos(), m_pScrollWindow->GetVScrollBar()->GetThumbPos() );
}
// -----------------------------------------------------------------------------
void OJoinDesignView::SaveTabWinUIConfig(OTableWindow* pWin)
{
getController()->SaveTabWinPosSize(pWin, m_pScrollWindow->GetHScrollBar()->GetThumbPos(), m_pScrollWindow->GetVScrollBar()->GetThumbPos());
}
// -----------------------------------------------------------------------------
2001-10-26 06:57:11 +00:00
void OJoinDesignView::KeyInput( const KeyEvent& rEvt )
{
if ( m_pTableView && m_pTableView->IsVisible() )
m_pTableView->KeyInput( rEvt );
2002-05-02 06:54:11 +00:00
else
ODataView::KeyInput(rEvt);
2001-10-26 06:57:11 +00:00
}
// -----------------------------------------------------------------------------