1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_dbaccess.hxx" 26 27 #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC 28 #include "dbustrings.hrc" 29 #endif 30 #ifndef _TOOLKIT_AWT_VCLXWINDOW_HXX_ 31 #include <toolkit/awt/vclxwindow.hxx> 32 #endif 33 #ifndef _DBU_REGHELPER_HXX_ 34 #include "dbu_reghelper.hxx" 35 #endif 36 #ifndef _DBAUI_UNOADMIN_ 37 #include "unoadmin.hxx" 38 #endif 39 #ifndef _DBAUI_DBADMIN_HXX_ 40 #include "dbadmin.hxx" 41 #endif 42 #ifndef _COMPHELPER_EXTRACT_HXX_ 43 #include <comphelper/extract.hxx> 44 #endif 45 #ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ 46 #include <cppuhelper/typeprovider.hxx> 47 #endif 48 #ifndef _COMPHELPER_PROPERTY_HXX_ 49 #include <comphelper/property.hxx> 50 #endif 51 #ifndef _OSL_DIAGNOSE_H_ 52 #include <osl/diagnose.h> 53 #endif 54 #ifndef _SV_MSGBOX_HXX 55 #include <vcl/msgbox.hxx> 56 #endif 57 58 // --- needed because of the solar mutex 59 #ifndef _VOS_MUTEX_HXX_ 60 #include <vos/mutex.hxx> 61 #endif 62 #ifndef _SV_SVAPP_HXX 63 #include <vcl/svapp.hxx> 64 #endif 65 // --- 66 67 #define THISREF() static_cast< XServiceInfo* >(this) 68 69 //......................................................................... 70 namespace dbaui 71 { 72 //......................................................................... 73 74 using namespace ::com::sun::star::uno; 75 using namespace ::com::sun::star::lang; 76 using namespace ::com::sun::star::beans; 77 78 //========================================================================= 79 DBG_NAME(ODatabaseAdministrationDialog) 80 //------------------------------------------------------------------------- 81 ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XMultiServiceFactory >& _rxORB) 82 :ODatabaseAdministrationDialogBase(_rxORB) 83 ,m_pDatasourceItems(NULL) 84 ,m_pItemPool(NULL) 85 ,m_pItemPoolDefaults(NULL) 86 ,m_pCollection(NULL) 87 { 88 DBG_CTOR(ODatabaseAdministrationDialog,NULL); 89 90 m_pCollection = new ::dbaccess::ODsnTypeCollection(_rxORB); 91 ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults, m_pCollection); 92 } 93 94 //------------------------------------------------------------------------- 95 ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog() 96 { 97 // we do this here cause the base class' call to destroyDialog won't reach us anymore : we're within an dtor, 98 // so this virtual-method-call the base class does does not work, we're already dead then ... 99 if (m_pDialog) 100 { 101 ::osl::MutexGuard aGuard(m_aMutex); 102 if (m_pDialog) 103 destroyDialog(); 104 } 105 106 delete m_pCollection; 107 m_pCollection = NULL; 108 109 DBG_DTOR(ODatabaseAdministrationDialog,NULL); 110 } 111 //------------------------------------------------------------------------- 112 void ODatabaseAdministrationDialog::destroyDialog() 113 { 114 ODatabaseAdministrationDialogBase::destroyDialog(); 115 ODbAdminDialog::destroyItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults); 116 } 117 //------------------------------------------------------------------------------ 118 void ODatabaseAdministrationDialog::implInitialize(const Any& _rValue) 119 { 120 PropertyValue aProperty; 121 if (_rValue >>= aProperty) 122 { 123 if (0 == aProperty.Name.compareToAscii("InitialSelection")) 124 { 125 m_aInitialSelection = aProperty.Value; 126 } 127 else if (0 == aProperty.Name.compareToAscii("ActiveConnection")) 128 { 129 m_xActiveConnection.set(aProperty.Value,UNO_QUERY); 130 } 131 else 132 ODatabaseAdministrationDialogBase::implInitialize(_rValue); 133 } 134 else 135 ODatabaseAdministrationDialogBase::implInitialize(_rValue); 136 } 137 138 //......................................................................... 139 } // namespace dbaui 140 //......................................................................... 141 142