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