1*96de5490SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*96de5490SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*96de5490SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*96de5490SAndrew Rist * distributed with this work for additional information 6*96de5490SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*96de5490SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*96de5490SAndrew Rist * "License"); you may not use this file except in compliance 9*96de5490SAndrew Rist * with the License. You may obtain a copy of the License at 10*96de5490SAndrew Rist * 11*96de5490SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*96de5490SAndrew Rist * 13*96de5490SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*96de5490SAndrew Rist * software distributed under the License is distributed on an 15*96de5490SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*96de5490SAndrew Rist * KIND, either express or implied. See the License for the 17*96de5490SAndrew Rist * specific language governing permissions and limitations 18*96de5490SAndrew Rist * under the License. 19*96de5490SAndrew Rist * 20*96de5490SAndrew Rist *************************************************************/ 21*96de5490SAndrew Rist 22*96de5490SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_dbaccess.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "unoadmin.hxx" 28cdf0e10cSrcweir #include "dbu_reghelper.hxx" 29cdf0e10cSrcweir #include "advancedsettingsdlg.hxx" 30cdf0e10cSrcweir 31cdf0e10cSrcweir //......................................................................... 32cdf0e10cSrcweir namespace dbaui 33cdf0e10cSrcweir { 34cdf0e10cSrcweir //......................................................................... 35cdf0e10cSrcweir 36cdf0e10cSrcweir using namespace ::com::sun::star::uno; 37cdf0e10cSrcweir using namespace ::com::sun::star::lang; 38cdf0e10cSrcweir using namespace ::com::sun::star::beans; 39cdf0e10cSrcweir 40cdf0e10cSrcweir //========================================================================= 41cdf0e10cSrcweir //= OAdvancedSettingsDialog 42cdf0e10cSrcweir //========================================================================= 43cdf0e10cSrcweir class OAdvancedSettingsDialog 44cdf0e10cSrcweir :public ODatabaseAdministrationDialog 45cdf0e10cSrcweir ,public ::comphelper::OPropertyArrayUsageHelper< OAdvancedSettingsDialog > 46cdf0e10cSrcweir { 47cdf0e10cSrcweir 48cdf0e10cSrcweir protected: 49cdf0e10cSrcweir OAdvancedSettingsDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); 50cdf0e10cSrcweir 51cdf0e10cSrcweir public: 52cdf0e10cSrcweir // XTypeProvider 53cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); 54cdf0e10cSrcweir 55cdf0e10cSrcweir // XServiceInfo 56cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException); 57cdf0e10cSrcweir virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); 58cdf0e10cSrcweir 59cdf0e10cSrcweir // XServiceInfo - static methods 60cdf0e10cSrcweir static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); 61cdf0e10cSrcweir static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException ); 62cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > 63cdf0e10cSrcweir SAL_CALL Create(const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >&); 64cdf0e10cSrcweir 65cdf0e10cSrcweir // XPropertySet 66cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); 67cdf0e10cSrcweir virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 68cdf0e10cSrcweir 69cdf0e10cSrcweir // OPropertyArrayUsageHelper 70cdf0e10cSrcweir virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; 71cdf0e10cSrcweir protected: 72cdf0e10cSrcweir // OGenericUnoDialog overridables 73cdf0e10cSrcweir virtual Dialog* createDialog(Window* _pParent); 74cdf0e10cSrcweir }; 75cdf0e10cSrcweir 76cdf0e10cSrcweir //========================================================================= 77cdf0e10cSrcweir //------------------------------------------------------------------------- OAdvancedSettingsDialog(const Reference<XMultiServiceFactory> & _rxORB)78cdf0e10cSrcweir OAdvancedSettingsDialog::OAdvancedSettingsDialog(const Reference< XMultiServiceFactory >& _rxORB) 79cdf0e10cSrcweir :ODatabaseAdministrationDialog(_rxORB) 80cdf0e10cSrcweir { 81cdf0e10cSrcweir } 82cdf0e10cSrcweir //------------------------------------------------------------------------- getImplementationId()83cdf0e10cSrcweir Sequence<sal_Int8> SAL_CALL OAdvancedSettingsDialog::getImplementationId( ) throw(RuntimeException) 84cdf0e10cSrcweir { 85cdf0e10cSrcweir static ::cppu::OImplementationId aId; 86cdf0e10cSrcweir return aId.getImplementationId(); 87cdf0e10cSrcweir } 88cdf0e10cSrcweir 89cdf0e10cSrcweir //------------------------------------------------------------------------- Create(const Reference<XMultiServiceFactory> & _rxFactory)90cdf0e10cSrcweir Reference< XInterface > SAL_CALL OAdvancedSettingsDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory) 91cdf0e10cSrcweir { 92cdf0e10cSrcweir return *(new OAdvancedSettingsDialog(_rxFactory)); 93cdf0e10cSrcweir } 94cdf0e10cSrcweir 95cdf0e10cSrcweir //------------------------------------------------------------------------- getImplementationName()96cdf0e10cSrcweir ::rtl::OUString SAL_CALL OAdvancedSettingsDialog::getImplementationName() throw(RuntimeException) 97cdf0e10cSrcweir { 98cdf0e10cSrcweir return getImplementationName_Static(); 99cdf0e10cSrcweir } 100cdf0e10cSrcweir 101cdf0e10cSrcweir //------------------------------------------------------------------------- getImplementationName_Static()102cdf0e10cSrcweir ::rtl::OUString OAdvancedSettingsDialog::getImplementationName_Static() throw(RuntimeException) 103cdf0e10cSrcweir { 104cdf0e10cSrcweir return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.OAdvancedSettingsDialog")); 105cdf0e10cSrcweir } 106cdf0e10cSrcweir 107cdf0e10cSrcweir //------------------------------------------------------------------------- getSupportedServiceNames()108cdf0e10cSrcweir ::comphelper::StringSequence SAL_CALL OAdvancedSettingsDialog::getSupportedServiceNames() throw(RuntimeException) 109cdf0e10cSrcweir { 110cdf0e10cSrcweir return getSupportedServiceNames_Static(); 111cdf0e10cSrcweir } 112cdf0e10cSrcweir 113cdf0e10cSrcweir //------------------------------------------------------------------------- getSupportedServiceNames_Static()114cdf0e10cSrcweir ::comphelper::StringSequence OAdvancedSettingsDialog::getSupportedServiceNames_Static() throw(RuntimeException) 115cdf0e10cSrcweir { 116cdf0e10cSrcweir ::comphelper::StringSequence aSupported(1); 117cdf0e10cSrcweir aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.AdvancedDatabaseSettingsDialog")); 118cdf0e10cSrcweir return aSupported; 119cdf0e10cSrcweir } 120cdf0e10cSrcweir 121cdf0e10cSrcweir //------------------------------------------------------------------------- getPropertySetInfo()122cdf0e10cSrcweir Reference<XPropertySetInfo> SAL_CALL OAdvancedSettingsDialog::getPropertySetInfo() throw(RuntimeException) 123cdf0e10cSrcweir { 124cdf0e10cSrcweir Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); 125cdf0e10cSrcweir return xInfo; 126cdf0e10cSrcweir } 127cdf0e10cSrcweir 128cdf0e10cSrcweir //------------------------------------------------------------------------- getInfoHelper()129cdf0e10cSrcweir ::cppu::IPropertyArrayHelper& OAdvancedSettingsDialog::getInfoHelper() 130cdf0e10cSrcweir { 131cdf0e10cSrcweir return *const_cast<OAdvancedSettingsDialog*>(this)->getArrayHelper(); 132cdf0e10cSrcweir } 133cdf0e10cSrcweir 134cdf0e10cSrcweir //------------------------------------------------------------------------------ createArrayHelper() const135cdf0e10cSrcweir ::cppu::IPropertyArrayHelper* OAdvancedSettingsDialog::createArrayHelper( ) const 136cdf0e10cSrcweir { 137cdf0e10cSrcweir Sequence< Property > aProps; 138cdf0e10cSrcweir describeProperties(aProps); 139cdf0e10cSrcweir return new ::cppu::OPropertyArrayHelper(aProps); 140cdf0e10cSrcweir } 141cdf0e10cSrcweir //------------------------------------------------------------------------------ createDialog(Window * _pParent)142cdf0e10cSrcweir Dialog* OAdvancedSettingsDialog::createDialog(Window* _pParent) 143cdf0e10cSrcweir { 144cdf0e10cSrcweir AdvancedSettingsDialog* pDlg = new AdvancedSettingsDialog(_pParent, m_pDatasourceItems, m_aContext.getLegacyServiceFactory(),m_aInitialSelection); 145cdf0e10cSrcweir return pDlg; 146cdf0e10cSrcweir } 147cdf0e10cSrcweir 148cdf0e10cSrcweir //......................................................................... 149cdf0e10cSrcweir } // namespace dbaui 150cdf0e10cSrcweir //......................................................................... 151cdf0e10cSrcweir createRegistryInfo_OAdvancedSettingsDialog()152cdf0e10cSrcweirextern "C" void SAL_CALL createRegistryInfo_OAdvancedSettingsDialog() 153cdf0e10cSrcweir { 154cdf0e10cSrcweir static ::dbaui::OMultiInstanceAutoRegistration< ::dbaui::OAdvancedSettingsDialog > aAutoRegistration; 155cdf0e10cSrcweir } 156