Update ooo320-m1
[ooovba.git] / dbaccess / source / ui / uno / admindlg.cxx
bloba88843bf3b2dd97908949b32f20df27b3c56f7e5
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: admindlg.cxx,v $
10 * $Revision: 1.6 $
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 #ifndef _DBU_REGHELPER_HXX_
35 #include "dbu_reghelper.hxx"
36 #endif
37 #ifndef _DBAUI_ADMINDLG_HXX
38 #include "admindlg.hxx"
39 #endif
40 #ifndef _DBAUI_DBADMIN_HXX_
41 #include "dbadmin.hxx"
42 #endif
45 using namespace dbaui;
47 extern "C" void SAL_CALL createRegistryInfo_ODataSourcePropertyDialog()
49 static OMultiInstanceAutoRegistration< ODataSourcePropertyDialog > aAutoRegistration;
52 //.........................................................................
53 namespace dbaui
55 //.........................................................................
57 using namespace ::com::sun::star::uno;
58 using namespace ::com::sun::star::lang;
59 using namespace ::com::sun::star::beans;
61 //=========================================================================
62 //-------------------------------------------------------------------------
63 ODataSourcePropertyDialog::ODataSourcePropertyDialog(const Reference< XMultiServiceFactory >& _rxORB)
64 :ODatabaseAdministrationDialog(_rxORB)
67 //-------------------------------------------------------------------------
68 Sequence<sal_Int8> SAL_CALL ODataSourcePropertyDialog::getImplementationId( ) throw(RuntimeException)
70 static ::cppu::OImplementationId aId;
71 return aId.getImplementationId();
74 //-------------------------------------------------------------------------
75 Reference< XInterface > SAL_CALL ODataSourcePropertyDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory)
77 return *(new ODataSourcePropertyDialog(_rxFactory));
80 //-------------------------------------------------------------------------
81 ::rtl::OUString SAL_CALL ODataSourcePropertyDialog::getImplementationName() throw(RuntimeException)
83 return getImplementationName_Static();
86 //-------------------------------------------------------------------------
87 ::rtl::OUString ODataSourcePropertyDialog::getImplementationName_Static() throw(RuntimeException)
89 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.ODatasourceAdministrationDialog"));
92 //-------------------------------------------------------------------------
93 ::comphelper::StringSequence SAL_CALL ODataSourcePropertyDialog::getSupportedServiceNames() throw(RuntimeException)
95 return getSupportedServiceNames_Static();
98 //-------------------------------------------------------------------------
99 ::comphelper::StringSequence ODataSourcePropertyDialog::getSupportedServiceNames_Static() throw(RuntimeException)
101 ::comphelper::StringSequence aSupported(1);
102 aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DatasourceAdministrationDialog"));
103 return aSupported;
106 //-------------------------------------------------------------------------
107 Reference<XPropertySetInfo> SAL_CALL ODataSourcePropertyDialog::getPropertySetInfo() throw(RuntimeException)
109 Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
110 return xInfo;
113 //-------------------------------------------------------------------------
114 ::cppu::IPropertyArrayHelper& ODataSourcePropertyDialog::getInfoHelper()
116 return *const_cast<ODataSourcePropertyDialog*>(this)->getArrayHelper();
119 //------------------------------------------------------------------------------
120 ::cppu::IPropertyArrayHelper* ODataSourcePropertyDialog::createArrayHelper( ) const
122 Sequence< Property > aProps;
123 describeProperties(aProps);
124 return new ::cppu::OPropertyArrayHelper(aProps);
126 //------------------------------------------------------------------------------
127 Dialog* ODataSourcePropertyDialog::createDialog(Window* _pParent)
130 ODbAdminDialog* pDialog = new ODbAdminDialog(_pParent, m_pDatasourceItems, m_aContext.getLegacyServiceFactory());
132 // the initial selection
133 if ( m_aInitialSelection.hasValue() )
134 pDialog->selectDataSource(m_aInitialSelection);
136 return pDialog;
139 //.........................................................................
140 } // namespace dbaui
141 //.........................................................................