Branch data 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 : :
27 : : #include "propertysetitem.hxx"
28 : :
29 : : #include "dbu_dlg.hrc"
30 : :
31 : : //.........................................................................
32 : : namespace dbaui
33 : : {
34 : : //.........................................................................
35 : : using namespace com::sun::star::uno;
36 : : using namespace com::sun::star::sdbc;
37 : : using namespace com::sun::star::lang;
38 : : using namespace com::sun::star::beans;
39 : : using namespace com::sun::star::container;
40 : :
41 : : DBG_NAME(OTableSubscriptionDialog)
42 : : //========================================================================
43 : : //= OTableSubscriptionDialog
44 : : //========================================================================
45 : 0 : OTableSubscriptionDialog::OTableSubscriptionDialog(Window* pParent
46 : : ,SfxItemSet* _pItems
47 : : ,const Reference< XMultiServiceFactory >& _rxORB
48 : : ,const ::com::sun::star::uno::Any& _aDataSourceName)
49 : : :SfxSingleTabDialog(pParent,DLG_TABLE_FILTER,_pItems)
50 [ # # ]: 0 : ,m_pImpl( new ODbDataSourceAdministrationHelper( _rxORB, pParent, this ) )
51 : : ,m_bStopExecution(sal_False)
52 [ # # ]: 0 : ,m_pOutSet(_pItems)
53 : : {
54 : : DBG_CTOR(OTableSubscriptionDialog,NULL);
55 [ # # ]: 0 : m_pImpl->setDataSourceOrName(_aDataSourceName);
56 [ # # ]: 0 : Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
57 [ # # ][ # # ]: 0 : m_pOutSet = new SfxItemSet( *_pItems );
58 : :
59 [ # # ]: 0 : m_pImpl->translateProperties(xDatasource, *m_pOutSet);
60 : 0 : SetInputSet(m_pOutSet);
61 : :
62 [ # # ][ # # ]: 0 : OTableSubscriptionPage* pTabPage = new OTableSubscriptionPage(this,*m_pOutSet,this);
63 [ # # ]: 0 : pTabPage->SetServiceFactory(_rxORB);
64 [ # # ]: 0 : SetTabPage(pTabPage);
65 : 0 : }
66 : : // -----------------------------------------------------------------------------
67 [ # # ]: 0 : OTableSubscriptionDialog::~OTableSubscriptionDialog()
68 : : {
69 : : DBG_DTOR(OTableSubscriptionDialog,NULL);
70 [ # # ][ # # ]: 0 : delete m_pOutSet;
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 : sal_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 : String 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 : : //.........................................................................
124 : : } // namespace dbaui
125 : : //.........................................................................
126 : :
127 : :
128 : :
129 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|