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"
26 using namespace com::sun::star::uno
;
27 using namespace com::sun::star::sdbc
;
28 using namespace com::sun::star::beans
;
30 // OTableSubscriptionDialog
31 OTableSubscriptionDialog::OTableSubscriptionDialog(weld::Window
* pParent
32 ,const SfxItemSet
* _pItems
33 ,const Reference
< XComponentContext
>& _rxORB
34 ,const css::uno::Any
& _aDataSourceName
)
35 : SfxSingleTabDialogController(pParent
, _pItems
,
36 u
"dbaccess/ui/tablesfilterdialog.ui"_ustr
, u
"TablesFilterDialog"_ustr
)
37 , m_pImpl(new ODbDataSourceAdministrationHelper(_rxORB
, m_xDialog
.get(), pParent
, this))
38 , m_bStopExecution(false)
40 m_pImpl
->setDataSourceOrName(_aDataSourceName
);
41 Reference
< XPropertySet
> xDatasource
= m_pImpl
->getCurrentDataSource();
42 m_pOutSet
.reset(new SfxItemSet( *_pItems
));
44 m_pImpl
->translateProperties(xDatasource
, *m_pOutSet
);
45 SetInputSet(m_pOutSet
.get());
47 auto xTabPage
= std::make_unique
<OTableSubscriptionPage
>(get_content_area(), this, *m_pOutSet
);
48 xTabPage
->SetServiceFactory(_rxORB
);
49 SetTabPage(std::move(xTabPage
));
52 OTableSubscriptionDialog::~OTableSubscriptionDialog()
56 short OTableSubscriptionDialog::run()
58 short nRet
= RET_CANCEL
;
59 if ( !m_bStopExecution
)
61 nRet
= SfxSingleTabDialogController::run();
64 m_pOutSet
->Put(*GetOutputItemSet());
65 m_pImpl
->saveChanges(*m_pOutSet
);
71 bool OTableSubscriptionDialog::getCurrentSettings(Sequence
< PropertyValue
>& _rDriverParams
)
73 return m_pImpl
->getCurrentSettings(_rDriverParams
);
76 void OTableSubscriptionDialog::successfullyConnected()
78 m_pImpl
->successfullyConnected();
81 void OTableSubscriptionDialog::clearPassword()
83 m_pImpl
->clearPassword();
86 Reference
< XPropertySet
> const & OTableSubscriptionDialog::getCurrentDataSource()
88 return m_pImpl
->getCurrentDataSource();
91 const SfxItemSet
* OTableSubscriptionDialog::getOutputSet() const
93 return m_pOutSet
.get();
96 SfxItemSet
* OTableSubscriptionDialog::getWriteOutputSet()
98 return m_pOutSet
.get();
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */