update dev300-m58
[ooovba.git] / dbaccess / source / ui / dlg / DBSetupConnectionPages.cxx
blob3b649c6f762cf0bc56801989b15915cc8ae36fad
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DBSetupConnectionPages.cxx,v $
10 * $Revision: 1.19.18.1 $
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"
33 #ifndef DBAUI_DBSETUPCONNECTIONPAGES_HXX
34 #include "DBSetupConnectionPages.hxx"
35 #endif
36 #ifndef _DBAUI_SQLMESSAGE_HXX_
37 #include "sqlmessage.hxx"
38 #endif
39 #ifndef _DBU_RESOURCE_HRC_
40 #include "dbu_resource.hrc"
41 #endif
42 #ifndef _DBAUI_AUTOCONTROLS_HRC_
43 #include "AutoControls.hrc"
44 #endif
45 #ifndef _DBAUI_DBADMINSETUP_HRC_
46 #include "dbadminsetup.hrc"
47 #endif
48 #ifndef _SFXITEMSET_HXX
49 #include <svtools/itemset.hxx>
50 #endif
51 #ifndef _SFXSTRITEM_HXX
52 #include <svtools/stritem.hxx>
53 #endif
54 #ifndef _SFXENUMITEM_HXX
55 #include <svtools/eitem.hxx>
56 #endif
57 #ifndef _SFXINTITEM_HXX
58 #include <svtools/intitem.hxx>
59 #endif
60 #ifndef _DBAUI_DATASOURCEITEMS_HXX_
61 #include "dsitems.hxx"
62 #endif
63 #include "dsnItem.hxx"
64 #ifndef _DBA_DBACCESS_HELPID_HRC_
65 #include "dbaccess_helpid.hrc"
66 #endif
67 #ifndef _DBAUI_LOCALRESACCESS_HXX_
68 #include "localresaccess.hxx"
69 #endif
70 #ifndef _SV_MSGBOX_HXX
71 #include <vcl/msgbox.hxx>
72 #endif
73 #ifndef _SV_MNEMONIC_HXX
74 #include <vcl/mnemonic.hxx>
75 #endif
76 #ifndef _SVTOOLS_CJKOPTIONS_HXX
77 #include <svtools/cjkoptions.hxx>
78 #endif
79 #include <jvmaccess/virtualmachine.hxx>
80 #ifndef _CONNECTIVITY_COMMONTOOLS_HXX_
81 #include <connectivity/CommonTools.hxx>
82 #endif
83 #ifndef DBAUI_DRIVERSETTINGS_HXX
84 #include "DriverSettings.hxx"
85 #endif
86 #ifndef _DBAUI_DBADMIN_HXX_
87 #include "dbadmin.hxx"
88 #endif
89 #ifndef _COMPHELPER_TYPES_HXX_
90 #include <comphelper/types.hxx>
91 #endif
93 #ifndef _COM_SUN_STAR_UI_DIALOGS_XFOLDERPICKER_HPP_
94 #include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
95 #endif
96 // #106016# ------------------------------------
97 #ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP_
98 #include <com/sun/star/task/XInteractionHandler.hpp>
99 #endif
100 #include <com/sun/star/sdbc/XDriverAccess.hpp>
101 #include "dbustrings.hrc"
102 #ifndef SVTOOLS_FILENOTATION_HXX_
103 #include <svtools/filenotation.hxx>
104 #endif
106 #include <unotools/localfilehelper.hxx>
107 #include <unotools/ucbhelper.hxx>
108 #include <ucbhelper/commandenvironment.hxx>
109 #include "finteraction.hxx"
110 #include <connectivity/CommonTools.hxx>
111 #include <connectivity/DriversConfig.hxx>
112 #include "dbaccess_helpid.hrc"
113 #include <svtools/pathoptions.hxx>
114 #include <svtools/roadmapwizard.hxx>
115 #include "TextConnectionHelper.hxx"
118 //.........................................................................
119 namespace dbaui
121 //.........................................................................
122 using namespace ::com::sun::star;
123 // using namespace ::com::sun::star::ucb;
124 // using namespace ::com::sun::star::ui::dialogs;
125 // using namespace ::com::sun::star::sdbc;
126 // using namespace ::com::sun::star::beans;
127 // using namespace ::com::sun::star::lang;
128 // using namespace ::com::sun::star::container;
129 // using namespace ::dbtools;
130 // using namespace ::svt;
132 OGenericAdministrationPage* OTextConnectionPageSetup::CreateTextTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
134 return ( new OTextConnectionPageSetup( pParent, _rAttrSet ) );
138 //========================================================================
139 //= OTextConnectionPageSetup
140 //========================================================================
141 DBG_NAME(OTextConnectionPageSetup)
142 //------------------------------------------------------------------------
143 OTextConnectionPageSetup::OTextConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs )
144 :OConnectionTabPageSetup(pParent, PAGE_DBWIZARD_TEXT, _rCoreAttrs, STR_TEXT_HELPTEXT, STR_TEXT_HEADERTEXT, STR_TEXT_PATH_OR_FILE)
146 DBG_CTOR(OTextConnectionPageSetup,NULL);
148 m_pTextConnectionHelper = new OTextConnectionHelper( this, TC_EXTENSION | TC_SEPARATORS );
149 m_pTextConnectionHelper->SetClickHandler(LINK( this, OTextConnectionPageSetup, ImplGetExtensionHdl ) );
151 FreeResource();
155 // -----------------------------------------------------------------------
156 OTextConnectionPageSetup::~OTextConnectionPageSetup()
158 DELETEZ(m_pTextConnectionHelper);
160 DBG_DTOR(OTextConnectionPageSetup,NULL);
163 IMPL_LINK(OTextConnectionPageSetup, ImplGetExtensionHdl, OTextConnectionHelper*, /*_pTextConnectionHelper*/)
165 SetRoadmapStateValue((m_pTextConnectionHelper->GetExtension().Len() > 0) && OConnectionTabPageSetup::checkTestConnection());
166 callModifiedHdl();
167 return sal_True;
171 bool OTextConnectionPageSetup::checkTestConnection()
173 bool bDoEnable = OConnectionTabPageSetup::checkTestConnection();
174 bDoEnable = (m_pTextConnectionHelper->GetExtension().Len() > 0) && bDoEnable;
175 return bDoEnable;
178 // -----------------------------------------------------------------------
179 void OTextConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
181 OConnectionTabPageSetup::fillControls(_rControlList);
182 m_pTextConnectionHelper->fillControls(_rControlList);
184 // -----------------------------------------------------------------------
185 void OTextConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
187 OConnectionTabPageSetup::fillWindows(_rControlList);
188 m_pTextConnectionHelper->fillWindows(_rControlList);
190 // -----------------------------------------------------------------------
191 void OTextConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
193 // first check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
194 sal_Bool bValid, bReadonly;
195 getFlags(_rSet, bValid, bReadonly);
196 OConnectionTabPageSetup::implInitControls( _rSet, _bSaveValue);
197 m_pTextConnectionHelper->implInitControls(_rSet, bValid);
201 // -----------------------------------------------------------------------
202 sal_Bool OTextConnectionPageSetup::FillItemSet( SfxItemSet& _rSet )
204 sal_Bool bChangedSomething = OConnectionTabPageSetup::FillItemSet(_rSet);
205 bChangedSomething = m_pTextConnectionHelper->FillItemSet(_rSet, bChangedSomething);
206 return bChangedSomething;
210 sal_Bool OTextConnectionPageSetup::prepareLeave(){
211 return m_pTextConnectionHelper->prepareLeave();
215 OGenericAdministrationPage* OLDAPConnectionPageSetup::CreateLDAPTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
217 return ( new OLDAPConnectionPageSetup( pParent, _rAttrSet ) );
221 //========================================================================
222 //= OLDAPPageSetup
223 //========================================================================
224 OLDAPConnectionPageSetup::OLDAPConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs )
225 :OGenericAdministrationPage(pParent, ModuleRes(PAGE_DBWIZARD_LDAP), _rCoreAttrs)
226 ,m_aFTHeaderText (this, ModuleRes(FT_LDAP_HEADERTEXT))
227 ,m_aFTHelpText (this, ModuleRes(FT_LDAP_HELPTEXT))
228 ,m_aFTHostServer (this, ModuleRes(FT_AUTOHOSTNAME))
229 ,m_aETHostServer (this, ModuleRes(ET_AUTOHOSTNAME))
230 ,m_aFTBaseDN (this, ModuleRes(FT_AUTOBASEDN))
231 ,m_aETBaseDN (this, ModuleRes(ET_AUTOBASEDN))
232 ,m_aFTPortNumber (this, ModuleRes(FT_AUTOPORTNUMBER))
233 ,m_aNFPortNumber (this, ModuleRes(NF_AUTOPORTNUMBER))
234 ,m_aFTDefaultPortNumber (this, ModuleRes(FT_AUTOPORTNUMBERDEFAULT))
235 ,m_aCBUseSSL (this, ModuleRes(CB_WIZ_USESSL))
237 SetControlFontWeight(&m_aFTHeaderText);
238 m_aFTDefaultPortNumber.SetText(String(ModuleRes(STR_LDAP_DEFAULT)));
239 m_aETHostServer.SetModifyHdl(getControlModifiedLink());
240 m_aETBaseDN.SetModifyHdl(getControlModifiedLink());
241 m_aNFPortNumber.SetModifyHdl(getControlModifiedLink());
242 m_aCBUseSSL.SetToggleHdl(getControlModifiedLink());
243 // #98982# OJ
244 m_aNFPortNumber.SetUseThousandSep(sal_False);
245 SetRoadmapStateValue(sal_False);
246 FreeResource();
249 // -----------------------------------------------------------------------
250 /* OGenericAdministrationPage* ODriversSettings::CreateLDAP( Window* pParent, const SfxItemSet& _rAttrSet )
252 return ( new OLDAPConnectionPageSetup( pParent, _rAttrSet ) );
255 // -----------------------------------------------------------------------
256 sal_Bool OLDAPConnectionPageSetup::FillItemSet( SfxItemSet& _rSet )
258 sal_Bool bChangedSomething = sal_False;
259 fillString(_rSet,&m_aETBaseDN,DSID_CONN_LDAP_BASEDN, bChangedSomething);
260 fillInt32(_rSet,&m_aNFPortNumber,DSID_CONN_LDAP_PORTNUMBER,bChangedSomething);
262 if ( m_aETHostServer.GetText() != m_aETHostServer.GetSavedValue() )
264 DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet.GetItem(DSID_TYPECOLLECTION));
265 ::dbaccess::ODsnTypeCollection* pCollection = NULL;
266 if (pCollectionItem)
267 pCollection = pCollectionItem->getCollection();
268 DBG_ASSERT(pCollection, "OLDAPConnectionPageSetup::FillItemSet : really need a DSN type collection !");
270 String sUrl = pCollection->getPrefix( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:ldap:")));
271 sUrl += m_aETHostServer.GetText();
272 _rSet.Put(SfxStringItem(DSID_CONNECTURL, sUrl));
273 bChangedSomething = sal_True;
276 // fillString(_rSet,&m_aETHostServer, DSID_CONNECTURL, bChangedSomething);
277 fillBool(_rSet,&m_aCBUseSSL,DSID_CONN_LDAP_USESSL,bChangedSomething);
278 return bChangedSomething;
280 // -----------------------------------------------------------------------
281 void OLDAPConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
283 _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETHostServer));
284 _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETBaseDN));
285 _rControlList.push_back(new OSaveValueWrapper<NumericField>(&m_aNFPortNumber));
286 _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aCBUseSSL));
288 // -----------------------------------------------------------------------
289 void OLDAPConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
291 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHelpText));
292 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHostServer));
293 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTBaseDN));
294 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTPortNumber));
295 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTDefaultPortNumber));
297 // -----------------------------------------------------------------------
298 void OLDAPConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
300 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
301 sal_Bool bValid, bReadonly;
302 getFlags(_rSet, bValid, bReadonly);
305 SFX_ITEMSET_GET(_rSet, pBaseDN, SfxStringItem, DSID_CONN_LDAP_BASEDN, sal_True);
306 SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, DSID_CONN_LDAP_PORTNUMBER, sal_True);
308 if ( bValid )
310 m_aETBaseDN.SetText(pBaseDN->GetValue());
311 m_aNFPortNumber.SetValue(pPortNumber->GetValue());
313 OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
314 callModifiedHdl();
317 // -----------------------------------------------------------------------
318 IMPL_LINK(OLDAPConnectionPageSetup, OnEditModified, Edit*, /*_pEdit*/)
320 sal_Bool bRoadmapState = ((m_aETHostServer.GetText().Len() != 0 ) && ( m_aETBaseDN.GetText().Len() != 0 ) && (m_aFTPortNumber.GetText().Len() != 0 ));
321 SetRoadmapStateValue(bRoadmapState);
322 callModifiedHdl();
323 return 0L;
327 // ----------------------------------------------------------------------- //OGenericAdministrationPage*
328 OMySQLIntroPageSetup* OMySQLIntroPageSetup::CreateMySQLIntroTabPage( Window* _pParent, const SfxItemSet& _rAttrSet )
330 return ( new OMySQLIntroPageSetup( _pParent, _rAttrSet) );
333 DBG_NAME(OMySQLIntroPageSetup)
335 OMySQLIntroPageSetup::OMySQLIntroPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs )
336 :OGenericAdministrationPage(pParent, ModuleRes(PAGE_DBWIZARD_MYSQL_INTRO), _rCoreAttrs)
337 ,m_aRB_ODBCDatabase(this, ModuleRes(RB_CONNECTVIAODBC))
338 ,m_aRB_JDBCDatabase(this, ModuleRes(RB_CONNECTVIAJDBC))
339 ,m_aRB_NATIVEDatabase(this, ModuleRes(RB_CONNECTVIANATIVE))
340 ,m_aFT_ConnectionMode(this, ModuleRes(FT_MYSQLCONNECTIONMODE))
341 ,m_aFT_Helptext(this, ModuleRes(FT_MYSQL_HELPTEXT))
342 ,m_aFT_Headertext(this, ModuleRes(FT_MYSQL_HEADERTEXT))
344 DBG_CTOR(OMySQLIntroPageSetup,NULL);
346 SetControlFontWeight(&m_aFT_Headertext);
347 m_aRB_JDBCDatabase.SetToggleHdl(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected));
348 m_aRB_NATIVEDatabase.SetToggleHdl(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected));
349 m_aRB_JDBCDatabase.SetState(sal_True);
350 FreeResource();
353 IMPL_LINK(OMySQLIntroPageSetup, OnSetupModeSelected, RadioButton*, /*_pBox*/)
355 maClickHdl.Call( this );
356 return true;
359 // -----------------------------------------------------------------------
360 OMySQLIntroPageSetup::~OMySQLIntroPageSetup()
363 DBG_DTOR(OMySQLIntroPageSetup,NULL);
367 // -----------------------------------------------------------------------
368 void OMySQLIntroPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool /*_bSaveValue*/)
370 DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet.GetItem(DSID_TYPECOLLECTION));
371 if (pCollectionItem)
373 ::dbaccess::ODsnTypeCollection* pCollection = pCollectionItem->getCollection();
374 if ( pCollection->getPrefix(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:mysql:mysqlc:"))).Len() )
376 m_aRB_NATIVEDatabase.Show();
377 m_aRB_JDBCDatabase.SetState(sal_False);
378 m_aRB_NATIVEDatabase.SetState(sal_True);
384 // -----------------------------------------------------------------------
385 void OMySQLIntroPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& /*_rControlList*/)
389 // -----------------------------------------------------------------------
390 void OMySQLIntroPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlList*/)
395 // -----------------------------------------------------------------------
396 BOOL OMySQLIntroPageSetup::FillItemSet(SfxItemSet& /*_rSet*/)
398 OSL_ENSURE(sal_False,"Who called me?! Please ask oj for more information.");
399 return sal_True;
403 OMySQLIntroPageSetup::ConnectionType OMySQLIntroPageSetup::getMySQLMode()
405 if (m_aRB_JDBCDatabase.IsChecked())
406 return VIA_JDBC;
407 else if (m_aRB_NATIVEDatabase.IsChecked())
408 return VIA_NATIVE;
409 else
410 return VIA_ODBC;
414 // -----------------------------------------------------------------------
415 OGenericAdministrationPage* OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
417 return ( new OGeneralSpecialJDBCConnectionPageSetup( pParent,
418 PAGE_DBWIZARD_MYSQL_JDBC,
419 _rAttrSet,
420 DSID_MYSQL_PORTNUMBER ,
421 STR_MYSQL_DEFAULT,
422 STR_MYSQLJDBC_HELPTEXT,
423 STR_MYSQLJDBC_HEADERTEXT,
424 STR_MYSQL_DRIVERCLASSTEXT) );
427 // -----------------------------------------------------------------------
428 OGenericAdministrationPage* OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLNATIVETabPage( Window* pParent, const SfxItemSet& _rAttrSet )
430 return ( new OGeneralSpecialJDBCConnectionPageSetup( pParent,
431 PAGE_DBWIZARD_MYSQL_NATIVE,
432 _rAttrSet,
433 DSID_MYSQL_PORTNUMBER ,
434 STR_MYSQL_DEFAULT,
435 STR_MYSQLJDBC_HELPTEXT,
436 STR_MYSQLJDBC_HEADERTEXT,
437 0) );
441 // -----------------------------------------------------------------------
442 OGenericAdministrationPage* OGeneralSpecialJDBCConnectionPageSetup::CreateOracleJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
444 return ( new OGeneralSpecialJDBCConnectionPageSetup( pParent,
445 PAGE_DBWIZARD_ORACLE,
446 _rAttrSet,
447 DSID_ORACLE_PORTNUMBER,
448 STR_ORACLE_DEFAULT,
449 STR_ORACLE_HELPTEXT,
450 STR_ORACLE_HEADERTEXT,
451 STR_ORACLE_DRIVERCLASSTEXT) );
455 //========================================================================
456 //= OMySQLJDBCConnectionPageSetup
457 //========================================================================
458 OGeneralSpecialJDBCConnectionPageSetup::OGeneralSpecialJDBCConnectionPageSetup( Window* pParent,USHORT _nResId, const SfxItemSet& _rCoreAttrs ,USHORT _nPortId, USHORT _nDefaultPortResId, USHORT _nHelpTextResId, USHORT _nHeaderTextResId, USHORT _nDriverClassId)
459 :OGenericAdministrationPage(pParent, ModuleRes(_nResId), _rCoreAttrs)
460 ,m_pFTHeaderText (NULL)
461 ,m_aFTHelpText (this, ModuleRes(FT_AUTOWIZARDHELPTEXT))
462 ,m_aFTDatabasename (this, ModuleRes(FT_AUTODATABASENAME))
463 ,m_aETDatabasename (this, ModuleRes(ET_AUTODATABASENAME))
464 ,m_aFTHostname (this, ModuleRes(FT_AUTOHOSTNAME))
465 ,m_aETHostname (this, ModuleRes(ET_AUTOHOSTNAME))
466 ,m_aFTPortNumber (this, ModuleRes(FT_AUTOPORTNUMBER))
467 ,m_aFTDefaultPortNumber (this, ModuleRes(FT_AUTOPORTNUMBERDEFAULT))
468 ,m_aNFPortNumber (this, ModuleRes(NF_AUTOPORTNUMBER))
469 ,m_aFTSocket (this, ModuleRes(FT_SOCKET))
470 ,m_aETSocket (this, ModuleRes(ET_SOCKET))
471 ,m_aFTDriverClass (this, ModuleRes(FT_AUTOJDBCDRIVERCLASS))
472 ,m_aETDriverClass (this, ModuleRes(ET_AUTOJDBCDRIVERCLASS))
473 ,m_aPBTestJavaDriver (this, ModuleRes(PB_AUTOTESTDRIVERCLASS))
474 ,m_nPortId(_nPortId)
475 ,m_bUseClass(true)
477 if ( _nDriverClassId )
478 m_aFTDriverClass.SetText(String(ModuleRes(_nDriverClassId)));
479 else
481 m_bUseClass = false;
482 m_aFTDriverClass.Show(FALSE);
483 m_aPBTestJavaDriver.Show(FALSE);
484 m_aETDriverClass.Show(FALSE);
487 m_aFTSocket.Show(_nResId == PAGE_DBWIZARD_MYSQL_NATIVE && !m_bUseClass);
488 m_aETSocket.Show(_nResId == PAGE_DBWIZARD_MYSQL_NATIVE && !m_bUseClass);
490 m_aFTDefaultPortNumber.SetText(String(ModuleRes(_nDefaultPortResId)));
491 String sHelpText = String(ModuleRes(_nHelpTextResId));
492 m_aFTHelpText.SetText(sHelpText);
493 //TODO this code snippet is redundant
494 SetHeaderText(FT_AUTOWIZARDHEADER, _nHeaderTextResId);
496 m_aETDatabasename.SetModifyHdl(getControlModifiedLink());
497 m_aETHostname.SetModifyHdl(getControlModifiedLink());
498 m_aNFPortNumber.SetModifyHdl(getControlModifiedLink());
499 m_aETSocket.SetModifyHdl(getControlModifiedLink());
501 if ( m_bUseClass )
503 m_aETDriverClass.SetModifyHdl(LINK(this, OGeneralSpecialJDBCConnectionPageSetup, OnEditModified));
504 m_aPBTestJavaDriver.SetClickHdl(LINK(this,OGeneralSpecialJDBCConnectionPageSetup,OnTestJavaClickHdl));
507 m_aNFPortNumber.SetUseThousandSep(sal_False);
508 if ( m_bUseClass )
510 SFX_ITEMSET_GET(_rCoreAttrs, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True);
511 SFX_ITEMSET_GET(_rCoreAttrs, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True);
512 ::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL;
513 if (pTypeCollection && pUrlItem && pUrlItem->GetValue().Len() )
515 m_sDefaultJdbcDriverName = pTypeCollection->getJavaDriverClass(pUrlItem->GetValue());
518 SetRoadmapStateValue(sal_False);
519 FreeResource();
523 // -----------------------------------------------------------------------
524 void OGeneralSpecialJDBCConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
526 _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETDatabasename));
527 _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETDriverClass));
528 _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETHostname));
529 _rControlList.push_back(new OSaveValueWrapper<NumericField>(&m_aNFPortNumber));
530 _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETSocket));
532 // -----------------------------------------------------------------------
533 void OGeneralSpecialJDBCConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
535 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHelpText));
536 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTDatabasename));
537 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHostname));
538 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTPortNumber));
539 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTDefaultPortNumber));
540 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTSocket));
541 if ( m_bUseClass )
542 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTDriverClass));
545 // -----------------------------------------------------------------------
546 sal_Bool OGeneralSpecialJDBCConnectionPageSetup::FillItemSet( SfxItemSet& _rSet )
548 sal_Bool bChangedSomething = sal_False;
549 if ( m_bUseClass )
550 fillString(_rSet,&m_aETDriverClass,DSID_JDBCDRIVERCLASS,bChangedSomething);
551 fillString(_rSet,&m_aETHostname,DSID_CONN_HOSTNAME,bChangedSomething);
552 fillString(_rSet,&m_aETDatabasename,DSID_DATABASENAME,bChangedSomething);
553 fillInt32(_rSet,&m_aNFPortNumber,m_nPortId,bChangedSomething );
554 fillString(_rSet,&m_aETSocket,DSID_CONN_SOCKET,bChangedSomething);
555 return bChangedSomething;
558 // -----------------------------------------------------------------------
559 void OGeneralSpecialJDBCConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
561 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
562 sal_Bool bValid, bReadonly;
563 getFlags(_rSet, bValid, bReadonly);
565 const SfxStringItem *pDrvItem = NULL;
566 if ( m_bUseClass )
567 pDrvItem = (const SfxStringItem*) (_rSet).GetItem( DSID_JDBCDRIVERCLASS, sal_True, TYPE(SfxStringItem) );
569 SFX_ITEMSET_GET(_rSet, pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True);
570 SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, m_nPortId, sal_True);
571 SFX_ITEMSET_GET(_rSet, pSocket, SfxStringItem, DSID_CONN_SOCKET, sal_True);
573 if ( bValid )
575 if ( m_bUseClass )
577 m_aETDriverClass.SetText(pDrvItem->GetValue());
578 m_aETDriverClass.ClearModifyFlag();
581 m_aETHostname.SetText(pHostName->GetValue());
582 m_aETHostname.ClearModifyFlag();
584 m_aNFPortNumber.SetValue(pPortNumber->GetValue());
585 m_aNFPortNumber.ClearModifyFlag();
587 m_aETSocket.SetText(pSocket->GetValue());
588 m_aETSocket.ClearModifyFlag();
590 OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
592 // to get the correct value when saveValue was called by base class
593 if ( m_bUseClass && !m_aETDriverClass.GetText().Len() )
595 m_aETDriverClass.SetText(m_sDefaultJdbcDriverName);
596 m_aETDriverClass.SetModifyFlag();
598 callModifiedHdl();
600 sal_Bool bRoadmapState = ((m_aETDatabasename.GetText().Len() != 0 ) && ( m_aETHostname.GetText().Len() != 0 ) && (m_aNFPortNumber.GetText().Len() != 0 ) && ( !m_bUseClass || m_aETDriverClass.GetText().Len() != 0 ));
601 SetRoadmapStateValue(bRoadmapState);
604 // -----------------------------------------------------------------------
605 IMPL_LINK(OGeneralSpecialJDBCConnectionPageSetup, OnTestJavaClickHdl, PushButton*, /*_pButton*/)
607 OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
608 OSL_ENSURE(m_bUseClass,"Who called this one?");
610 sal_Bool bSuccess = sal_False;
613 if ( m_aETDriverClass.GetText().Len() )
615 // TODO chage jvmaccess
616 ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM(m_pAdminDialog->getORB());
617 bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aETDriverClass.GetText());
620 catch(::com::sun::star::uno::Exception&)
624 USHORT nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
625 OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String() );
626 aMsg.Execute();
627 return 0L;
630 // -----------------------------------------------------------------------
631 IMPL_LINK(OGeneralSpecialJDBCConnectionPageSetup, OnEditModified, Edit*, _pEdit)
633 if ( m_bUseClass && _pEdit == &m_aETDriverClass )
634 m_aPBTestJavaDriver.Enable( m_aETDriverClass.GetText().Len() != 0 );
635 sal_Bool bRoadmapState = ((m_aETDatabasename.GetText().Len() != 0 ) && ( m_aETHostname.GetText().Len() != 0 ) && (m_aNFPortNumber.GetText().Len() != 0 ) && ( !m_bUseClass || m_aETDriverClass.GetText().Len() != 0 ));
636 SetRoadmapStateValue(bRoadmapState);
637 callModifiedHdl();
638 return 0L;
642 // -----------------------------------------------------------------------
643 OGenericAdministrationPage* OJDBCConnectionPageSetup::CreateJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
645 return ( new OJDBCConnectionPageSetup( pParent, _rAttrSet));
649 //========================================================================
650 //= OMySQLJDBCConnectionPageSetup
651 //========================================================================
652 OJDBCConnectionPageSetup::OJDBCConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs)
653 :OConnectionTabPageSetup(pParent, PAGE_DBWIZARD_JDBC, _rCoreAttrs, STR_JDBC_HELPTEXT, STR_JDBC_HEADERTEXT, STR_COMMONURL)
654 ,m_aFTDriverClass (this, ModuleRes(FT_AUTOJDBCDRIVERCLASS))
655 ,m_aETDriverClass (this, ModuleRes(ET_AUTOJDBCDRIVERCLASS))
656 ,m_aPBTestJavaDriver (this, ModuleRes(PB_AUTOTESTDRIVERCLASS))
658 m_aETDriverClass.SetModifyHdl(LINK(this, OJDBCConnectionPageSetup, OnEditModified));
659 m_aPBTestJavaDriver.SetClickHdl(LINK(this,OJDBCConnectionPageSetup,OnTestJavaClickHdl));
660 FreeResource();
663 // -----------------------------------------------------------------------
664 void OJDBCConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
666 _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETDriverClass));
669 // -----------------------------------------------------------------------
670 void OJDBCConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
672 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTDriverClass));
675 // -----------------------------------------------------------------------
676 sal_Bool OJDBCConnectionPageSetup::FillItemSet( SfxItemSet& _rSet )
678 sal_Bool bChangedSomething = OConnectionTabPageSetup::FillItemSet(_rSet);
679 fillString(_rSet,&m_aETDriverClass,DSID_JDBCDRIVERCLASS,bChangedSomething);
680 return bChangedSomething;
683 // -----------------------------------------------------------------------
684 void OJDBCConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
686 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
687 sal_Bool bValid, bReadonly;
688 getFlags(_rSet, bValid, bReadonly);
690 SFX_ITEMSET_GET(_rSet, pDrvItem, SfxStringItem, DSID_JDBCDRIVERCLASS, sal_True);
692 if ( bValid )
694 if ( !pDrvItem->GetValue().Len() )
696 String sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType);
697 if ( sDefaultJdbcDriverName.Len() )
699 m_aETDriverClass.SetText(sDefaultJdbcDriverName);
700 m_aETDriverClass.SetModifyFlag();
701 } // if ( sDefaultJdbcDriverName.Len() )
702 } // if ( !pJdbcDrvItem->GetValue().Len() )
703 else
705 m_aETDriverClass.SetText(pDrvItem->GetValue());
706 m_aETDriverClass.ClearModifyFlag();
709 sal_Bool bEnable = pDrvItem->GetValue().Len() != 0;
710 m_aPBTestJavaDriver.Enable(bEnable);
711 OConnectionTabPageSetup::implInitControls(_rSet, _bSaveValue);
713 SetRoadmapStateValue(checkTestConnection());
717 bool OJDBCConnectionPageSetup::checkTestConnection()
719 OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
720 BOOL bEnableTestConnection = !m_aConnectionURL.IsVisible() || (m_aConnectionURL.GetTextNoPrefix().Len() != 0);
721 bEnableTestConnection = bEnableTestConnection && (m_aETDriverClass.GetText().Len() != 0);
722 return bEnableTestConnection;
723 // m_aTestConnection.Enable(bEnableTestConnection);
727 // -----------------------------------------------------------------------
728 IMPL_LINK(OJDBCConnectionPageSetup, OnTestJavaClickHdl, PushButton*, /*_pButton*/)
730 OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
731 sal_Bool bSuccess = sal_False;
734 if ( m_aETDriverClass.GetText().Len() )
736 // TODO chage jvmaccess
737 ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM(m_pAdminDialog->getORB());
738 bSuccess = xJVM.is() && ::connectivity::existsJavaClassByName(xJVM,m_aETDriverClass.GetText());
741 catch(::com::sun::star::uno::Exception&)
745 USHORT nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
746 OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String() );
747 aMsg.Execute();
748 return 0L;
751 // -----------------------------------------------------------------------
752 IMPL_LINK(OJDBCConnectionPageSetup, OnEditModified, Edit*, _pEdit)
754 if ( _pEdit == &m_aETDriverClass )
755 m_aPBTestJavaDriver.Enable( m_aETDriverClass.GetText().Len() != 0 );
756 SetRoadmapStateValue(checkTestConnection());
757 // tell the listener we were modified
758 callModifiedHdl();
759 return 0L;
763 OGenericAdministrationPage* OSpreadSheetConnectionPageSetup::CreateSpreadSheetTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
765 return ( new OSpreadSheetConnectionPageSetup( pParent, _rAttrSet ) );
768 DBG_NAME(OSpreadSheetConnectionPageSetup)
770 OSpreadSheetConnectionPageSetup::OSpreadSheetConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs )
771 :OConnectionTabPageSetup(pParent, PAGE_DBWIZARD_SPREADSHEET, _rCoreAttrs, STR_SPREADSHEET_HELPTEXT, STR_SPREADSHEET_HEADERTEXT, STR_SPREADSHEETPATH)
772 , m_aCBPasswordrequired(this, ModuleRes(CB_SPREADSHEETPASSWORDREQUIRED))
774 DBG_CTOR(OSpreadSheetConnectionPageSetup,NULL);
776 m_aCBPasswordrequired.SetToggleHdl(getControlModifiedLink());
777 FreeResource();
781 // -----------------------------------------------------------------------
782 OSpreadSheetConnectionPageSetup::~OSpreadSheetConnectionPageSetup()
785 DBG_DTOR(OSpreadSheetConnectionPageSetup,NULL);
789 void OSpreadSheetConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlList*/)
793 // -----------------------------------------------------------------------
794 void OSpreadSheetConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
796 OConnectionTabPageSetup::fillControls(_rControlList);
797 _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aCBPasswordrequired));
801 // -----------------------------------------------------------------------
802 void OSpreadSheetConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
804 OConnectionTabPageSetup::implInitControls(_rSet, _bSaveValue);
807 // -----------------------------------------------------------------------
808 sal_Bool OSpreadSheetConnectionPageSetup::FillItemSet( SfxItemSet& _rSet )
810 sal_Bool bChangedSomething = OConnectionTabPageSetup::FillItemSet(_rSet);
811 fillBool(_rSet,&m_aCBPasswordrequired,DSID_PASSWORDREQUIRED,bChangedSomething);
812 return bChangedSomething;
815 OGenericAdministrationPage* OAuthentificationPageSetup::CreateAuthentificationTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
817 return ( new OAuthentificationPageSetup( pParent, _rAttrSet) );
820 DBG_NAME(OAuthentificationPageSetup)
822 OAuthentificationPageSetup::OAuthentificationPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs )
823 :OGenericAdministrationPage(pParent, ModuleRes(PAGE_DBWIZARD_AUTHENTIFICATION), _rCoreAttrs )
824 , m_aFTHelpText (this, ModuleRes(FT_AUTHENTIFICATIONHELPTEXT))
825 , m_aFTHeaderText (this, ModuleRes(FT_AUTHENTIFICATIONHEADERTEXT))
826 , m_aFTUserName (this, ModuleRes(FT_GENERALUSERNAME))
827 , m_aETUserName (this, ModuleRes(ET_GENERALUSERNAME))
828 , m_aCBPasswordRequired (this, ModuleRes(CB_GENERALPASSWORDREQUIRED))
829 , m_aPBTestConnection (this, ModuleRes(PB_TESTCONNECTION))
831 DBG_CTOR(OAuthentificationPageSetup,NULL);
833 SetControlFontWeight(&m_aFTHeaderText);
834 m_aETUserName.SetModifyHdl(getControlModifiedLink());
835 m_aCBPasswordRequired.SetClickHdl(getControlModifiedLink());
836 m_aPBTestConnection.SetClickHdl(LINK(this,OGenericAdministrationPage,OnTestConnectionClickHdl));
837 FreeResource();
841 // -----------------------------------------------------------------------
842 OAuthentificationPageSetup::~OAuthentificationPageSetup()
845 DBG_DTOR(OAuthentificationPageSetup,NULL);
849 void OAuthentificationPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
851 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHelpText));
852 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTUserName));
853 _rControlList.push_back(new ODisableWrapper<PushButton>(&m_aPBTestConnection));
856 // -----------------------------------------------------------------------
857 void OAuthentificationPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
859 _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETUserName));
860 _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aCBPasswordRequired));
863 // -----------------------------------------------------------------------
864 void OAuthentificationPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool /*_bSaveValue*/)
866 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
867 sal_Bool bValid, bReadonly;
868 getFlags(_rSet, bValid, bReadonly);
869 SFX_ITEMSET_GET(_rSet, pUidItem, SfxStringItem, DSID_USER, sal_True);
870 SFX_ITEMSET_GET(_rSet, pAllowEmptyPwd, SfxBoolItem, DSID_PASSWORDREQUIRED, sal_True);
872 m_aETUserName.SetText(pUidItem->GetValue());
873 m_aCBPasswordRequired.Check(pAllowEmptyPwd->GetValue());
875 m_aETUserName.ClearModifyFlag();
878 // -----------------------------------------------------------------------
879 sal_Bool OAuthentificationPageSetup::FillItemSet( SfxItemSet& _rSet )
881 sal_Bool bChangedSomething = sal_False;
883 if (m_aETUserName.GetText() != m_aETUserName.GetSavedValue())
885 _rSet.Put(SfxStringItem(DSID_USER, m_aETUserName.GetText()));
886 _rSet.Put(SfxStringItem(DSID_PASSWORD, String()));
887 bChangedSomething = sal_True;
889 fillBool(_rSet,&m_aCBPasswordRequired,DSID_PASSWORDREQUIRED,bChangedSomething);
890 return bChangedSomething;
894 OGenericAdministrationPage* OFinalDBPageSetup::CreateFinalDBTabPageSetup( Window* pParent, const SfxItemSet& _rAttrSet)
896 return ( new OFinalDBPageSetup( pParent, _rAttrSet) );
899 DBG_NAME(OFinalDBPageSetup)
901 OFinalDBPageSetup::OFinalDBPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs )
902 :OGenericAdministrationPage(pParent, ModuleRes(PAGE_DBWIZARD_FINAL), _rCoreAttrs )
903 , m_aFTFinalHeader (this, ModuleRes(FT_FINALHEADER))
904 , m_aFTFinalHelpText (this, ModuleRes(FT_FINALHELPTEXT))
905 , m_aRBRegisterDataSource (this, ModuleRes(RB_REGISTERDATASOURCE))
906 , m_aRBDontregisterDataSource (this, ModuleRes(RB_DONTREGISTERDATASOURCE))
907 , m_aFTAdditionalSettings (this, ModuleRes(FT_ADDITIONALSETTINGS))
908 , m_aCBOpenAfterwards (this, ModuleRes(CB_OPENAFTERWARDS))
909 , m_aCBStartTableWizard (this, ModuleRes(CB_STARTTABLEWIZARD))
910 , m_aFTFinalText (this, ModuleRes(FT_FINALTEXT))
912 DBG_CTOR(OFinalDBPageSetup,NULL);
914 String stext = m_aFTFinalHeader.GetText();
915 SetControlFontWeight(&m_aFTFinalHeader);
916 m_aCBOpenAfterwards.SetClickHdl(LINK(this, OFinalDBPageSetup, OnOpenSelected));
917 m_aCBStartTableWizard.SetClickHdl(getControlModifiedLink());
918 m_aRBRegisterDataSource.SetState(sal_True);
919 FreeResource();
921 sal_Int32 nUnrelatedHeight = LogicToPixel( Size( 0, UNRELATED_CONTROLS ), MAP_APPFONT ).Height();
922 sal_Int32 nRelatedHeight = LogicToPixel( Size( 0, RELATED_CONTROLS ), MAP_APPFONT ).Height();
924 ::std::pair<Window*,sal_Int32> pWindows[] = {
925 ::std::pair<Window*,sal_Int32>(&m_aFTFinalHelpText,nRelatedHeight)
926 ,::std::pair<Window*,sal_Int32>(&m_aRBRegisterDataSource,nRelatedHeight)
927 ,::std::pair<Window*,sal_Int32>(&m_aRBDontregisterDataSource,nUnrelatedHeight)
928 ,::std::pair<Window*,sal_Int32>(&m_aFTAdditionalSettings,nRelatedHeight)
929 ,::std::pair<Window*,sal_Int32>(&m_aCBOpenAfterwards,nRelatedHeight)
930 ,::std::pair<Window*,sal_Int32>(&m_aCBStartTableWizard,nUnrelatedHeight)
931 ,::std::pair<Window*,sal_Int32>(&m_aFTFinalText,nUnrelatedHeight)
934 Point aPos(m_aFTFinalHeader.GetPosPixel());
935 Size aStart(m_aFTFinalHeader.GetSizePixel());
936 aPos.Y() += aStart.Height() + nUnrelatedHeight;
937 sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
938 for (sal_Int32 i=0; i < nCount; ++i)
940 aPos.X() = pWindows[i].first->GetPosPixel().X();
941 Size aSize = pWindows[i].first->GetSizePixel();
942 FixedText* pText = dynamic_cast<FixedText*>(pWindows[i].first);
943 CheckBox* pCheck = dynamic_cast<CheckBox*>(pWindows[i].first);
944 RadioButton* pRadio = dynamic_cast<RadioButton*>(pWindows[i].first);
945 if ( pText )
946 aSize = pText->CalcMinimumSize(aSize.Width());
947 else if ( pRadio )
948 aSize = pRadio->CalcMinimumSize(aSize.Width());
949 else if ( pCheck )
950 aSize = pCheck->CalcMinimumSize(aSize.Width());
951 pWindows[i].first->SetPosSizePixel(aPos,aSize);
952 aPos.Y() += aSize.Height() + pWindows[i].second;
957 // -----------------------------------------------------------------------
958 OFinalDBPageSetup::~OFinalDBPageSetup()
961 DBG_DTOR(OFinalDBPageSetup,NULL);
964 sal_Bool OFinalDBPageSetup::IsDatabaseDocumentToBeRegistered()
966 return m_aRBRegisterDataSource.IsChecked() && m_aRBRegisterDataSource.IsEnabled();
969 sal_Bool OFinalDBPageSetup::IsDatabaseDocumentToBeOpened()
971 return m_aCBOpenAfterwards.IsChecked() && m_aCBOpenAfterwards.IsEnabled();
974 sal_Bool OFinalDBPageSetup::IsTableWizardToBeStarted()
976 return m_aCBStartTableWizard.IsChecked() && m_aCBStartTableWizard.IsEnabled();
980 void OFinalDBPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
982 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTFinalHeader));
983 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTFinalHelpText));
984 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTAdditionalSettings));
985 _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTFinalText));
988 // -----------------------------------------------------------------------
989 void OFinalDBPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
991 _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aCBOpenAfterwards));
992 _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aCBStartTableWizard));
993 _rControlList.push_back(new OSaveValueWrapper<RadioButton>(&m_aRBRegisterDataSource));
994 _rControlList.push_back(new OSaveValueWrapper<RadioButton>(&m_aRBDontregisterDataSource));
997 // -----------------------------------------------------------------------
998 void OFinalDBPageSetup::implInitControls(const SfxItemSet& /*_rSet*/, sal_Bool /*_bSaveValue*/)
1000 m_aCBOpenAfterwards.Check();
1003 void OFinalDBPageSetup::enableTableWizardCheckBox( sal_Bool _bSupportsTableCreation)
1005 m_aCBStartTableWizard.Enable(_bSupportsTableCreation);
1008 // -----------------------------------------------------------------------
1009 sal_Bool OFinalDBPageSetup::FillItemSet( SfxItemSet& /*_rSet*/ )
1011 return sal_True;
1013 // -----------------------------------------------------------------------------
1014 IMPL_LINK(OFinalDBPageSetup, OnOpenSelected, CheckBox*, _pBox)
1016 m_aCBStartTableWizard.Enable( _pBox->IsEnabled() && _pBox->IsChecked() );
1017 callModifiedHdl();
1018 // outta here
1019 return 0L;
1021 //.........................................................................
1023 // namespace dbaui
1024 //.........................................................................