Use COMReference to handle COM pointers in CreateShortcut
[LibreOffice.git] / dbaccess / source / ui / uno / AdvancedSettingsDlg.cxx
blob51c3d2e9872efc0cee5ae39aeeb778bf37f8a8c6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <unoadmin.hxx>
23 #include <advancedsettingsdlg.hxx>
24 #include <comphelper/proparrhlp.hxx>
25 #include <vcl/svapp.hxx>
27 namespace dbaui
30 using namespace ::com::sun::star::uno;
31 using namespace ::com::sun::star::beans;
33 namespace {
35 // OAdvancedSettingsDialog
36 class OAdvancedSettingsDialog
37 :public ODatabaseAdministrationDialog
38 ,public ::comphelper::OPropertyArrayUsageHelper< OAdvancedSettingsDialog >
41 public:
42 explicit OAdvancedSettingsDialog(const css::uno::Reference< css::uno::XComponentContext >& _rxORB);
44 // XTypeProvider
45 virtual css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) override;
47 // XServiceInfo
48 virtual OUString SAL_CALL getImplementationName() override;
49 virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
51 // XPropertySet
52 virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
53 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
55 // OPropertyArrayUsageHelper
56 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
57 protected:
58 // OGenericUnoDialog overridables
59 virtual std::unique_ptr<weld::DialogController> createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) override;
64 OAdvancedSettingsDialog::OAdvancedSettingsDialog(const Reference< XComponentContext >& _rxORB)
65 :ODatabaseAdministrationDialog(_rxORB)
68 Sequence<sal_Int8> SAL_CALL OAdvancedSettingsDialog::getImplementationId( )
70 return css::uno::Sequence<sal_Int8>();
73 OUString SAL_CALL OAdvancedSettingsDialog::getImplementationName()
75 return u"org.openoffice.comp.dbu.OAdvancedSettingsDialog"_ustr;
78 css::uno::Sequence<OUString> SAL_CALL OAdvancedSettingsDialog::getSupportedServiceNames()
80 return { u"com.sun.star.sdb.AdvancedDatabaseSettingsDialog"_ustr };
83 Reference<XPropertySetInfo> SAL_CALL OAdvancedSettingsDialog::getPropertySetInfo()
85 Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
86 return xInfo;
89 ::cppu::IPropertyArrayHelper& OAdvancedSettingsDialog::getInfoHelper()
91 return *getArrayHelper();
94 ::cppu::IPropertyArrayHelper* OAdvancedSettingsDialog::createArrayHelper( ) const
96 Sequence< Property > aProps;
97 describeProperties(aProps);
98 return new ::cppu::OPropertyArrayHelper(aProps);
101 std::unique_ptr<weld::DialogController> OAdvancedSettingsDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
103 return std::make_unique<AdvancedSettingsDialog>(Application::GetFrameWeld(rParent), m_pDatasourceItems.get(),
104 m_aContext, m_aInitialSelection);
107 } // namespace dbaui
109 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
110 org_openoffice_comp_dbu_OAdvancedSettingsDialog_get_implementation(
111 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& )
113 return cppu::acquire(new ::dbaui::OAdvancedSettingsDialog(context));
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */