1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "TablesSingleDlg.hxx"
21 #include "DbAdminImpl.hxx"
22 #include "tablespage.hxx"
23 #include <vcl/msgbox.hxx>
24 #include "dsitems.hxx"
25 #include <comphelper/processfactory.hxx>
27 #include "propertysetitem.hxx"
29 #include "dbu_dlg.hrc"
33 using namespace com::sun::star::uno
;
34 using namespace com::sun::star::sdbc
;
35 using namespace com::sun::star::lang
;
36 using namespace com::sun::star::beans
;
37 using namespace com::sun::star::container
;
39 // OTableSubscriptionDialog
40 OTableSubscriptionDialog::OTableSubscriptionDialog(vcl::Window
* pParent
42 ,const Reference
< XComponentContext
>& _rxORB
43 ,const ::com::sun::star::uno::Any
& _aDataSourceName
)
44 : SfxSingleTabDialog(pParent
, _pItems
, "TablesFilterDialog",
45 "dbaccess/ui/tablesfilterdialog.ui")
46 , m_pImpl( new ODbDataSourceAdministrationHelper( _rxORB
, pParent
, this ) )
47 , m_bStopExecution(false)
50 m_pImpl
->setDataSourceOrName(_aDataSourceName
);
51 Reference
< XPropertySet
> xDatasource
= m_pImpl
->getCurrentDataSource();
52 m_pOutSet
= new SfxItemSet( *_pItems
);
54 m_pImpl
->translateProperties(xDatasource
, *m_pOutSet
);
55 SetInputSet(m_pOutSet
);
57 VclPtrInstance
<OTableSubscriptionPage
> pTabPage(get_content_area(), *m_pOutSet
, this);
58 pTabPage
->SetServiceFactory(_rxORB
);
62 OTableSubscriptionDialog::~OTableSubscriptionDialog()
67 void OTableSubscriptionDialog::dispose()
70 SfxSingleTabDialog::dispose();
73 short OTableSubscriptionDialog::Execute()
75 short nRet
= RET_CANCEL
;
76 if ( !m_bStopExecution
)
78 nRet
= SfxSingleTabDialog::Execute();
81 m_pOutSet
->Put(*GetOutputItemSet());
82 m_pImpl
->saveChanges(*m_pOutSet
);
88 bool OTableSubscriptionDialog::getCurrentSettings(Sequence
< PropertyValue
>& _rDriverParams
)
90 return m_pImpl
->getCurrentSettings(_rDriverParams
);
93 void OTableSubscriptionDialog::successfullyConnected()
95 m_pImpl
->successfullyConnected();
98 void OTableSubscriptionDialog::clearPassword()
100 m_pImpl
->clearPassword();
103 OUString
OTableSubscriptionDialog::getConnectionURL() const
105 return m_pImpl
->getConnectionURL();
108 Reference
< XPropertySet
> OTableSubscriptionDialog::getCurrentDataSource()
110 return m_pImpl
->getCurrentDataSource();
113 const SfxItemSet
* OTableSubscriptionDialog::getOutputSet() const
118 SfxItemSet
* OTableSubscriptionDialog::getWriteOutputSet()
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */