merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / dlg / TablesSingleDlg.cxx
blob4e4447331bcfd3c49f238f75f0ede6f1df3e7e93
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: TablesSingleDlg.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_dbaccess.hxx"
34 #ifndef _DBAUI_TABLESSINGLEDLG_HXX_
35 #include "TablesSingleDlg.hxx"
36 #endif
37 #ifndef _DBAUI_DBADMINIMPL_HXX_
38 #include "DbAdminImpl.hxx"
39 #endif
40 #ifndef _DBA_DBACCESS_HELPID_HRC_
41 #include "dbaccess_helpid.hrc"
42 #endif
43 #ifndef _DBAUI_TABLESPAGE_HXX_
44 #include "tablespage.hxx"
45 #endif
46 #ifndef _SV_MSGBOX_HXX
47 #include <vcl/msgbox.hxx>
48 #endif
49 #ifndef _DBAUI_DATASOURCEITEMS_HXX_
50 #include "dsitems.hxx"
51 #endif
53 #ifndef _DBAUI_PROPERTYSETITEM_HXX_
54 #include "propertysetitem.hxx"
55 #endif
57 //.........................................................................
58 namespace dbaui
60 //.........................................................................
61 using namespace com::sun::star::uno;
62 using namespace com::sun::star::sdbc;
63 using namespace com::sun::star::lang;
64 using namespace com::sun::star::beans;
65 using namespace com::sun::star::container;
67 DBG_NAME(OTableSubscriptionDialog)
68 //========================================================================
69 //= OTableSubscriptionDialog
70 //========================================================================
71 OTableSubscriptionDialog::OTableSubscriptionDialog(Window* pParent
72 ,SfxItemSet* _pItems
73 ,const Reference< XMultiServiceFactory >& _rxORB
74 ,const ::com::sun::star::uno::Any& _aDataSourceName)
75 :SfxSingleTabDialog(pParent,UID_DLG_TABLE_FILTER,_pItems)
76 ,m_pImpl( new ODbDataSourceAdministrationHelper( _rxORB, pParent, this ) )
77 ,m_bStopExecution(sal_False)
78 ,m_pOutSet(_pItems)
80 DBG_CTOR(OTableSubscriptionDialog,NULL);
81 m_pImpl->setDataSourceOrName(_aDataSourceName);
82 Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
83 m_pOutSet = new SfxItemSet( *_pItems );
85 m_pImpl->translateProperties(xDatasource, *m_pOutSet);
86 SetInputSet(m_pOutSet);
88 OTableSubscriptionPage* pTabPage = new OTableSubscriptionPage(this,*m_pOutSet,this);
89 pTabPage->SetServiceFactory(_rxORB);
90 SetTabPage(pTabPage);
92 // -----------------------------------------------------------------------------
93 OTableSubscriptionDialog::~OTableSubscriptionDialog()
95 DBG_DTOR(OTableSubscriptionDialog,NULL);
96 delete m_pOutSet;
98 // -----------------------------------------------------------------------------
99 short OTableSubscriptionDialog::Execute()
101 short nRet = RET_CANCEL;
102 if ( !m_bStopExecution )
104 nRet = SfxSingleTabDialog::Execute();
105 if ( nRet == RET_OK )
107 m_pOutSet->Put(*GetOutputItemSet());
108 m_pImpl->saveChanges(*m_pOutSet);
111 return nRet;
113 // -----------------------------------------------------------------------------
114 sal_Bool OTableSubscriptionDialog::getCurrentSettings(Sequence< PropertyValue >& _rDriverParams)
116 return m_pImpl->getCurrentSettings(_rDriverParams);
118 // -----------------------------------------------------------------------------
119 void OTableSubscriptionDialog::successfullyConnected()
121 m_pImpl->successfullyConnected();
123 // -----------------------------------------------------------------------------
124 void OTableSubscriptionDialog::clearPassword()
126 m_pImpl->clearPassword();
128 // -----------------------------------------------------------------------------
129 String OTableSubscriptionDialog::getConnectionURL() const
131 return m_pImpl->getConnectionURL();
133 // -----------------------------------------------------------------------------
134 Reference< XPropertySet > OTableSubscriptionDialog::getCurrentDataSource()
136 return m_pImpl->getCurrentDataSource();
138 // -----------------------------------------------------------------------------
139 const SfxItemSet* OTableSubscriptionDialog::getOutputSet() const
141 return m_pOutSet;
143 // -----------------------------------------------------------------------------
144 SfxItemSet* OTableSubscriptionDialog::getWriteOutputSet()
146 return m_pOutSet;
148 // -----------------------------------------------------------------------------
149 //.........................................................................
150 } // namespace dbaui
151 //.........................................................................