xref: /aoo4110/main/dbaccess/source/ui/uno/admindlg.cxx (revision b1cdbd2c)
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 _DBU_REGHELPER_HXX_
28 #include "dbu_reghelper.hxx"
29 #endif
30 #ifndef _DBAUI_ADMINDLG_HXX
31 #include "admindlg.hxx"
32 #endif
33 #ifndef _DBAUI_DBADMIN_HXX_
34 #include "dbadmin.hxx"
35 #endif
36 
37 
38 using namespace dbaui;
39 
createRegistryInfo_ODataSourcePropertyDialog()40 extern "C" void SAL_CALL createRegistryInfo_ODataSourcePropertyDialog()
41 {
42 	static OMultiInstanceAutoRegistration< ODataSourcePropertyDialog > aAutoRegistration;
43 }
44 
45 //.........................................................................
46 namespace dbaui
47 {
48 //.........................................................................
49 
50 	using namespace ::com::sun::star::uno;
51 	using namespace ::com::sun::star::lang;
52 	using namespace ::com::sun::star::beans;
53 
54 //=========================================================================
55 //-------------------------------------------------------------------------
ODataSourcePropertyDialog(const Reference<XMultiServiceFactory> & _rxORB)56 ODataSourcePropertyDialog::ODataSourcePropertyDialog(const Reference< XMultiServiceFactory >& _rxORB)
57 	:ODatabaseAdministrationDialog(_rxORB)
58 {
59 }
60 //-------------------------------------------------------------------------
getImplementationId()61 Sequence<sal_Int8> SAL_CALL ODataSourcePropertyDialog::getImplementationId(  ) throw(RuntimeException)
62 {
63 	static ::cppu::OImplementationId aId;
64 	return aId.getImplementationId();
65 }
66 
67 //-------------------------------------------------------------------------
Create(const Reference<XMultiServiceFactory> & _rxFactory)68 Reference< XInterface > SAL_CALL ODataSourcePropertyDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory)
69 {
70 	return *(new ODataSourcePropertyDialog(_rxFactory));
71 }
72 
73 //-------------------------------------------------------------------------
getImplementationName()74 ::rtl::OUString SAL_CALL ODataSourcePropertyDialog::getImplementationName() throw(RuntimeException)
75 {
76 	return getImplementationName_Static();
77 }
78 
79 //-------------------------------------------------------------------------
getImplementationName_Static()80 ::rtl::OUString ODataSourcePropertyDialog::getImplementationName_Static() throw(RuntimeException)
81 {
82 	return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.ODatasourceAdministrationDialog"));
83 }
84 
85 //-------------------------------------------------------------------------
getSupportedServiceNames()86 ::comphelper::StringSequence SAL_CALL ODataSourcePropertyDialog::getSupportedServiceNames() throw(RuntimeException)
87 {
88 	return getSupportedServiceNames_Static();
89 }
90 
91 //-------------------------------------------------------------------------
getSupportedServiceNames_Static()92 ::comphelper::StringSequence ODataSourcePropertyDialog::getSupportedServiceNames_Static() throw(RuntimeException)
93 {
94 	::comphelper::StringSequence aSupported(1);
95 	aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DatasourceAdministrationDialog"));
96 	return aSupported;
97 }
98 
99 //-------------------------------------------------------------------------
getPropertySetInfo()100 Reference<XPropertySetInfo>  SAL_CALL ODataSourcePropertyDialog::getPropertySetInfo() throw(RuntimeException)
101 {
102 	Reference<XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
103 	return xInfo;
104 }
105 
106 //-------------------------------------------------------------------------
getInfoHelper()107 ::cppu::IPropertyArrayHelper& ODataSourcePropertyDialog::getInfoHelper()
108 {
109 	return *const_cast<ODataSourcePropertyDialog*>(this)->getArrayHelper();
110 }
111 
112 //------------------------------------------------------------------------------
createArrayHelper() const113 ::cppu::IPropertyArrayHelper* ODataSourcePropertyDialog::createArrayHelper( ) const
114 {
115 	Sequence< Property > aProps;
116 	describeProperties(aProps);
117 	return new ::cppu::OPropertyArrayHelper(aProps);
118 }
119 //------------------------------------------------------------------------------
createDialog(Window * _pParent)120 Dialog*	ODataSourcePropertyDialog::createDialog(Window* _pParent)
121 {
122 
123 	ODbAdminDialog* pDialog = new ODbAdminDialog(_pParent, m_pDatasourceItems, m_aContext.getLegacyServiceFactory());
124 
125 	// the initial selection
126 	if ( m_aInitialSelection.hasValue() )
127 		pDialog->selectDataSource(m_aInitialSelection);
128 
129 	return pDialog;
130 }
131 
132 //.........................................................................
133 }	// namespace dbaui
134 //.........................................................................
135 
136