Line data Source code
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 : #include <vcl/msgbox.hxx>
24 : #include "dsitems.hxx"
25 : #include <comphelper/processfactory.hxx>
26 :
27 : #include "propertysetitem.hxx"
28 :
29 : #include "dbu_dlg.hrc"
30 :
31 : namespace dbaui
32 : {
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;
38 :
39 : // OTableSubscriptionDialog
40 0 : OTableSubscriptionDialog::OTableSubscriptionDialog(vcl::Window* pParent
41 : ,SfxItemSet* _pItems
42 : ,const Reference< XComponentContext >& _rxORB
43 : ,const ::com::sun::star::uno::Any& _aDataSourceName)
44 : : SfxSingleTabDialog(pParent, _pItems, "TablesFilterDialog",
45 : "dbaccess/ui/tablesfilterdialog.ui")
46 0 : , m_pImpl( new ODbDataSourceAdministrationHelper( _rxORB, pParent, this ) )
47 : , m_bStopExecution(false)
48 0 : , m_pOutSet(_pItems)
49 : {
50 0 : m_pImpl->setDataSourceOrName(_aDataSourceName);
51 0 : Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
52 0 : m_pOutSet = new SfxItemSet( *_pItems );
53 :
54 0 : m_pImpl->translateProperties(xDatasource, *m_pOutSet);
55 0 : SetInputSet(m_pOutSet);
56 :
57 0 : VclPtrInstance<OTableSubscriptionPage> pTabPage(get_content_area(), *m_pOutSet, this);
58 0 : pTabPage->SetServiceFactory(_rxORB);
59 0 : SetTabPage(pTabPage);
60 0 : }
61 :
62 0 : OTableSubscriptionDialog::~OTableSubscriptionDialog()
63 : {
64 0 : disposeOnce();
65 0 : }
66 :
67 0 : void OTableSubscriptionDialog::dispose()
68 : {
69 0 : delete m_pOutSet;
70 0 : SfxSingleTabDialog::dispose();
71 0 : }
72 :
73 0 : short OTableSubscriptionDialog::Execute()
74 : {
75 0 : short nRet = RET_CANCEL;
76 0 : if ( !m_bStopExecution )
77 : {
78 0 : nRet = SfxSingleTabDialog::Execute();
79 0 : if ( nRet == RET_OK )
80 : {
81 0 : m_pOutSet->Put(*GetOutputItemSet());
82 0 : m_pImpl->saveChanges(*m_pOutSet);
83 : }
84 : }
85 0 : return nRet;
86 : }
87 :
88 0 : bool OTableSubscriptionDialog::getCurrentSettings(Sequence< PropertyValue >& _rDriverParams)
89 : {
90 0 : return m_pImpl->getCurrentSettings(_rDriverParams);
91 : }
92 :
93 0 : void OTableSubscriptionDialog::successfullyConnected()
94 : {
95 0 : m_pImpl->successfullyConnected();
96 0 : }
97 :
98 0 : void OTableSubscriptionDialog::clearPassword()
99 : {
100 0 : m_pImpl->clearPassword();
101 0 : }
102 :
103 0 : OUString OTableSubscriptionDialog::getConnectionURL() const
104 : {
105 0 : return m_pImpl->getConnectionURL();
106 : }
107 :
108 0 : Reference< XPropertySet > OTableSubscriptionDialog::getCurrentDataSource()
109 : {
110 0 : return m_pImpl->getCurrentDataSource();
111 : }
112 :
113 0 : const SfxItemSet* OTableSubscriptionDialog::getOutputSet() const
114 : {
115 0 : return m_pOutSet;
116 : }
117 :
118 0 : SfxItemSet* OTableSubscriptionDialog::getWriteOutputSet()
119 : {
120 0 : return m_pOutSet;
121 : }
122 :
123 36 : } // namespace dbaui
124 :
125 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|