xref: /trunk/main/dbaccess/source/ui/uno/UserSettingsDlg.cxx (revision cf6516809c57e1bb0a940545cca99cdad54d4ce2)
196de5490SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
396de5490SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
496de5490SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
596de5490SAndrew Rist  * distributed with this work for additional information
696de5490SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
796de5490SAndrew Rist  * to you under the Apache License, Version 2.0 (the
896de5490SAndrew Rist  * "License"); you may not use this file except in compliance
996de5490SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
1196de5490SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
1396de5490SAndrew Rist  * Unless required by applicable law or agreed to in writing,
1496de5490SAndrew Rist  * software distributed under the License is distributed on an
1596de5490SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1696de5490SAndrew Rist  * KIND, either express or implied.  See the License for the
1796de5490SAndrew Rist  * specific language governing permissions and limitations
1896de5490SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
2096de5490SAndrew Rist  *************************************************************/
2196de5490SAndrew Rist 
2296de5490SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25*b63233d8Sdamjan #include "precompiled_dbui.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _DBU_REGHELPER_HXX_
28cdf0e10cSrcweir #include "dbu_reghelper.hxx"
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _DBAUI_USERSETTINGSDLG_HXX
31cdf0e10cSrcweir #include "UserSettingsDlg.hxx"
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef DBAUI_USERADMINDLG_HXX
34cdf0e10cSrcweir #include "UserAdminDlg.hxx"
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir 
37cdf0e10cSrcweir 
38cdf0e10cSrcweir using namespace dbaui;
39cdf0e10cSrcweir 
createRegistryInfo_OUserSettingsDialog()40cdf0e10cSrcweir extern "C" void SAL_CALL createRegistryInfo_OUserSettingsDialog()
41cdf0e10cSrcweir {
42cdf0e10cSrcweir     static OMultiInstanceAutoRegistration< OUserSettingsDialog > aAutoRegistration;
43cdf0e10cSrcweir }
44cdf0e10cSrcweir 
45cdf0e10cSrcweir //.........................................................................
46cdf0e10cSrcweir namespace dbaui
47cdf0e10cSrcweir {
48cdf0e10cSrcweir //.........................................................................
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     using namespace ::com::sun::star::uno;
51cdf0e10cSrcweir     using namespace ::com::sun::star::lang;
52cdf0e10cSrcweir     using namespace ::com::sun::star::beans;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir //=========================================================================
55cdf0e10cSrcweir //-------------------------------------------------------------------------
OUserSettingsDialog(const Reference<XMultiServiceFactory> & _rxORB)56cdf0e10cSrcweir OUserSettingsDialog::OUserSettingsDialog(const Reference< XMultiServiceFactory >& _rxORB)
57cdf0e10cSrcweir     :ODatabaseAdministrationDialog(_rxORB)
58cdf0e10cSrcweir {
59cdf0e10cSrcweir }
60cdf0e10cSrcweir //-------------------------------------------------------------------------
getImplementationId()61cdf0e10cSrcweir Sequence<sal_Int8> SAL_CALL OUserSettingsDialog::getImplementationId(  ) throw(RuntimeException)
62cdf0e10cSrcweir {
63cdf0e10cSrcweir     static ::cppu::OImplementationId aId;
64cdf0e10cSrcweir     return aId.getImplementationId();
65cdf0e10cSrcweir }
66cdf0e10cSrcweir 
67cdf0e10cSrcweir //-------------------------------------------------------------------------
Create(const Reference<XMultiServiceFactory> & _rxFactory)68cdf0e10cSrcweir Reference< XInterface > SAL_CALL OUserSettingsDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory)
69cdf0e10cSrcweir {
70cdf0e10cSrcweir     return *(new OUserSettingsDialog(_rxFactory));
71cdf0e10cSrcweir }
72cdf0e10cSrcweir 
73cdf0e10cSrcweir //-------------------------------------------------------------------------
getImplementationName()74cdf0e10cSrcweir ::rtl::OUString SAL_CALL OUserSettingsDialog::getImplementationName() throw(RuntimeException)
75cdf0e10cSrcweir {
76cdf0e10cSrcweir     return getImplementationName_Static();
77cdf0e10cSrcweir }
78cdf0e10cSrcweir 
79cdf0e10cSrcweir //-------------------------------------------------------------------------
getImplementationName_Static()80cdf0e10cSrcweir ::rtl::OUString OUserSettingsDialog::getImplementationName_Static() throw(RuntimeException)
81cdf0e10cSrcweir {
82cdf0e10cSrcweir     return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.OUserSettingsDialog"));
83cdf0e10cSrcweir }
84cdf0e10cSrcweir 
85cdf0e10cSrcweir //-------------------------------------------------------------------------
getSupportedServiceNames()86cdf0e10cSrcweir ::comphelper::StringSequence SAL_CALL OUserSettingsDialog::getSupportedServiceNames() throw(RuntimeException)
87cdf0e10cSrcweir {
88cdf0e10cSrcweir     return getSupportedServiceNames_Static();
89cdf0e10cSrcweir }
90cdf0e10cSrcweir 
91cdf0e10cSrcweir //-------------------------------------------------------------------------
getSupportedServiceNames_Static()92cdf0e10cSrcweir ::comphelper::StringSequence OUserSettingsDialog::getSupportedServiceNames_Static() throw(RuntimeException)
93cdf0e10cSrcweir {
94cdf0e10cSrcweir     ::comphelper::StringSequence aSupported(1);
95cdf0e10cSrcweir     aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.UserAdministrationDialog"));
96cdf0e10cSrcweir     return aSupported;
97cdf0e10cSrcweir }
98cdf0e10cSrcweir 
99cdf0e10cSrcweir //-------------------------------------------------------------------------
getPropertySetInfo()100cdf0e10cSrcweir Reference<XPropertySetInfo>  SAL_CALL OUserSettingsDialog::getPropertySetInfo() throw(RuntimeException)
101cdf0e10cSrcweir {
102cdf0e10cSrcweir     Reference<XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
103cdf0e10cSrcweir     return xInfo;
104cdf0e10cSrcweir }
105cdf0e10cSrcweir 
106cdf0e10cSrcweir //-------------------------------------------------------------------------
getInfoHelper()107cdf0e10cSrcweir ::cppu::IPropertyArrayHelper& OUserSettingsDialog::getInfoHelper()
108cdf0e10cSrcweir {
109cdf0e10cSrcweir     return *const_cast<OUserSettingsDialog*>(this)->getArrayHelper();
110cdf0e10cSrcweir }
111cdf0e10cSrcweir 
112cdf0e10cSrcweir //------------------------------------------------------------------------------
createArrayHelper() const113cdf0e10cSrcweir ::cppu::IPropertyArrayHelper* OUserSettingsDialog::createArrayHelper( ) const
114cdf0e10cSrcweir {
115cdf0e10cSrcweir     Sequence< Property > aProps;
116cdf0e10cSrcweir     describeProperties(aProps);
117cdf0e10cSrcweir     return new ::cppu::OPropertyArrayHelper(aProps);
118cdf0e10cSrcweir }
119cdf0e10cSrcweir //------------------------------------------------------------------------------
createDialog(Window * _pParent)120cdf0e10cSrcweir Dialog* OUserSettingsDialog::createDialog(Window* _pParent)
121cdf0e10cSrcweir {
122cdf0e10cSrcweir     OUserAdminDlg* pDlg = new OUserAdminDlg(_pParent, m_pDatasourceItems, m_aContext.getLegacyServiceFactory(),m_aInitialSelection,m_xActiveConnection);
123cdf0e10cSrcweir     return pDlg;
124cdf0e10cSrcweir }
125cdf0e10cSrcweir 
126cdf0e10cSrcweir //.........................................................................
127cdf0e10cSrcweir }   // namespace dbaui
128cdf0e10cSrcweir //.........................................................................
129