Line data Source code
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 "unoadmin.hxx"
21 : #include "dbu_reghelper.hxx"
22 : #include "advancedsettingsdlg.hxx"
23 : #include <comphelper/processfactory.hxx>
24 :
25 : namespace dbaui
26 : {
27 :
28 : using namespace ::com::sun::star::uno;
29 : using namespace ::com::sun::star::lang;
30 : using namespace ::com::sun::star::beans;
31 :
32 : // OAdvancedSettingsDialog
33 0 : class OAdvancedSettingsDialog
34 : :public ODatabaseAdministrationDialog
35 : ,public ::comphelper::OPropertyArrayUsageHelper< OAdvancedSettingsDialog >
36 : {
37 :
38 : protected:
39 : OAdvancedSettingsDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB);
40 :
41 : public:
42 : // XTypeProvider
43 : virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
44 :
45 : // XServiceInfo
46 : virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
47 : virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
48 :
49 : // XServiceInfo - static methods
50 : static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
51 : static OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
52 : static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
53 : SAL_CALL Create(const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >&);
54 :
55 : // XPropertySet
56 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
57 : virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE;
58 :
59 : // OPropertyArrayUsageHelper
60 : virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE;
61 : protected:
62 : // OGenericUnoDialog overridables
63 : virtual Dialog* createDialog(Window* _pParent) SAL_OVERRIDE;
64 : };
65 :
66 0 : OAdvancedSettingsDialog::OAdvancedSettingsDialog(const Reference< XComponentContext >& _rxORB)
67 0 : :ODatabaseAdministrationDialog(_rxORB)
68 : {
69 0 : }
70 0 : Sequence<sal_Int8> SAL_CALL OAdvancedSettingsDialog::getImplementationId( ) throw(RuntimeException, std::exception)
71 : {
72 0 : return css::uno::Sequence<sal_Int8>();
73 : }
74 :
75 0 : Reference< XInterface > SAL_CALL OAdvancedSettingsDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory)
76 : {
77 0 : return *(new OAdvancedSettingsDialog( comphelper::getComponentContext(_rxFactory) ));
78 : }
79 :
80 0 : OUString SAL_CALL OAdvancedSettingsDialog::getImplementationName() throw(RuntimeException, std::exception)
81 : {
82 0 : return getImplementationName_Static();
83 : }
84 :
85 0 : OUString OAdvancedSettingsDialog::getImplementationName_Static() throw(RuntimeException)
86 : {
87 0 : return OUString("org.openoffice.comp.dbu.OAdvancedSettingsDialog");
88 : }
89 :
90 0 : ::comphelper::StringSequence SAL_CALL OAdvancedSettingsDialog::getSupportedServiceNames() throw(RuntimeException, std::exception)
91 : {
92 0 : return getSupportedServiceNames_Static();
93 : }
94 :
95 0 : ::comphelper::StringSequence OAdvancedSettingsDialog::getSupportedServiceNames_Static() throw(RuntimeException)
96 : {
97 0 : ::comphelper::StringSequence aSupported(1);
98 0 : aSupported[0] = "com.sun.star.sdb.AdvancedDatabaseSettingsDialog";
99 0 : return aSupported;
100 : }
101 :
102 0 : Reference<XPropertySetInfo> SAL_CALL OAdvancedSettingsDialog::getPropertySetInfo() throw(RuntimeException, std::exception)
103 : {
104 0 : Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
105 0 : return xInfo;
106 : }
107 :
108 0 : ::cppu::IPropertyArrayHelper& OAdvancedSettingsDialog::getInfoHelper()
109 : {
110 0 : return *const_cast<OAdvancedSettingsDialog*>(this)->getArrayHelper();
111 : }
112 :
113 0 : ::cppu::IPropertyArrayHelper* OAdvancedSettingsDialog::createArrayHelper( ) const
114 : {
115 0 : Sequence< Property > aProps;
116 0 : describeProperties(aProps);
117 0 : return new ::cppu::OPropertyArrayHelper(aProps);
118 : }
119 0 : Dialog* OAdvancedSettingsDialog::createDialog(Window* _pParent)
120 : {
121 0 : AdvancedSettingsDialog* pDlg = new AdvancedSettingsDialog(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection);
122 0 : return pDlg;
123 : }
124 :
125 : } // namespace dbaui
126 :
127 0 : extern "C" void SAL_CALL createRegistryInfo_OAdvancedSettingsDialog()
128 : {
129 0 : static ::dbaui::OMultiInstanceAutoRegistration< ::dbaui::OAdvancedSettingsDialog > aAutoRegistration;
130 0 : }
131 :
132 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|