1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/config.h>
22 #include "uiservices.hxx"
23 #include "unoadmin.hxx"
24 #include "dbu_reghelper.hxx"
25 #include "advancedsettingsdlg.hxx"
26 #include <comphelper/processfactory.hxx>
31 using namespace ::com::sun::star::uno
;
32 using namespace ::com::sun::star::lang
;
33 using namespace ::com::sun::star::beans
;
35 // OAdvancedSettingsDialog
36 class OAdvancedSettingsDialog
37 :public ODatabaseAdministrationDialog
38 ,public ::comphelper::OPropertyArrayUsageHelper
< OAdvancedSettingsDialog
>
42 explicit OAdvancedSettingsDialog(const css::uno::Reference
< css::uno::XComponentContext
>& _rxORB
);
46 virtual css::uno::Sequence
<sal_Int8
> SAL_CALL
getImplementationId( ) throw(css::uno::RuntimeException
, std::exception
) override
;
49 virtual OUString SAL_CALL
getImplementationName() throw(css::uno::RuntimeException
, std::exception
) override
;
50 virtual css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() throw(css::uno::RuntimeException
, std::exception
) override
;
52 // XServiceInfo - static methods
53 /// @throws css::uno::RuntimeException
54 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static() throw( css::uno::RuntimeException
);
55 /// @throws css::uno::RuntimeException
56 static OUString
getImplementationName_Static() throw( css::uno::RuntimeException
);
57 static css::uno::Reference
< css::uno::XInterface
>
58 SAL_CALL
Create(const css::uno::Reference
< css::lang::XMultiServiceFactory
>&);
61 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() throw(css::uno::RuntimeException
, std::exception
) override
;
62 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
64 // OPropertyArrayUsageHelper
65 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper( ) const override
;
67 // OGenericUnoDialog overridables
68 virtual VclPtr
<Dialog
> createDialog(vcl::Window
* _pParent
) override
;
71 OAdvancedSettingsDialog::OAdvancedSettingsDialog(const Reference
< XComponentContext
>& _rxORB
)
72 :ODatabaseAdministrationDialog(_rxORB
)
75 Sequence
<sal_Int8
> SAL_CALL
OAdvancedSettingsDialog::getImplementationId( ) throw(RuntimeException
, std::exception
)
77 return css::uno::Sequence
<sal_Int8
>();
80 Reference
< XInterface
> SAL_CALL
OAdvancedSettingsDialog::Create(const Reference
< XMultiServiceFactory
>& _rxFactory
)
82 return *(new OAdvancedSettingsDialog( comphelper::getComponentContext(_rxFactory
) ));
85 OUString SAL_CALL
OAdvancedSettingsDialog::getImplementationName() throw(RuntimeException
, std::exception
)
87 return getImplementationName_Static();
90 OUString
OAdvancedSettingsDialog::getImplementationName_Static() throw(RuntimeException
)
92 return OUString("org.openoffice.comp.dbu.OAdvancedSettingsDialog");
95 css::uno::Sequence
<OUString
> SAL_CALL
OAdvancedSettingsDialog::getSupportedServiceNames() throw(RuntimeException
, std::exception
)
97 return getSupportedServiceNames_Static();
100 css::uno::Sequence
<OUString
> OAdvancedSettingsDialog::getSupportedServiceNames_Static() throw(RuntimeException
)
102 css::uno::Sequence
<OUString
> aSupported
{ "com.sun.star.sdb.AdvancedDatabaseSettingsDialog" };
106 Reference
<XPropertySetInfo
> SAL_CALL
OAdvancedSettingsDialog::getPropertySetInfo() throw(RuntimeException
, std::exception
)
108 Reference
<XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
112 ::cppu::IPropertyArrayHelper
& OAdvancedSettingsDialog::getInfoHelper()
114 return *getArrayHelper();
117 ::cppu::IPropertyArrayHelper
* OAdvancedSettingsDialog::createArrayHelper( ) const
119 Sequence
< Property
> aProps
;
120 describeProperties(aProps
);
121 return new ::cppu::OPropertyArrayHelper(aProps
);
123 VclPtr
<Dialog
> OAdvancedSettingsDialog::createDialog(vcl::Window
* _pParent
)
125 return VclPtr
<AdvancedSettingsDialog
>::Create(_pParent
, m_pDatasourceItems
, m_aContext
, m_aInitialSelection
);
130 extern "C" void SAL_CALL
createRegistryInfo_OAdvancedSettingsDialog()
132 static ::dbaui::OMultiInstanceAutoRegistration
< ::dbaui::OAdvancedSettingsDialog
> aAutoRegistration
;
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */