LibreOffice Module dbaccess (master) 1
TablesSingleDlg.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <TablesSingleDlg.hxx>
21#include "DbAdminImpl.hxx"
22#include "tablespage.hxx"
23
24namespace dbaui
25{
26using namespace com::sun::star::uno;
27using namespace com::sun::star::sdbc;
28using namespace com::sun::star::lang;
29using namespace com::sun::star::beans;
30using namespace com::sun::star::container;
31
32 // OTableSubscriptionDialog
34 ,const SfxItemSet* _pItems
36 ,const css::uno::Any& _aDataSourceName)
37 : SfxSingleTabDialogController(pParent, _pItems,
38 "dbaccess/ui/tablesfilterdialog.ui", "TablesFilterDialog")
39 , m_pImpl(new ODbDataSourceAdministrationHelper(_rxORB, m_xDialog.get(), pParent, this))
40 , m_bStopExecution(false)
41{
42 m_pImpl->setDataSourceOrName(_aDataSourceName);
43 Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
44 m_pOutSet.reset(new SfxItemSet( *_pItems ));
45
46 m_pImpl->translateProperties(xDatasource, *m_pOutSet);
48
49 auto xTabPage = std::make_unique<OTableSubscriptionPage>(get_content_area(), this, *m_pOutSet);
50 xTabPage->SetServiceFactory(_rxORB);
51 SetTabPage(std::move(xTabPage));
52}
53
55{
56}
57
59{
60 short nRet = RET_CANCEL;
61 if ( !m_bStopExecution )
62 {
63 nRet = SfxSingleTabDialogController::run();
64 if ( nRet == RET_OK )
65 {
67 m_pImpl->saveChanges(*m_pOutSet);
68 }
69 }
70 return nRet;
71}
72
74{
75 return m_pImpl->getCurrentSettings(_rDriverParams);
76}
77
79{
80 m_pImpl->successfullyConnected();
81}
82
84{
85 m_pImpl->clearPassword();
86}
87
89{
90 return m_pImpl->getCurrentDataSource();
91}
92
94{
95 return m_pOutSet.get();
96}
97
99{
100 return m_pOutSet.get();
101}
102
103} // namespace dbaui
104
105/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
Reference< XExecutableDialog > m_xDialog
const SfxItemSet * GetOutputItemSet() const
void SetInputSet(const SfxItemSet *pInSet)
void SetTabPage(std::unique_ptr< SfxTabPage > xTabPage)
weld::Container * get_content_area()
virtual const SfxItemSet * getOutputSet() const override
virtual short run() override
virtual ~OTableSubscriptionDialog() override
std::unique_ptr< ODbDataSourceAdministrationHelper > m_pImpl
virtual SfxItemSet * getWriteOutputSet() override
bool getCurrentSettings(css::uno::Sequence< css::beans::PropertyValue > &_rDriverParams)
css::uno::Reference< css::beans::XPropertySet > const & getCurrentDataSource()
OTableSubscriptionDialog(weld::Window *pParent, const SfxItemSet *_pItems, const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Any &_aDataSourceName)
std::unique_ptr< SfxItemSet > m_pOutSet
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
RET_OK
RET_CANCEL