1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AdvancedSettingsDlg.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_dbaccess.hxx"
34 #include "unoadmin.hxx"
35 #include "dbu_reghelper.hxx"
36 #include "advancedsettingsdlg.hxx"
38 //.........................................................................
41 //.........................................................................
43 using namespace ::com::sun::star::uno
;
44 using namespace ::com::sun::star::lang
;
45 using namespace ::com::sun::star::beans
;
47 //=========================================================================
48 //= OAdvancedSettingsDialog
49 //=========================================================================
50 class OAdvancedSettingsDialog
51 :public ODatabaseAdministrationDialog
52 ,public ::comphelper::OPropertyArrayUsageHelper
< OAdvancedSettingsDialog
>
56 OAdvancedSettingsDialog(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
);
60 virtual ::com::sun::star::uno::Sequence
<sal_Int8
> SAL_CALL
getImplementationId( ) throw(::com::sun::star::uno::RuntimeException
);
63 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw(::com::sun::star::uno::RuntimeException
);
64 virtual ::comphelper::StringSequence SAL_CALL
getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException
);
66 // XServiceInfo - static methods
67 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException
);
68 static ::rtl::OUString
getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException
);
69 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
70 SAL_CALL
Create(const ::com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>&);
73 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException
);
74 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
76 // OPropertyArrayUsageHelper
77 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper( ) const;
79 // OGenericUnoDialog overridables
80 virtual Dialog
* createDialog(Window
* _pParent
);
83 //=========================================================================
84 //-------------------------------------------------------------------------
85 OAdvancedSettingsDialog::OAdvancedSettingsDialog(const Reference
< XMultiServiceFactory
>& _rxORB
)
86 :ODatabaseAdministrationDialog(_rxORB
)
89 //-------------------------------------------------------------------------
90 Sequence
<sal_Int8
> SAL_CALL
OAdvancedSettingsDialog::getImplementationId( ) throw(RuntimeException
)
92 static ::cppu::OImplementationId aId
;
93 return aId
.getImplementationId();
96 //-------------------------------------------------------------------------
97 Reference
< XInterface
> SAL_CALL
OAdvancedSettingsDialog::Create(const Reference
< XMultiServiceFactory
>& _rxFactory
)
99 return *(new OAdvancedSettingsDialog(_rxFactory
));
102 //-------------------------------------------------------------------------
103 ::rtl::OUString SAL_CALL
OAdvancedSettingsDialog::getImplementationName() throw(RuntimeException
)
105 return getImplementationName_Static();
108 //-------------------------------------------------------------------------
109 ::rtl::OUString
OAdvancedSettingsDialog::getImplementationName_Static() throw(RuntimeException
)
111 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.OAdvancedSettingsDialog"));
114 //-------------------------------------------------------------------------
115 ::comphelper::StringSequence SAL_CALL
OAdvancedSettingsDialog::getSupportedServiceNames() throw(RuntimeException
)
117 return getSupportedServiceNames_Static();
120 //-------------------------------------------------------------------------
121 ::comphelper::StringSequence
OAdvancedSettingsDialog::getSupportedServiceNames_Static() throw(RuntimeException
)
123 ::comphelper::StringSequence
aSupported(1);
124 aSupported
.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.AdvancedDatabaseSettingsDialog"));
128 //-------------------------------------------------------------------------
129 Reference
<XPropertySetInfo
> SAL_CALL
OAdvancedSettingsDialog::getPropertySetInfo() throw(RuntimeException
)
131 Reference
<XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
135 //-------------------------------------------------------------------------
136 ::cppu::IPropertyArrayHelper
& OAdvancedSettingsDialog::getInfoHelper()
138 return *const_cast<OAdvancedSettingsDialog
*>(this)->getArrayHelper();
141 //------------------------------------------------------------------------------
142 ::cppu::IPropertyArrayHelper
* OAdvancedSettingsDialog::createArrayHelper( ) const
144 Sequence
< Property
> aProps
;
145 describeProperties(aProps
);
146 return new ::cppu::OPropertyArrayHelper(aProps
);
148 //------------------------------------------------------------------------------
149 Dialog
* OAdvancedSettingsDialog::createDialog(Window
* _pParent
)
151 AdvancedSettingsDialog
* pDlg
= new AdvancedSettingsDialog(_pParent
, m_pDatasourceItems
, m_aContext
.getLegacyServiceFactory(),m_aInitialSelection
);
155 //.........................................................................
157 //.........................................................................
159 extern "C" void SAL_CALL
createRegistryInfo_OAdvancedSettingsDialog()
161 static ::dbaui::OMultiInstanceAutoRegistration
< ::dbaui::OAdvancedSettingsDialog
> aAutoRegistration
;