1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: TablesSingleDlg.cxx,v $
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"
37 #ifndef _DBAUI_DBADMINIMPL_HXX_
38 #include "DbAdminImpl.hxx"
40 #ifndef _DBA_DBACCESS_HELPID_HRC_
41 #include "dbaccess_helpid.hrc"
43 #ifndef _DBAUI_TABLESPAGE_HXX_
44 #include "tablespage.hxx"
46 #ifndef _SV_MSGBOX_HXX
47 #include <vcl/msgbox.hxx>
49 #ifndef _DBAUI_DATASOURCEITEMS_HXX_
50 #include "dsitems.hxx"
53 #ifndef _DBAUI_PROPERTYSETITEM_HXX_
54 #include "propertysetitem.hxx"
57 //.........................................................................
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
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
)
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
);
92 // -----------------------------------------------------------------------------
93 OTableSubscriptionDialog::~OTableSubscriptionDialog()
95 DBG_DTOR(OTableSubscriptionDialog
,NULL
);
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
);
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
143 // -----------------------------------------------------------------------------
144 SfxItemSet
* OTableSubscriptionDialog::getWriteOutputSet()
148 // -----------------------------------------------------------------------------
149 //.........................................................................
151 //.........................................................................