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 : OTableSubscriptionPage* pTabPage = new OTableSubscriptionPage(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 : delete m_pOutSet;
65 0 : }
66 :
67 0 : short OTableSubscriptionDialog::Execute()
68 : {
69 0 : short nRet = RET_CANCEL;
70 0 : if ( !m_bStopExecution )
71 : {
72 0 : nRet = SfxSingleTabDialog::Execute();
73 0 : if ( nRet == RET_OK )
74 : {
75 0 : m_pOutSet->Put(*GetOutputItemSet());
76 0 : m_pImpl->saveChanges(*m_pOutSet);
77 : }
78 : }
79 0 : return nRet;
80 : }
81 :
82 0 : bool OTableSubscriptionDialog::getCurrentSettings(Sequence< PropertyValue >& _rDriverParams)
83 : {
84 0 : return m_pImpl->getCurrentSettings(_rDriverParams);
85 : }
86 :
87 0 : void OTableSubscriptionDialog::successfullyConnected()
88 : {
89 0 : m_pImpl->successfullyConnected();
90 0 : }
91 :
92 0 : void OTableSubscriptionDialog::clearPassword()
93 : {
94 0 : m_pImpl->clearPassword();
95 0 : }
96 :
97 0 : OUString OTableSubscriptionDialog::getConnectionURL() const
98 : {
99 0 : return m_pImpl->getConnectionURL();
100 : }
101 :
102 0 : Reference< XPropertySet > OTableSubscriptionDialog::getCurrentDataSource()
103 : {
104 0 : return m_pImpl->getCurrentDataSource();
105 : }
106 :
107 0 : const SfxItemSet* OTableSubscriptionDialog::getOutputSet() const
108 : {
109 0 : return m_pOutSet;
110 : }
111 :
112 0 : SfxItemSet* OTableSubscriptionDialog::getWriteOutputSet()
113 : {
114 0 : return m_pOutSet;
115 : }
116 :
117 72 : } // namespace dbaui
118 :
119 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|