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 "unoadmin.hxx"
31 #include "dbu_reghelper.hxx"
32 #include "advancedsettingsdlg.hxx"
34 //.........................................................................
37 //.........................................................................
39 using namespace ::com::sun::star::uno
;
40 using namespace ::com::sun::star::lang
;
41 using namespace ::com::sun::star::beans
;
43 //=========================================================================
44 //= OAdvancedSettingsDialog
45 //=========================================================================
46 class OAdvancedSettingsDialog
47 :public ODatabaseAdministrationDialog
48 ,public ::comphelper::OPropertyArrayUsageHelper
< OAdvancedSettingsDialog
>
52 OAdvancedSettingsDialog(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
);
56 virtual ::com::sun::star::uno::Sequence
<sal_Int8
> SAL_CALL
getImplementationId( ) throw(::com::sun::star::uno::RuntimeException
);
59 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw(::com::sun::star::uno::RuntimeException
);
60 virtual ::comphelper::StringSequence SAL_CALL
getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException
);
62 // XServiceInfo - static methods
63 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException
);
64 static ::rtl::OUString
getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException
);
65 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
66 SAL_CALL
Create(const ::com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>&);
69 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException
);
70 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
72 // OPropertyArrayUsageHelper
73 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper( ) const;
75 // OGenericUnoDialog overridables
76 virtual Dialog
* createDialog(Window
* _pParent
);
79 //=========================================================================
80 //-------------------------------------------------------------------------
81 OAdvancedSettingsDialog::OAdvancedSettingsDialog(const Reference
< XMultiServiceFactory
>& _rxORB
)
82 :ODatabaseAdministrationDialog(_rxORB
)
85 //-------------------------------------------------------------------------
86 Sequence
<sal_Int8
> SAL_CALL
OAdvancedSettingsDialog::getImplementationId( ) throw(RuntimeException
)
88 static ::cppu::OImplementationId aId
;
89 return aId
.getImplementationId();
92 //-------------------------------------------------------------------------
93 Reference
< XInterface
> SAL_CALL
OAdvancedSettingsDialog::Create(const Reference
< XMultiServiceFactory
>& _rxFactory
)
95 return *(new OAdvancedSettingsDialog(_rxFactory
));
98 //-------------------------------------------------------------------------
99 ::rtl::OUString SAL_CALL
OAdvancedSettingsDialog::getImplementationName() throw(RuntimeException
)
101 return getImplementationName_Static();
104 //-------------------------------------------------------------------------
105 ::rtl::OUString
OAdvancedSettingsDialog::getImplementationName_Static() throw(RuntimeException
)
107 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.OAdvancedSettingsDialog"));
110 //-------------------------------------------------------------------------
111 ::comphelper::StringSequence SAL_CALL
OAdvancedSettingsDialog::getSupportedServiceNames() throw(RuntimeException
)
113 return getSupportedServiceNames_Static();
116 //-------------------------------------------------------------------------
117 ::comphelper::StringSequence
OAdvancedSettingsDialog::getSupportedServiceNames_Static() throw(RuntimeException
)
119 ::comphelper::StringSequence
aSupported(1);
120 aSupported
.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.AdvancedDatabaseSettingsDialog"));
124 //-------------------------------------------------------------------------
125 Reference
<XPropertySetInfo
> SAL_CALL
OAdvancedSettingsDialog::getPropertySetInfo() throw(RuntimeException
)
127 Reference
<XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
131 //-------------------------------------------------------------------------
132 ::cppu::IPropertyArrayHelper
& OAdvancedSettingsDialog::getInfoHelper()
134 return *const_cast<OAdvancedSettingsDialog
*>(this)->getArrayHelper();
137 //------------------------------------------------------------------------------
138 ::cppu::IPropertyArrayHelper
* OAdvancedSettingsDialog::createArrayHelper( ) const
140 Sequence
< Property
> aProps
;
141 describeProperties(aProps
);
142 return new ::cppu::OPropertyArrayHelper(aProps
);
144 //------------------------------------------------------------------------------
145 Dialog
* OAdvancedSettingsDialog::createDialog(Window
* _pParent
)
147 AdvancedSettingsDialog
* pDlg
= new AdvancedSettingsDialog(_pParent
, m_pDatasourceItems
, m_aContext
.getLegacyServiceFactory(),m_aInitialSelection
);
151 //.........................................................................
153 //.........................................................................
155 extern "C" void SAL_CALL
createRegistryInfo_OAdvancedSettingsDialog()
157 static ::dbaui::OMultiInstanceAutoRegistration
< ::dbaui::OAdvancedSettingsDialog
> aAutoRegistration
;
160 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */