1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
30 #include "dbu_reghelper.hxx"
31 #include "admindlg.hxx"
32 #include "dbadmin.hxx"
35 using namespace dbaui
;
37 extern "C" void SAL_CALL
createRegistryInfo_ODataSourcePropertyDialog()
39 static OMultiInstanceAutoRegistration
< ODataSourcePropertyDialog
> aAutoRegistration
;
42 //.........................................................................
45 //.........................................................................
47 using namespace ::com::sun::star::uno
;
48 using namespace ::com::sun::star::lang
;
49 using namespace ::com::sun::star::beans
;
51 //=========================================================================
52 //-------------------------------------------------------------------------
53 ODataSourcePropertyDialog::ODataSourcePropertyDialog(const Reference
< XMultiServiceFactory
>& _rxORB
)
54 :ODatabaseAdministrationDialog(_rxORB
)
57 //-------------------------------------------------------------------------
58 Sequence
<sal_Int8
> SAL_CALL
ODataSourcePropertyDialog::getImplementationId( ) throw(RuntimeException
)
60 static ::cppu::OImplementationId aId
;
61 return aId
.getImplementationId();
64 //-------------------------------------------------------------------------
65 Reference
< XInterface
> SAL_CALL
ODataSourcePropertyDialog::Create(const Reference
< XMultiServiceFactory
>& _rxFactory
)
67 return *(new ODataSourcePropertyDialog(_rxFactory
));
70 //-------------------------------------------------------------------------
71 ::rtl::OUString SAL_CALL
ODataSourcePropertyDialog::getImplementationName() throw(RuntimeException
)
73 return getImplementationName_Static();
76 //-------------------------------------------------------------------------
77 ::rtl::OUString
ODataSourcePropertyDialog::getImplementationName_Static() throw(RuntimeException
)
79 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.ODatasourceAdministrationDialog"));
82 //-------------------------------------------------------------------------
83 ::comphelper::StringSequence SAL_CALL
ODataSourcePropertyDialog::getSupportedServiceNames() throw(RuntimeException
)
85 return getSupportedServiceNames_Static();
88 //-------------------------------------------------------------------------
89 ::comphelper::StringSequence
ODataSourcePropertyDialog::getSupportedServiceNames_Static() throw(RuntimeException
)
91 ::comphelper::StringSequence
aSupported(1);
92 aSupported
.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DatasourceAdministrationDialog"));
96 //-------------------------------------------------------------------------
97 Reference
<XPropertySetInfo
> SAL_CALL
ODataSourcePropertyDialog::getPropertySetInfo() throw(RuntimeException
)
99 Reference
<XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
103 //-------------------------------------------------------------------------
104 ::cppu::IPropertyArrayHelper
& ODataSourcePropertyDialog::getInfoHelper()
106 return *const_cast<ODataSourcePropertyDialog
*>(this)->getArrayHelper();
109 //------------------------------------------------------------------------------
110 ::cppu::IPropertyArrayHelper
* ODataSourcePropertyDialog::createArrayHelper( ) const
112 Sequence
< Property
> aProps
;
113 describeProperties(aProps
);
114 return new ::cppu::OPropertyArrayHelper(aProps
);
116 //------------------------------------------------------------------------------
117 Dialog
* ODataSourcePropertyDialog::createDialog(Window
* _pParent
)
120 ODbAdminDialog
* pDialog
= new ODbAdminDialog(_pParent
, m_pDatasourceItems
, m_aContext
.getLegacyServiceFactory());
122 // the initial selection
123 if ( m_aInitialSelection
.hasValue() )
124 pDialog
->selectDataSource(m_aInitialSelection
);
129 //.........................................................................
131 //.........................................................................
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */