LibreOffice Module dbaccess (master) 1
AdvancedSettingsDlg.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <sal/config.h>
21
22#include <unoadmin.hxx>
25#include <vcl/svapp.hxx>
26
27namespace dbaui
28{
29
30 using namespace ::com::sun::star::uno;
31 using namespace ::com::sun::star::lang;
32 using namespace ::com::sun::star::beans;
33
34 namespace {
35
36 // OAdvancedSettingsDialog
37 class OAdvancedSettingsDialog
38 :public ODatabaseAdministrationDialog
39 ,public ::comphelper::OPropertyArrayUsageHelper< OAdvancedSettingsDialog >
40 {
41
42 public:
43 explicit OAdvancedSettingsDialog(const css::uno::Reference< css::uno::XComponentContext >& _rxORB);
44
45 // XTypeProvider
46 virtual css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) override;
47
48 // XServiceInfo
49 virtual OUString SAL_CALL getImplementationName() override;
50 virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
51
52 // XPropertySet
53 virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
54 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
55
56 // OPropertyArrayUsageHelper
57 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
58 protected:
59 // OGenericUnoDialog overridables
60 virtual std::unique_ptr<weld::DialogController> createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) override;
61 };
62
63 }
64
65 OAdvancedSettingsDialog::OAdvancedSettingsDialog(const Reference< XComponentContext >& _rxORB)
66 :ODatabaseAdministrationDialog(_rxORB)
67 {
68 }
69 Sequence<sal_Int8> SAL_CALL OAdvancedSettingsDialog::getImplementationId( )
70 {
71 return css::uno::Sequence<sal_Int8>();
72 }
73
74 OUString SAL_CALL OAdvancedSettingsDialog::getImplementationName()
75 {
76 return "org.openoffice.comp.dbu.OAdvancedSettingsDialog";
77 }
78
79 css::uno::Sequence<OUString> SAL_CALL OAdvancedSettingsDialog::getSupportedServiceNames()
80 {
81 return { "com.sun.star.sdb.AdvancedDatabaseSettingsDialog" };
82 }
83
84 Reference<XPropertySetInfo> SAL_CALL OAdvancedSettingsDialog::getPropertySetInfo()
85 {
86 Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
87 return xInfo;
88 }
89
90 ::cppu::IPropertyArrayHelper& OAdvancedSettingsDialog::getInfoHelper()
91 {
92 return *getArrayHelper();
93 }
94
95 ::cppu::IPropertyArrayHelper* OAdvancedSettingsDialog::createArrayHelper( ) const
96 {
97 Sequence< Property > aProps;
98 describeProperties(aProps);
99 return new ::cppu::OPropertyArrayHelper(aProps);
100 }
101
102 std::unique_ptr<weld::DialogController> OAdvancedSettingsDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
103 {
104 return std::make_unique<AdvancedSettingsDialog>(Application::GetFrameWeld(rParent), m_pDatasourceItems.get(),
105 m_aContext, m_aInitialSelection);
106 }
107
108} // namespace dbaui
109
110extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
112 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& )
113{
114 return cppu::acquire(new ::dbaui::OAdvancedSettingsDialog(context));
115}
116
117/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * org_openoffice_comp_dbu_OAdvancedSettingsDialog_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
Reference< XComponentContext > m_aContext
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()