Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / dbaccess / source / ui / dlg / advancedsettings.cxx
blobe2dc5c889c9d1bd3bee48098b2596f865f7a566c
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 "advancedsettings.hxx"
31 #include "advancedsettingsdlg.hxx"
32 #include "moduledbu.hxx"
33 #include "dsitems.hxx"
34 #include "DbAdminImpl.hxx"
35 #include "DriverSettings.hxx"
36 #include "optionalboolitem.hxx"
37 #include "dbu_resource.hrc"
38 #include "dbu_dlg.hrc"
39 #include "dbadmin.hrc"
40 #include "advancedsettings.hrc"
42 /** === begin UNO includes === **/
43 /** === end UNO includes === **/
45 #include <svl/eitem.hxx>
46 #include <svl/intitem.hxx>
47 #include <svl/stritem.hxx>
49 #include <vcl/msgbox.hxx>
51 //........................................................................
52 namespace dbaui
54 //........................................................................
56 /** === begin UNO using === **/
57 using ::com::sun::star::uno::Reference;
58 using ::com::sun::star::lang::XMultiServiceFactory;
59 using ::com::sun::star::uno::Any;
60 using ::com::sun::star::beans::XPropertySet;
61 using ::com::sun::star::sdbc::XConnection;
62 using ::com::sun::star::sdbc::XDriver;
63 /** === end UNO using === **/
65 //========================================================================
66 //= SpecialSettingsPage
67 //========================================================================
68 struct BooleanSettingDesc
70 CheckBox** ppControl; // the dialog's control which displays this setting
71 sal_uInt16 nControlResId; // the resource ID to load the control from
72 sal_uInt16 nItemId; // the ID of the item (in an SfxItemSet) which corresponds to this setting
73 bool bInvertedDisplay; // true if and only if the checkbox is checked when the item is sal_False, and vice versa
76 //========================================================================
77 //= SpecialSettingsPage
78 //========================================================================
79 SpecialSettingsPage::SpecialSettingsPage( Window* pParent, const SfxItemSet& _rCoreAttrs, const DataSourceMetaData& _rDSMeta )
80 :OGenericAdministrationPage( pParent, ModuleRes( PAGE_ADVANCED_SETTINGS_SPECIAL ), _rCoreAttrs )
81 ,m_aTopLine( this, ModuleRes( FL_DATAHANDLING ) )
82 ,m_pIsSQL92Check( NULL )
83 ,m_pAppendTableAlias( NULL )
84 ,m_pAsBeforeCorrelationName( NULL )
85 ,m_pEnableOuterJoin( NULL )
86 ,m_pIgnoreDriverPrivileges( NULL )
87 ,m_pParameterSubstitution( NULL )
88 ,m_pSuppressVersionColumn( NULL )
89 ,m_pCatalog( NULL )
90 ,m_pSchema( NULL )
91 ,m_pIndexAppendix( NULL )
92 ,m_pDosLineEnds( NULL )
93 ,m_pCheckRequiredFields( NULL )
94 ,m_pIgnoreCurrency(NULL)
95 ,m_pEscapeDateTime(NULL)
96 ,m_pPrimaryKeySupport(NULL)
97 ,m_pRespectDriverResultSetType(NULL)
98 ,m_pBooleanComparisonModeLabel( NULL )
99 ,m_pBooleanComparisonMode( NULL )
100 ,m_pMaxRowScanLabel( NULL )
101 ,m_pMaxRowScan( NULL )
102 ,m_aControlDependencies()
103 ,m_aBooleanSettings()
104 ,m_bHasBooleanComparisonMode( _rDSMeta.getFeatureSet().has( DSID_BOOLEANCOMPARISON ) )
105 ,m_bHasMaxRowScan( _rDSMeta.getFeatureSet().has( DSID_MAX_ROW_SCAN ) )
107 impl_initBooleanSettings();
109 const FeatureSet& rFeatures( _rDSMeta.getFeatureSet() );
110 // create all the check boxes for the boolean settings
111 for ( BooleanSettingDescs::const_iterator setting = m_aBooleanSettings.begin();
112 setting != m_aBooleanSettings.end();
113 ++setting
116 sal_uInt16 nItemId = setting->nItemId;
117 if ( rFeatures.has( nItemId ) )
119 sal_uInt16 nResourceId = setting->nControlResId;
120 (*setting->ppControl) = new CheckBox( this, ModuleRes( nResourceId ) );
121 (*setting->ppControl)->SetClickHdl( getControlModifiedLink() );
123 // check whether this must be a tristate check box
124 const SfxPoolItem& rItem = _rCoreAttrs.Get( nItemId );
125 if ( rItem.ISA( OptionalBoolItem ) )
126 (*setting->ppControl)->EnableTriState( sal_True );
130 if ( m_pAsBeforeCorrelationName && m_pAppendTableAlias )
131 // make m_pAsBeforeCorrelationName depend on m_pAppendTableAlias
132 m_aControlDependencies.enableOnCheckMark( *m_pAppendTableAlias, *m_pAsBeforeCorrelationName );
134 // move the controls to the appropriate positions
135 Point aPos( m_aTopLine.GetPosPixel() );
136 aPos.Move( 0, m_aTopLine.GetSizePixel().Height() );
137 Size aFirstDistance( LogicToPixel( Size( INDENTED_X, RELATED_CONTROLS ), MAP_APPFONT ) );
138 aPos.Move( aFirstDistance.Width(), aFirstDistance.Height() );
140 Size aUnrelatedControls( LogicToPixel( Size( RELATED_CONTROLS, RELATED_CONTROLS ), MAP_APPFONT ) );
142 for ( BooleanSettingDescs::const_iterator setting = m_aBooleanSettings.begin();
143 setting != m_aBooleanSettings.end();
144 ++setting
147 if ( !*setting->ppControl )
148 continue;
150 (*setting->ppControl)->SetPosPixel( aPos );
151 aPos.Move( 0, (*setting->ppControl)->GetSizePixel().Height() );
152 aPos.Move( 0, aUnrelatedControls.Height() );
155 // create the controls for the boolean comparison mode
156 if ( m_bHasBooleanComparisonMode )
158 m_pBooleanComparisonModeLabel = new FixedText( this, ModuleRes( FT_BOOLEANCOMPARISON ) );
159 m_pBooleanComparisonMode = new ListBox( this, ModuleRes( LB_BOOLEANCOMPARISON ) );
160 m_pBooleanComparisonMode->SetDropDownLineCount( 4 );
161 m_pBooleanComparisonMode->SetSelectHdl( getControlModifiedLink() );
163 Point aLabelPos( m_pBooleanComparisonModeLabel->GetPosPixel() );
164 Point aControlPos( m_pBooleanComparisonMode->GetPosPixel() );
165 long nMoveUp = aControlPos.Y() - aPos.Y();
167 m_pBooleanComparisonModeLabel->SetPosPixel( Point( aLabelPos.X(), aLabelPos.Y() - nMoveUp ) );
168 m_pBooleanComparisonMode->SetPosPixel( Point( aControlPos.X(), aControlPos.Y() - nMoveUp ) );
170 // create the controls for the max row scan
171 if ( m_bHasMaxRowScan )
173 m_pMaxRowScanLabel = new FixedText( this, ModuleRes( FT_MAXROWSCAN ) );
174 m_pMaxRowScan = new NumericField( this, ModuleRes( NF_MAXROWSCAN ) );
175 m_pMaxRowScan->SetModifyHdl(getControlModifiedLink());
176 m_pMaxRowScan->SetUseThousandSep(sal_False);
178 Point aLabelPos( m_pMaxRowScanLabel->GetPosPixel() );
179 Point aControlPos( m_pMaxRowScan->GetPosPixel() );
180 long nMoveUp = aControlPos.Y() - aPos.Y();
182 m_pMaxRowScanLabel->SetPosPixel( Point( aLabelPos.X(), aLabelPos.Y() - nMoveUp ) );
183 m_pMaxRowScan->SetPosPixel( Point( aControlPos.X(), aControlPos.Y() - nMoveUp ) );
186 FreeResource();
189 // -----------------------------------------------------------------------
190 SpecialSettingsPage::~SpecialSettingsPage()
192 m_aControlDependencies.clear();
194 DELETEZ( m_pIsSQL92Check );
195 DELETEZ( m_pAppendTableAlias );
196 DELETEZ( m_pAsBeforeCorrelationName );
197 DELETEZ( m_pParameterSubstitution );
198 DELETEZ( m_pIgnoreDriverPrivileges );
199 DELETEZ( m_pSuppressVersionColumn );
200 DELETEZ( m_pEnableOuterJoin );
201 DELETEZ( m_pCatalog );
202 DELETEZ( m_pSchema );
203 DELETEZ( m_pIndexAppendix );
204 DELETEZ( m_pDosLineEnds );
205 DELETEZ( m_pCheckRequiredFields );
206 DELETEZ( m_pIgnoreCurrency );
207 DELETEZ( m_pEscapeDateTime );
208 DELETEZ( m_pPrimaryKeySupport );
209 DELETEZ( m_pRespectDriverResultSetType );
210 DELETEZ( m_pBooleanComparisonModeLabel );
211 DELETEZ( m_pBooleanComparisonMode );
212 DELETEZ( m_pMaxRowScanLabel );
213 DELETEZ( m_pMaxRowScan );
216 // -----------------------------------------------------------------------
217 void SpecialSettingsPage::impl_initBooleanSettings()
219 OSL_PRECOND( m_aBooleanSettings.empty(), "SpecialSettingsPage::impl_initBooleanSettings: called twice!" );
221 // for easier maintainance, write the table in this form, then copy it to m_aBooleanSettings
222 BooleanSettingDesc aSettings[] = {
223 { &m_pIsSQL92Check, CB_SQL92CHECK, DSID_SQL92CHECK, false },
224 { &m_pAppendTableAlias, CB_APPENDTABLEALIAS, DSID_APPEND_TABLE_ALIAS, false },
225 { &m_pAsBeforeCorrelationName, CB_AS_BEFORE_CORR_NAME, DSID_AS_BEFORE_CORRNAME, false },
226 { &m_pEnableOuterJoin, CB_ENABLEOUTERJOIN, DSID_ENABLEOUTERJOIN, false },
227 { &m_pIgnoreDriverPrivileges, CB_IGNOREDRIVER_PRIV, DSID_IGNOREDRIVER_PRIV, false },
228 { &m_pParameterSubstitution, CB_PARAMETERNAMESUBST, DSID_PARAMETERNAMESUBST, false },
229 { &m_pSuppressVersionColumn, CB_SUPPRESVERSIONCL, DSID_SUPPRESSVERSIONCL, true },
230 { &m_pCatalog, CB_CATALOG, DSID_CATALOG, false },
231 { &m_pSchema, CB_SCHEMA, DSID_SCHEMA, false },
232 { &m_pIndexAppendix, CB_IGNOREINDEXAPPENDIX, DSID_INDEXAPPENDIX, false },
233 { &m_pDosLineEnds, CB_DOSLINEENDS, DSID_DOSLINEENDS, false },
234 { &m_pCheckRequiredFields, CB_CHECK_REQUIRED, DSID_CHECK_REQUIRED_FIELDS, false },
235 { &m_pIgnoreCurrency, CB_IGNORECURRENCY, DSID_IGNORECURRENCY, false },
236 { &m_pEscapeDateTime, CB_ESCAPE_DATETIME, DSID_ESCAPE_DATETIME, false },
237 { &m_pPrimaryKeySupport, CB_PRIMARY_KEY_SUPPORT, DSID_PRIMARY_KEY_SUPPORT, false },
238 { &m_pRespectDriverResultSetType, CB_RESPECTRESULTSETTYPE,DSID_RESPECTRESULTSETTYPE, false },
239 { NULL, 0, 0, false }
242 for ( const BooleanSettingDesc* pCopy = aSettings; pCopy->nItemId != 0; ++pCopy )
244 m_aBooleanSettings.push_back( *pCopy );
248 // -----------------------------------------------------------------------
249 void SpecialSettingsPage::fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList )
251 if ( m_bHasBooleanComparisonMode )
253 _rControlList.push_back( new ODisableWrapper< FixedText >( m_pBooleanComparisonModeLabel ) );
255 if ( m_bHasMaxRowScan )
257 _rControlList.push_back( new ODisableWrapper< FixedText >( m_pMaxRowScanLabel ) );
261 // -----------------------------------------------------------------------
262 void SpecialSettingsPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
264 for ( BooleanSettingDescs::const_iterator setting = m_aBooleanSettings.begin();
265 setting != m_aBooleanSettings.end();
266 ++setting
269 if ( *setting->ppControl )
271 _rControlList.push_back( new OSaveValueWrapper< CheckBox >( *setting->ppControl ) );
275 if ( m_bHasBooleanComparisonMode )
276 _rControlList.push_back( new OSaveValueWrapper< ListBox >( m_pBooleanComparisonMode ) );
277 if ( m_bHasMaxRowScan )
278 _rControlList.push_back(new OSaveValueWrapper<NumericField>(m_pMaxRowScan));
281 // -----------------------------------------------------------------------
282 void SpecialSettingsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
284 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
285 sal_Bool bValid, bReadonly;
286 getFlags( _rSet, bValid, bReadonly );
288 if ( !bValid )
290 OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
291 return;
294 // the boolean items
295 for ( BooleanSettingDescs::const_iterator setting = m_aBooleanSettings.begin();
296 setting != m_aBooleanSettings.end();
297 ++setting
300 if ( !*setting->ppControl )
301 continue;
303 ::boost::optional< bool > aValue(false);
304 aValue.reset();
306 SFX_ITEMSET_GET( _rSet, pItem, SfxPoolItem, setting->nItemId, sal_True );
307 if ( pItem->ISA( SfxBoolItem ) )
309 aValue.reset( PTR_CAST( SfxBoolItem, pItem )->GetValue() );
311 else if ( pItem->ISA( OptionalBoolItem ) )
313 aValue = PTR_CAST( OptionalBoolItem, pItem )->GetFullValue();
315 else
316 OSL_FAIL( "SpecialSettingsPage::implInitControls: unknown boolean item type!" );
318 if ( !aValue )
320 (*setting->ppControl)->SetState( STATE_DONTKNOW );
322 else
324 bool bValue = *aValue;
325 if ( setting->bInvertedDisplay )
326 bValue = !bValue;
327 (*setting->ppControl)->Check( bValue );
331 // the non-boolean items
332 if ( m_bHasBooleanComparisonMode )
334 SFX_ITEMSET_GET( _rSet, pBooleanComparison, SfxInt32Item, DSID_BOOLEANCOMPARISON, sal_True );
335 m_pBooleanComparisonMode->SelectEntryPos( static_cast< sal_uInt16 >( pBooleanComparison->GetValue() ) );
338 if ( m_bHasMaxRowScan )
340 SFX_ITEMSET_GET(_rSet, pMaxRowScan, SfxInt32Item, DSID_MAX_ROW_SCAN, sal_True);
341 m_pMaxRowScan->SetValue(pMaxRowScan->GetValue());
344 OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
347 // -----------------------------------------------------------------------
348 sal_Bool SpecialSettingsPage::FillItemSet( SfxItemSet& _rSet )
350 sal_Bool bChangedSomething = sal_False;
352 // the boolean items
353 for ( BooleanSettingDescs::const_iterator setting = m_aBooleanSettings.begin();
354 setting != m_aBooleanSettings.end();
355 ++setting
358 if ( !*setting->ppControl )
359 continue;
360 fillBool( _rSet, *setting->ppControl, setting->nItemId, bChangedSomething, setting->bInvertedDisplay );
363 // the non-boolean items
364 if ( m_bHasBooleanComparisonMode )
366 if ( m_pBooleanComparisonMode->GetSelectEntryPos() != m_pBooleanComparisonMode->GetSavedValue() )
368 _rSet.Put( SfxInt32Item( DSID_BOOLEANCOMPARISON, m_pBooleanComparisonMode->GetSelectEntryPos() ) );
369 bChangedSomething = sal_True;
372 if ( m_bHasMaxRowScan )
374 fillInt32(_rSet,m_pMaxRowScan,DSID_MAX_ROW_SCAN,bChangedSomething);
376 return bChangedSomething;
379 //========================================================================
380 //= GeneratedValuesPage
381 //========================================================================
382 //------------------------------------------------------------------------
383 GeneratedValuesPage::GeneratedValuesPage( Window* pParent, const SfxItemSet& _rCoreAttrs )
384 :OGenericAdministrationPage(pParent, ModuleRes( PAGE_GENERATED_VALUES ), _rCoreAttrs)
385 ,m_aAutoFixedLine ( this, ModuleRes( FL_SEPARATORAUTO ) )
386 ,m_aAutoRetrievingEnabled( this, ModuleRes( CB_RETRIEVE_AUTO ) )
387 ,m_aAutoIncrementLabel ( this, ModuleRes( FT_AUTOINCREMENTVALUE ) )
388 ,m_aAutoIncrement ( this, ModuleRes( ET_AUTOINCREMENTVALUE ) )
389 ,m_aAutoRetrievingLabel ( this, ModuleRes( FT_RETRIEVE_AUTO ) )
390 ,m_aAutoRetrieving ( this, ModuleRes( ET_RETRIEVE_AUTO ) )
392 m_aAutoRetrievingEnabled.SetClickHdl( getControlModifiedLink() );
393 m_aAutoIncrement.SetModifyHdl( getControlModifiedLink() );
394 m_aAutoRetrieving.SetModifyHdl( getControlModifiedLink() );
396 m_aControlDependencies.enableOnCheckMark( m_aAutoRetrievingEnabled,
397 m_aAutoIncrementLabel, m_aAutoIncrement, m_aAutoRetrievingLabel, m_aAutoRetrieving );
399 FreeResource();
402 // -----------------------------------------------------------------------
403 GeneratedValuesPage::~GeneratedValuesPage()
405 m_aControlDependencies.clear();
408 // -----------------------------------------------------------------------
409 void GeneratedValuesPage::fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList )
411 _rControlList.push_back( new ODisableWrapper< FixedLine >( &m_aAutoFixedLine ) );
412 _rControlList.push_back( new ODisableWrapper< FixedText >( &m_aAutoIncrementLabel ) );
413 _rControlList.push_back( new ODisableWrapper< FixedText >( &m_aAutoRetrievingLabel ) );
416 // -----------------------------------------------------------------------
417 void GeneratedValuesPage::fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList )
419 _rControlList.push_back( new OSaveValueWrapper< CheckBox >( &m_aAutoRetrievingEnabled ) );
420 _rControlList.push_back( new OSaveValueWrapper< Edit >( &m_aAutoIncrement ) );
421 _rControlList.push_back( new OSaveValueWrapper< Edit >( &m_aAutoRetrieving ) );
424 // -----------------------------------------------------------------------
425 void GeneratedValuesPage::implInitControls( const SfxItemSet& _rSet, sal_Bool _bSaveValue )
427 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
428 sal_Bool bValid, bReadonly;
429 getFlags(_rSet, bValid, bReadonly);
431 // collect the items
432 SFX_ITEMSET_GET(_rSet, pAutoIncrementItem, SfxStringItem, DSID_AUTOINCREMENTVALUE, sal_True);
433 SFX_ITEMSET_GET(_rSet, pAutoRetrieveValueItem, SfxStringItem, DSID_AUTORETRIEVEVALUE, sal_True);
434 SFX_ITEMSET_GET(_rSet, pAutoRetrieveEnabledItem, SfxBoolItem, DSID_AUTORETRIEVEENABLED, sal_True);
436 // forward the values to the controls
437 if (bValid)
439 sal_Bool bEnabled = pAutoRetrieveEnabledItem->GetValue();
440 m_aAutoRetrievingEnabled.Check( bEnabled );
442 m_aAutoIncrement.SetText( pAutoIncrementItem->GetValue() );
443 m_aAutoIncrement.ClearModifyFlag();
444 m_aAutoRetrieving.SetText( pAutoRetrieveValueItem->GetValue() );
445 m_aAutoRetrieving.ClearModifyFlag();
447 OGenericAdministrationPage::implInitControls( _rSet, _bSaveValue );
450 // -----------------------------------------------------------------------
451 sal_Bool GeneratedValuesPage::FillItemSet(SfxItemSet& _rSet)
453 sal_Bool bChangedSomething = sal_False;
455 fillString( _rSet, &m_aAutoIncrement, DSID_AUTOINCREMENTVALUE, bChangedSomething );
456 fillBool( _rSet, &m_aAutoRetrievingEnabled, DSID_AUTORETRIEVEENABLED, bChangedSomething );
457 fillString( _rSet, &m_aAutoRetrieving, DSID_AUTORETRIEVEVALUE, bChangedSomething );
459 return bChangedSomething;
462 //========================================================================
463 //= AdvancedSettingsDialog
464 //========================================================================
465 //------------------------------------------------------------------------
466 AdvancedSettingsDialog::AdvancedSettingsDialog( Window* _pParent, SfxItemSet* _pItems,
467 const Reference< XMultiServiceFactory >& _rxORB, const Any& _aDataSourceName )
468 :SfxTabDialog(_pParent, ModuleRes(DLG_DATABASE_ADVANCED), _pItems)
469 ,m_pItemSet(_pItems)
471 m_pImpl = ::std::auto_ptr<ODbDataSourceAdministrationHelper>(new ODbDataSourceAdministrationHelper(_rxORB,_pParent,this));
472 m_pImpl->setDataSourceOrName(_aDataSourceName);
473 Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
474 m_pImpl->translateProperties(xDatasource, *_pItems);
475 SetInputSet(_pItems);
476 // propagate this set as our new input set and reset the example set
477 delete pExampleSet;
478 pExampleSet = new SfxItemSet(*GetInputSetImpl());
480 const ::rtl::OUString eType = m_pImpl->getDatasourceType(*_pItems);
482 DataSourceMetaData aMeta( eType );
483 const FeatureSet& rFeatures( aMeta.getFeatureSet() );
485 // auto-generated values?
486 if ( rFeatures.supportsGeneratedValues() )
487 AddTabPage( PAGE_GENERATED_VALUES, String( ModuleRes( STR_GENERATED_VALUE ) ), ODriversSettings::CreateGeneratedValuesPage, NULL );
489 // any "special settings"?
490 if ( rFeatures.supportsAnySpecialSetting() )
491 AddTabPage( PAGE_ADVANCED_SETTINGS_SPECIAL, String( ModuleRes( STR_DS_BEHAVIOUR ) ), ODriversSettings::CreateSpecialSettingsPage, NULL );
493 // remove the reset button - it's meaning is much too ambiguous in this dialog
494 RemoveResetButton();
495 FreeResource();
498 // -----------------------------------------------------------------------
499 AdvancedSettingsDialog::~AdvancedSettingsDialog()
501 SetInputSet(NULL);
502 DELETEZ(pExampleSet);
505 // -----------------------------------------------------------------------
506 bool AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( const ::rtl::OUString& _sURL )
508 DataSourceMetaData aMeta( _sURL );
509 const FeatureSet& rFeatures( aMeta.getFeatureSet() );
510 if ( rFeatures.supportsGeneratedValues() || rFeatures.supportsAnySpecialSetting() )
511 return true;
512 return false;
515 // -----------------------------------------------------------------------
516 short AdvancedSettingsDialog::Execute()
518 short nRet = SfxTabDialog::Execute();
519 if ( nRet == RET_OK )
521 pExampleSet->Put(*GetOutputItemSet());
522 m_pImpl->saveChanges(*pExampleSet);
524 return nRet;
527 //-------------------------------------------------------------------------
528 void AdvancedSettingsDialog::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage)
530 // register ourself as modified listener
531 static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory(m_pImpl->getORB());
532 static_cast<OGenericAdministrationPage&>(_rPage).SetAdminDialog(this,this);
534 AdjustLayout();
535 Window *pWin = GetViewWindow();
536 if(pWin)
537 pWin->Invalidate();
539 SfxTabDialog::PageCreated(_nId, _rPage);
542 // -----------------------------------------------------------------------------
543 const SfxItemSet* AdvancedSettingsDialog::getOutputSet() const
545 return pExampleSet;
548 // -----------------------------------------------------------------------------
549 SfxItemSet* AdvancedSettingsDialog::getWriteOutputSet()
551 return pExampleSet;
554 // -----------------------------------------------------------------------------
555 ::std::pair< Reference< XConnection >, sal_Bool > AdvancedSettingsDialog::createConnection()
557 return m_pImpl->createConnection();
560 // -----------------------------------------------------------------------------
561 Reference< XMultiServiceFactory > AdvancedSettingsDialog::getORB() const
563 return m_pImpl->getORB();
566 // -----------------------------------------------------------------------------
567 Reference< XDriver > AdvancedSettingsDialog::getDriver()
569 return m_pImpl->getDriver();
572 // -----------------------------------------------------------------------------
573 ::rtl::OUString AdvancedSettingsDialog::getDatasourceType(const SfxItemSet& _rSet) const
575 return m_pImpl->getDatasourceType(_rSet);
578 // -----------------------------------------------------------------------------
579 void AdvancedSettingsDialog::clearPassword()
581 m_pImpl->clearPassword();
584 // -----------------------------------------------------------------------------
585 void AdvancedSettingsDialog::setTitle(const ::rtl::OUString& _sTitle)
587 SetText(_sTitle);
590 //-------------------------------------------------------------------------
591 void AdvancedSettingsDialog::enableConfirmSettings( bool _bEnable )
593 (void)_bEnable;
596 //-------------------------------------------------------------------------
597 sal_Bool AdvancedSettingsDialog::saveDatasource()
599 return PrepareLeaveCurrentPage();
602 //........................................................................
603 } // namespace dbaui
604 //........................................................................
606 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */