merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / uno / AdvancedSettingsDlg.cxx
bloba35b893a4e777a6d41516b7ee87e769c9bb7a1e4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AdvancedSettingsDlg.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_dbaccess.hxx"
34 #include "unoadmin.hxx"
35 #include "dbu_reghelper.hxx"
36 #include "advancedsettingsdlg.hxx"
38 //.........................................................................
39 namespace dbaui
41 //.........................................................................
43 using namespace ::com::sun::star::uno;
44 using namespace ::com::sun::star::lang;
45 using namespace ::com::sun::star::beans;
47 //=========================================================================
48 //= OAdvancedSettingsDialog
49 //=========================================================================
50 class OAdvancedSettingsDialog
51 :public ODatabaseAdministrationDialog
52 ,public ::comphelper::OPropertyArrayUsageHelper< OAdvancedSettingsDialog >
55 protected:
56 OAdvancedSettingsDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
58 public:
59 // XTypeProvider
60 virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
62 // XServiceInfo
63 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
64 virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
66 // XServiceInfo - static methods
67 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
68 static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
69 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
70 SAL_CALL Create(const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >&);
72 // XPropertySet
73 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
74 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
76 // OPropertyArrayUsageHelper
77 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
78 protected:
79 // OGenericUnoDialog overridables
80 virtual Dialog* createDialog(Window* _pParent);
83 //=========================================================================
84 //-------------------------------------------------------------------------
85 OAdvancedSettingsDialog::OAdvancedSettingsDialog(const Reference< XMultiServiceFactory >& _rxORB)
86 :ODatabaseAdministrationDialog(_rxORB)
89 //-------------------------------------------------------------------------
90 Sequence<sal_Int8> SAL_CALL OAdvancedSettingsDialog::getImplementationId( ) throw(RuntimeException)
92 static ::cppu::OImplementationId aId;
93 return aId.getImplementationId();
96 //-------------------------------------------------------------------------
97 Reference< XInterface > SAL_CALL OAdvancedSettingsDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory)
99 return *(new OAdvancedSettingsDialog(_rxFactory));
102 //-------------------------------------------------------------------------
103 ::rtl::OUString SAL_CALL OAdvancedSettingsDialog::getImplementationName() throw(RuntimeException)
105 return getImplementationName_Static();
108 //-------------------------------------------------------------------------
109 ::rtl::OUString OAdvancedSettingsDialog::getImplementationName_Static() throw(RuntimeException)
111 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.OAdvancedSettingsDialog"));
114 //-------------------------------------------------------------------------
115 ::comphelper::StringSequence SAL_CALL OAdvancedSettingsDialog::getSupportedServiceNames() throw(RuntimeException)
117 return getSupportedServiceNames_Static();
120 //-------------------------------------------------------------------------
121 ::comphelper::StringSequence OAdvancedSettingsDialog::getSupportedServiceNames_Static() throw(RuntimeException)
123 ::comphelper::StringSequence aSupported(1);
124 aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.AdvancedDatabaseSettingsDialog"));
125 return aSupported;
128 //-------------------------------------------------------------------------
129 Reference<XPropertySetInfo> SAL_CALL OAdvancedSettingsDialog::getPropertySetInfo() throw(RuntimeException)
131 Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
132 return xInfo;
135 //-------------------------------------------------------------------------
136 ::cppu::IPropertyArrayHelper& OAdvancedSettingsDialog::getInfoHelper()
138 return *const_cast<OAdvancedSettingsDialog*>(this)->getArrayHelper();
141 //------------------------------------------------------------------------------
142 ::cppu::IPropertyArrayHelper* OAdvancedSettingsDialog::createArrayHelper( ) const
144 Sequence< Property > aProps;
145 describeProperties(aProps);
146 return new ::cppu::OPropertyArrayHelper(aProps);
148 //------------------------------------------------------------------------------
149 Dialog* OAdvancedSettingsDialog::createDialog(Window* _pParent)
151 AdvancedSettingsDialog* pDlg = new AdvancedSettingsDialog(_pParent, m_pDatasourceItems, m_aContext.getLegacyServiceFactory(),m_aInitialSelection);
152 return pDlg;
155 //.........................................................................
156 } // namespace dbaui
157 //.........................................................................
159 extern "C" void SAL_CALL createRegistryInfo_OAdvancedSettingsDialog()
161 static ::dbaui::OMultiInstanceAutoRegistration< ::dbaui::OAdvancedSettingsDialog > aAutoRegistration;