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 1096de5490SAndrew Rist * 1196de5490SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 1296de5490SAndrew Rist * 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. 1996de5490SAndrew Rist * 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 #include "detailpages.hxx" 28cdf0e10cSrcweir #include "sqlmessage.hxx" 29cdf0e10cSrcweir #include "dsmeta.hxx" 30cdf0e10cSrcweir #include "advancedsettings.hxx" 31cdf0e10cSrcweir #include "DbAdminImpl.hxx" 32cdf0e10cSrcweir #include "dsitems.hxx" 33cdf0e10cSrcweir #include "dbfindex.hxx" 34cdf0e10cSrcweir #include "localresaccess.hxx" 35cdf0e10cSrcweir #include "dsnItem.hxx" 36cdf0e10cSrcweir 37cdf0e10cSrcweir #include "dbaccess_helpid.hrc" 38cdf0e10cSrcweir #include "dbu_dlg.hrc" 39cdf0e10cSrcweir #include "dbadmin.hrc" 40cdf0e10cSrcweir 41cdf0e10cSrcweir #ifndef _SFXITEMSET_HXX 42cdf0e10cSrcweir #include <svl/itemset.hxx> 43cdf0e10cSrcweir #endif 44cdf0e10cSrcweir #ifndef _SFXSTRITEM_HXX 45cdf0e10cSrcweir #include <svl/stritem.hxx> 46cdf0e10cSrcweir #endif 47cdf0e10cSrcweir #ifndef _SFXENUMITEM_HXX 48cdf0e10cSrcweir #include <svl/eitem.hxx> 49cdf0e10cSrcweir #endif 50cdf0e10cSrcweir #ifndef _SFXINTITEM_HXX 51cdf0e10cSrcweir #include <svl/intitem.hxx> 52cdf0e10cSrcweir #endif 53cdf0e10cSrcweir #ifndef _SV_MSGBOX_HXX 54cdf0e10cSrcweir #include <vcl/msgbox.hxx> 55cdf0e10cSrcweir #endif 56cdf0e10cSrcweir #ifndef _SV_MNEMONIC_HXX 57cdf0e10cSrcweir #include <vcl/mnemonic.hxx> 58cdf0e10cSrcweir #endif 59cdf0e10cSrcweir #ifndef _SVTOOLS_CJKOPTIONS_HXX 60cdf0e10cSrcweir #include <svl/cjkoptions.hxx> 61cdf0e10cSrcweir #endif 62cdf0e10cSrcweir #include <jvmaccess/virtualmachine.hxx> 63cdf0e10cSrcweir #ifndef DBAUI_ADABASPAGE_HRC 64cdf0e10cSrcweir #include "AdabasPage.hrc" 65cdf0e10cSrcweir #endif 66cdf0e10cSrcweir #ifndef _DBAUI_ADASTAT_HXX_ 67cdf0e10cSrcweir #include "AdabasStat.hxx" 68cdf0e10cSrcweir #endif 69cdf0e10cSrcweir #ifndef _CONNECTIVITY_COMMONTOOLS_HXX_ 70cdf0e10cSrcweir #include <connectivity/CommonTools.hxx> 71cdf0e10cSrcweir #endif 72cdf0e10cSrcweir #ifndef DBAUI_DRIVERSETTINGS_HXX 73cdf0e10cSrcweir #include "DriverSettings.hxx" 74cdf0e10cSrcweir #endif 75cdf0e10cSrcweir #ifndef _DBAUI_DBADMIN_HXX_ 76cdf0e10cSrcweir #include "dbadmin.hxx" 77cdf0e10cSrcweir #endif 78cdf0e10cSrcweir #ifndef _COMPHELPER_TYPES_HXX_ 79cdf0e10cSrcweir #include <comphelper/types.hxx> 80cdf0e10cSrcweir #endif 81*b63233d8Sdamjan #include "AutoControlsDef.hrc" 82cdf0e10cSrcweir 83cdf0e10cSrcweir //......................................................................... 84cdf0e10cSrcweir namespace dbaui 85cdf0e10cSrcweir { 86cdf0e10cSrcweir //......................................................................... 87cdf0e10cSrcweir 88cdf0e10cSrcweir using namespace ::com::sun::star::uno; 89cdf0e10cSrcweir using namespace ::com::sun::star::sdbc; 90cdf0e10cSrcweir using namespace ::com::sun::star::beans; 91cdf0e10cSrcweir using namespace ::com::sun::star::lang; 92cdf0e10cSrcweir using namespace ::com::sun::star::container; 93cdf0e10cSrcweir using namespace ::dbtools; 94cdf0e10cSrcweir 95cdf0e10cSrcweir //======================================================================== 96cdf0e10cSrcweir //= OCommonBehaviourTabPage 97cdf0e10cSrcweir //======================================================================== DBG_NAME(OCommonBehaviourTabPage)98cdf0e10cSrcweir DBG_NAME(OCommonBehaviourTabPage) 99cdf0e10cSrcweir //------------------------------------------------------------------------ 100cdf0e10cSrcweir OCommonBehaviourTabPage::OCommonBehaviourTabPage(Window* pParent, sal_uInt16 nResId, const SfxItemSet& _rCoreAttrs, 101cdf0e10cSrcweir sal_uInt32 nControlFlags,bool _bFreeResource) 102cdf0e10cSrcweir 103cdf0e10cSrcweir :OGenericAdministrationPage(pParent, ModuleRes(nResId), _rCoreAttrs) 104cdf0e10cSrcweir ,m_pOptionsLabel(NULL) 105cdf0e10cSrcweir ,m_pOptions(NULL) 106cdf0e10cSrcweir ,m_pDataConvertFixedLine(NULL) 107cdf0e10cSrcweir ,m_pCharsetLabel(NULL) 108cdf0e10cSrcweir ,m_pCharset(NULL) 109cdf0e10cSrcweir ,m_pAutoFixedLine(NULL) 110cdf0e10cSrcweir ,m_pAutoRetrievingEnabled(NULL) 111cdf0e10cSrcweir ,m_pAutoIncrementLabel(NULL) 112cdf0e10cSrcweir ,m_pAutoIncrement(NULL) 113cdf0e10cSrcweir ,m_pAutoRetrievingLabel(NULL) 114cdf0e10cSrcweir ,m_pAutoRetrieving(NULL) 115cdf0e10cSrcweir ,m_nControlFlags(nControlFlags) 116cdf0e10cSrcweir { 117cdf0e10cSrcweir DBG_CTOR(OCommonBehaviourTabPage,NULL); 118cdf0e10cSrcweir 119cdf0e10cSrcweir if ((m_nControlFlags & CBTP_USE_OPTIONS) == CBTP_USE_OPTIONS) 120cdf0e10cSrcweir { 121cdf0e10cSrcweir m_pOptionsLabel = new FixedText(this, ModuleRes(FT_OPTIONS)); 122cdf0e10cSrcweir m_pOptions = new Edit(this, ModuleRes(ET_OPTIONS)); 123cdf0e10cSrcweir m_pOptions->SetModifyHdl(getControlModifiedLink()); 124cdf0e10cSrcweir } 125cdf0e10cSrcweir 126cdf0e10cSrcweir if ((m_nControlFlags & CBTP_USE_CHARSET) == CBTP_USE_CHARSET) 127cdf0e10cSrcweir { 128cdf0e10cSrcweir m_pDataConvertFixedLine = new FixedLine(this, ModuleRes(FL_DATACONVERT)); 129cdf0e10cSrcweir m_pCharsetLabel = new FixedText(this, ModuleRes(FT_CHARSET)); 130cdf0e10cSrcweir m_pCharset = new CharSetListBox(this, ModuleRes(LB_CHARSET)); 131cdf0e10cSrcweir m_pCharset->SetSelectHdl(getControlModifiedLink()); 132cdf0e10cSrcweir } 133cdf0e10cSrcweir 134cdf0e10cSrcweir Window* pWindows[] = { m_pAutoRetrievingEnabled, m_pAutoFixedLine, 135cdf0e10cSrcweir m_pAutoIncrementLabel, m_pAutoIncrement, 136cdf0e10cSrcweir m_pAutoRetrievingLabel, m_pAutoRetrieving }; 137cdf0e10cSrcweir 138cdf0e10cSrcweir sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]); 139cdf0e10cSrcweir for (sal_Int32 i=1; i < nCount; ++i) 140cdf0e10cSrcweir { 141cdf0e10cSrcweir if ( pWindows[i] ) 142cdf0e10cSrcweir { 143cdf0e10cSrcweir Window* pPrev = pWindows[i-1]; 144cdf0e10cSrcweir for (sal_Int32 j = i-1; pPrev == NULL && j >= 0 ; --j) 145cdf0e10cSrcweir { 146cdf0e10cSrcweir pPrev = pWindows[j]; 147cdf0e10cSrcweir } 148cdf0e10cSrcweir if ( pPrev ) 149cdf0e10cSrcweir pWindows[i]->SetZOrder(pPrev, WINDOW_ZORDER_BEHIND); 150cdf0e10cSrcweir } 151cdf0e10cSrcweir } 152cdf0e10cSrcweir 153cdf0e10cSrcweir if ( _bFreeResource ) 154cdf0e10cSrcweir FreeResource(); 155cdf0e10cSrcweir } 156cdf0e10cSrcweir 157cdf0e10cSrcweir // ----------------------------------------------------------------------- ~OCommonBehaviourTabPage()158cdf0e10cSrcweir OCommonBehaviourTabPage::~OCommonBehaviourTabPage() 159cdf0e10cSrcweir { 160cdf0e10cSrcweir DELETEZ(m_pOptionsLabel); 161cdf0e10cSrcweir DELETEZ(m_pOptions); 162cdf0e10cSrcweir 163cdf0e10cSrcweir DELETEZ(m_pDataConvertFixedLine); 164cdf0e10cSrcweir DELETEZ(m_pCharsetLabel); 165cdf0e10cSrcweir DELETEZ(m_pCharset); 166cdf0e10cSrcweir 167cdf0e10cSrcweir DELETEZ(m_pAutoFixedLine); 168cdf0e10cSrcweir DELETEZ(m_pAutoIncrementLabel); 169cdf0e10cSrcweir DELETEZ(m_pAutoIncrement); 170cdf0e10cSrcweir 171cdf0e10cSrcweir DELETEZ(m_pAutoRetrievingEnabled); 172cdf0e10cSrcweir DELETEZ(m_pAutoRetrievingLabel); 173cdf0e10cSrcweir DELETEZ(m_pAutoRetrieving); 174cdf0e10cSrcweir 175cdf0e10cSrcweir DBG_DTOR(OCommonBehaviourTabPage,NULL); 176cdf0e10cSrcweir } 177cdf0e10cSrcweir 178cdf0e10cSrcweir // ----------------------------------------------------------------------- fillWindows(::std::vector<ISaveValueWrapper * > & _rControlList)179cdf0e10cSrcweir void OCommonBehaviourTabPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) 180cdf0e10cSrcweir { 181cdf0e10cSrcweir if ((m_nControlFlags & CBTP_USE_OPTIONS) == CBTP_USE_OPTIONS) 182cdf0e10cSrcweir { 183cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(m_pOptionsLabel)); 184cdf0e10cSrcweir } 185cdf0e10cSrcweir 186cdf0e10cSrcweir if ((m_nControlFlags & CBTP_USE_CHARSET) == CBTP_USE_CHARSET) 187cdf0e10cSrcweir { 188cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedLine>(m_pDataConvertFixedLine)); 189cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(m_pCharsetLabel)); 190cdf0e10cSrcweir } 191cdf0e10cSrcweir } 192cdf0e10cSrcweir // ----------------------------------------------------------------------- fillControls(::std::vector<ISaveValueWrapper * > & _rControlList)193cdf0e10cSrcweir void OCommonBehaviourTabPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) 194cdf0e10cSrcweir { 195cdf0e10cSrcweir if ((m_nControlFlags & CBTP_USE_OPTIONS) == CBTP_USE_OPTIONS) 196cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pOptions)); 197cdf0e10cSrcweir 198cdf0e10cSrcweir if ((m_nControlFlags & CBTP_USE_CHARSET) == CBTP_USE_CHARSET) 199cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<ListBox>(m_pCharset)); 200cdf0e10cSrcweir } 201cdf0e10cSrcweir 202cdf0e10cSrcweir // ----------------------------------------------------------------------- implInitControls(const SfxItemSet & _rSet,sal_Bool _bSaveValue)203cdf0e10cSrcweir void OCommonBehaviourTabPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) 204cdf0e10cSrcweir { 205cdf0e10cSrcweir // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) 206cdf0e10cSrcweir sal_Bool bValid, bReadonly; 207cdf0e10cSrcweir getFlags(_rSet, bValid, bReadonly); 208cdf0e10cSrcweir 209cdf0e10cSrcweir // collect the items 210cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pOptionsItem, SfxStringItem, DSID_ADDITIONALOPTIONS, sal_True); 211cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pCharsetItem, SfxStringItem, DSID_CHARSET, sal_True); 212cdf0e10cSrcweir 213cdf0e10cSrcweir // forward the values to the controls 214cdf0e10cSrcweir if (bValid) 215cdf0e10cSrcweir { 216cdf0e10cSrcweir if ((m_nControlFlags & CBTP_USE_OPTIONS) == CBTP_USE_OPTIONS) 217cdf0e10cSrcweir { 218cdf0e10cSrcweir m_pOptions->SetText(pOptionsItem->GetValue()); 219cdf0e10cSrcweir m_pOptions->ClearModifyFlag(); 220cdf0e10cSrcweir } 221cdf0e10cSrcweir 222cdf0e10cSrcweir if ((m_nControlFlags & CBTP_USE_CHARSET) == CBTP_USE_CHARSET) 223cdf0e10cSrcweir { 224cdf0e10cSrcweir m_pCharset->SelectEntryByIanaName( pCharsetItem->GetValue() ); 225cdf0e10cSrcweir } 226cdf0e10cSrcweir } 227cdf0e10cSrcweir OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue); 228cdf0e10cSrcweir } 229cdf0e10cSrcweir // ----------------------------------------------------------------------- FillItemSet(SfxItemSet & _rSet)230cdf0e10cSrcweir sal_Bool OCommonBehaviourTabPage::FillItemSet(SfxItemSet& _rSet) 231cdf0e10cSrcweir { 232cdf0e10cSrcweir sal_Bool bChangedSomething = sal_False; 233cdf0e10cSrcweir 234cdf0e10cSrcweir if ((m_nControlFlags & CBTP_USE_OPTIONS) == CBTP_USE_OPTIONS) 235cdf0e10cSrcweir { 236cdf0e10cSrcweir fillString(_rSet,m_pOptions,DSID_ADDITIONALOPTIONS,bChangedSomething); 237cdf0e10cSrcweir } 238cdf0e10cSrcweir 239cdf0e10cSrcweir if ((m_nControlFlags & CBTP_USE_CHARSET) == CBTP_USE_CHARSET) 240cdf0e10cSrcweir { 241cdf0e10cSrcweir if ( m_pCharset->StoreSelectedCharSet( _rSet, DSID_CHARSET ) ) 242cdf0e10cSrcweir bChangedSomething = sal_True; 243cdf0e10cSrcweir } 244cdf0e10cSrcweir 245cdf0e10cSrcweir return bChangedSomething; 246cdf0e10cSrcweir } 247cdf0e10cSrcweir 248cdf0e10cSrcweir //======================================================================== 249cdf0e10cSrcweir //= ODbaseDetailsPage 250cdf0e10cSrcweir //======================================================================== DBG_NAME(ODbaseDetailsPage)251cdf0e10cSrcweir DBG_NAME(ODbaseDetailsPage) 252cdf0e10cSrcweir //------------------------------------------------------------------------ 253cdf0e10cSrcweir ODbaseDetailsPage::ODbaseDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ) 254cdf0e10cSrcweir :OCommonBehaviourTabPage(pParent, PAGE_DBASE, _rCoreAttrs, CBTP_USE_CHARSET ,false) 255cdf0e10cSrcweir ,m_aShowDeleted (this, ModuleRes(CB_SHOWDELETEDROWS)) 256cdf0e10cSrcweir ,m_aFL_1 (this, ModuleRes( FL_SEPARATOR1) ) 257cdf0e10cSrcweir ,m_aFT_Message (this, ModuleRes( FT_SPECIAL_MESSAGE) ) 258cdf0e10cSrcweir ,m_aIndexes (this, ModuleRes(PB_INDICIES)) 259cdf0e10cSrcweir { 260cdf0e10cSrcweir DBG_CTOR(ODbaseDetailsPage,NULL); 261cdf0e10cSrcweir 262cdf0e10cSrcweir m_aIndexes.SetClickHdl(LINK(this, ODbaseDetailsPage, OnButtonClicked)); 263cdf0e10cSrcweir m_aShowDeleted.SetClickHdl(LINK(this, ODbaseDetailsPage, OnButtonClicked)); 264cdf0e10cSrcweir 265cdf0e10cSrcweir // correct the z-order which is mixed-up because the base class constructed some controls before we did 266cdf0e10cSrcweir m_pCharset->SetZOrder(&m_aShowDeleted, WINDOW_ZORDER_BEFOR); 267cdf0e10cSrcweir 268cdf0e10cSrcweir FreeResource(); 269cdf0e10cSrcweir } 270cdf0e10cSrcweir 271cdf0e10cSrcweir // ----------------------------------------------------------------------- ~ODbaseDetailsPage()272cdf0e10cSrcweir ODbaseDetailsPage::~ODbaseDetailsPage() 273cdf0e10cSrcweir { 274cdf0e10cSrcweir 275cdf0e10cSrcweir DBG_DTOR(ODbaseDetailsPage,NULL); 276cdf0e10cSrcweir } 277cdf0e10cSrcweir 278cdf0e10cSrcweir // ----------------------------------------------------------------------- CreateDbase(Window * pParent,const SfxItemSet & _rAttrSet)279cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateDbase( Window* pParent, const SfxItemSet& _rAttrSet ) 280cdf0e10cSrcweir { 281cdf0e10cSrcweir return ( new ODbaseDetailsPage( pParent, _rAttrSet ) ); 282cdf0e10cSrcweir } 283cdf0e10cSrcweir 284cdf0e10cSrcweir // ----------------------------------------------------------------------- fillControls(::std::vector<ISaveValueWrapper * > & _rControlList)285cdf0e10cSrcweir void ODbaseDetailsPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) 286cdf0e10cSrcweir { 287cdf0e10cSrcweir OCommonBehaviourTabPage::fillControls(_rControlList); 288cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aShowDeleted)); 289cdf0e10cSrcweir } 290cdf0e10cSrcweir // ----------------------------------------------------------------------- fillWindows(::std::vector<ISaveValueWrapper * > & _rControlList)291cdf0e10cSrcweir void ODbaseDetailsPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) 292cdf0e10cSrcweir { 293cdf0e10cSrcweir OCommonBehaviourTabPage::fillWindows(_rControlList); 294cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedLine>(&m_aFL_1)); 295cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFT_Message)); 296cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<PushButton>(&m_aIndexes)); 297cdf0e10cSrcweir } 298cdf0e10cSrcweir // ----------------------------------------------------------------------- implInitControls(const SfxItemSet & _rSet,sal_Bool _bSaveValue)299cdf0e10cSrcweir void ODbaseDetailsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) 300cdf0e10cSrcweir { 301cdf0e10cSrcweir // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) 302cdf0e10cSrcweir sal_Bool bValid, bReadonly; 303cdf0e10cSrcweir getFlags(_rSet, bValid, bReadonly); 304cdf0e10cSrcweir 305cdf0e10cSrcweir // get the DSN string (needed for the index dialog) 306cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); 307cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); 308cdf0e10cSrcweir ::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL; 309cdf0e10cSrcweir if (pTypeCollection && pUrlItem && pUrlItem->GetValue().Len()) 310cdf0e10cSrcweir m_sDsn = pTypeCollection->cutPrefix(pUrlItem->GetValue()); 311cdf0e10cSrcweir 312cdf0e10cSrcweir // get the other relevant items 313cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pDeletedItem, SfxBoolItem, DSID_SHOWDELETEDROWS, sal_True); 314cdf0e10cSrcweir 315cdf0e10cSrcweir if ( bValid ) 316cdf0e10cSrcweir { 317cdf0e10cSrcweir m_aShowDeleted.Check( pDeletedItem->GetValue() ); 318cdf0e10cSrcweir m_aFT_Message.Show(m_aShowDeleted.IsChecked()); 319cdf0e10cSrcweir } 320cdf0e10cSrcweir 321cdf0e10cSrcweir OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); 322cdf0e10cSrcweir } 323cdf0e10cSrcweir 324cdf0e10cSrcweir // ----------------------------------------------------------------------- FillItemSet(SfxItemSet & _rSet)325cdf0e10cSrcweir sal_Bool ODbaseDetailsPage::FillItemSet( SfxItemSet& _rSet ) 326cdf0e10cSrcweir { 327cdf0e10cSrcweir sal_Bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet); 328cdf0e10cSrcweir 329cdf0e10cSrcweir fillBool(_rSet,&m_aShowDeleted,DSID_SHOWDELETEDROWS,bChangedSomething); 330cdf0e10cSrcweir return bChangedSomething; 331cdf0e10cSrcweir } 332cdf0e10cSrcweir 333cdf0e10cSrcweir //------------------------------------------------------------------------ IMPL_LINK(ODbaseDetailsPage,OnButtonClicked,Button *,pButton)334cdf0e10cSrcweir IMPL_LINK( ODbaseDetailsPage, OnButtonClicked, Button*, pButton ) 335cdf0e10cSrcweir { 336cdf0e10cSrcweir if (&m_aIndexes == pButton) 337cdf0e10cSrcweir { 338cdf0e10cSrcweir ODbaseIndexDialog aIndexDialog(this, m_sDsn); 339cdf0e10cSrcweir aIndexDialog.Execute(); 340cdf0e10cSrcweir } 341cdf0e10cSrcweir else 342cdf0e10cSrcweir { 343cdf0e10cSrcweir m_aFT_Message.Show(m_aShowDeleted.IsChecked()); 344cdf0e10cSrcweir // it was one of the checkboxes -> we count as modified from now on 345cdf0e10cSrcweir callModifiedHdl(); 346cdf0e10cSrcweir } 347cdf0e10cSrcweir 348cdf0e10cSrcweir return 0; 349cdf0e10cSrcweir } 350cdf0e10cSrcweir 351cdf0e10cSrcweir //======================================================================== 352cdf0e10cSrcweir //= OAdoDetailsPage 353cdf0e10cSrcweir //======================================================================== DBG_NAME(OAdoDetailsPage)354cdf0e10cSrcweir DBG_NAME(OAdoDetailsPage) 355cdf0e10cSrcweir // ----------------------------------------------------------------------- 356cdf0e10cSrcweir OAdoDetailsPage::OAdoDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ) 357cdf0e10cSrcweir :OCommonBehaviourTabPage(pParent, PAGE_ADO, _rCoreAttrs, CBTP_USE_CHARSET ) 358cdf0e10cSrcweir { 359cdf0e10cSrcweir DBG_CTOR(OAdoDetailsPage,NULL); 360cdf0e10cSrcweir 361cdf0e10cSrcweir } 362cdf0e10cSrcweir 363cdf0e10cSrcweir // ----------------------------------------------------------------------- ~OAdoDetailsPage()364cdf0e10cSrcweir OAdoDetailsPage::~OAdoDetailsPage() 365cdf0e10cSrcweir { 366cdf0e10cSrcweir 367cdf0e10cSrcweir DBG_DTOR(OAdoDetailsPage,NULL); 368cdf0e10cSrcweir } 369cdf0e10cSrcweir // ----------------------------------------------------------------------- CreateAdo(Window * pParent,const SfxItemSet & _rAttrSet)370cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateAdo( Window* pParent, const SfxItemSet& _rAttrSet ) 371cdf0e10cSrcweir { 372cdf0e10cSrcweir return ( new OAdoDetailsPage( pParent, _rAttrSet ) ); 373cdf0e10cSrcweir } 374cdf0e10cSrcweir 375cdf0e10cSrcweir // ----------------------------------------------------------------------- 376cdf0e10cSrcweir //======================================================================== 377cdf0e10cSrcweir //= OOdbcDetailsPage 378cdf0e10cSrcweir //======================================================================== OOdbcDetailsPage(Window * pParent,const SfxItemSet & _rCoreAttrs)379cdf0e10cSrcweir OOdbcDetailsPage::OOdbcDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ) 380cdf0e10cSrcweir :OCommonBehaviourTabPage(pParent, PAGE_ODBC, _rCoreAttrs, CBTP_USE_CHARSET | CBTP_USE_OPTIONS,false) 381cdf0e10cSrcweir ,m_aFL_1 (this, ModuleRes(FL_SEPARATOR1)) 382cdf0e10cSrcweir ,m_aUseCatalog (this, ModuleRes(CB_USECATALOG)) 383cdf0e10cSrcweir { 384cdf0e10cSrcweir m_aUseCatalog.SetToggleHdl(getControlModifiedLink()); 385cdf0e10cSrcweir FreeResource(); 386cdf0e10cSrcweir 387cdf0e10cSrcweir Window* pWindows[] = { m_pCharsetLabel, m_pCharset 388cdf0e10cSrcweir ,m_pOptionsLabel,m_pOptions,&m_aUseCatalog 389cdf0e10cSrcweir }; 390cdf0e10cSrcweir 391cdf0e10cSrcweir sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]); 392cdf0e10cSrcweir for (sal_Int32 i=1; i < nCount; ++i) 393cdf0e10cSrcweir pWindows[i]->SetZOrder(pWindows[i-1], WINDOW_ZORDER_BEHIND); 394cdf0e10cSrcweir } 395cdf0e10cSrcweir 396cdf0e10cSrcweir // ----------------------------------------------------------------------- CreateODBC(Window * pParent,const SfxItemSet & _rAttrSet)397cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateODBC( Window* pParent, const SfxItemSet& _rAttrSet ) 398cdf0e10cSrcweir { 399cdf0e10cSrcweir return ( new OOdbcDetailsPage( pParent, _rAttrSet ) ); 400cdf0e10cSrcweir } 401cdf0e10cSrcweir 402cdf0e10cSrcweir // ----------------------------------------------------------------------- FillItemSet(SfxItemSet & _rSet)403cdf0e10cSrcweir sal_Bool OOdbcDetailsPage::FillItemSet( SfxItemSet& _rSet ) 404cdf0e10cSrcweir { 405cdf0e10cSrcweir sal_Bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet); 406cdf0e10cSrcweir fillBool(_rSet,&m_aUseCatalog,DSID_USECATALOG,bChangedSomething); 407cdf0e10cSrcweir return bChangedSomething; 408cdf0e10cSrcweir } 409cdf0e10cSrcweir // ----------------------------------------------------------------------- fillControls(::std::vector<ISaveValueWrapper * > & _rControlList)410cdf0e10cSrcweir void OOdbcDetailsPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) 411cdf0e10cSrcweir { 412cdf0e10cSrcweir OCommonBehaviourTabPage::fillControls(_rControlList); 413cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aUseCatalog)); 414cdf0e10cSrcweir } 415cdf0e10cSrcweir // ----------------------------------------------------------------------- fillWindows(::std::vector<ISaveValueWrapper * > & _rControlList)416cdf0e10cSrcweir void OOdbcDetailsPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) 417cdf0e10cSrcweir { 418cdf0e10cSrcweir OCommonBehaviourTabPage::fillWindows(_rControlList); 419cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedLine>(&m_aFL_1)); 420cdf0e10cSrcweir } 421cdf0e10cSrcweir // ----------------------------------------------------------------------- implInitControls(const SfxItemSet & _rSet,sal_Bool _bSaveValue)422cdf0e10cSrcweir void OOdbcDetailsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) 423cdf0e10cSrcweir { 424cdf0e10cSrcweir // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) 425cdf0e10cSrcweir sal_Bool bValid, bReadonly; 426cdf0e10cSrcweir getFlags(_rSet, bValid, bReadonly); 427cdf0e10cSrcweir 428cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pUseCatalogItem, SfxBoolItem, DSID_USECATALOG, sal_True); 429cdf0e10cSrcweir 430cdf0e10cSrcweir if ( bValid ) 431cdf0e10cSrcweir m_aUseCatalog.Check(pUseCatalogItem->GetValue()); 432cdf0e10cSrcweir 433cdf0e10cSrcweir OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); 434cdf0e10cSrcweir } 435cdf0e10cSrcweir //======================================================================== 436cdf0e10cSrcweir //= OOdbcDetailsPage 437cdf0e10cSrcweir //======================================================================== OUserDriverDetailsPage(Window * pParent,const SfxItemSet & _rCoreAttrs)438cdf0e10cSrcweir OUserDriverDetailsPage::OUserDriverDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ) 439cdf0e10cSrcweir :OCommonBehaviourTabPage(pParent, PAGE_USERDRIVER, _rCoreAttrs, 440cdf0e10cSrcweir CBTP_USE_CHARSET | CBTP_USE_OPTIONS ,false) 441cdf0e10cSrcweir ,m_aFTHostname (this, ModuleRes(FT_HOSTNAME)) 442cdf0e10cSrcweir ,m_aEDHostname (this, ModuleRes(ET_HOSTNAME)) 443cdf0e10cSrcweir ,m_aPortNumber (this, ModuleRes(FT_PORTNUMBER)) 444cdf0e10cSrcweir ,m_aNFPortNumber (this, ModuleRes(NF_PORTNUMBER)) 445cdf0e10cSrcweir ,m_aUseCatalog (this, ModuleRes(CB_USECATALOG)) 446cdf0e10cSrcweir { 447cdf0e10cSrcweir m_aUseCatalog.SetToggleHdl(getControlModifiedLink()); 448cdf0e10cSrcweir FreeResource(); 449cdf0e10cSrcweir } 450cdf0e10cSrcweir 451cdf0e10cSrcweir // ----------------------------------------------------------------------- CreateUser(Window * pParent,const SfxItemSet & _rAttrSet)452cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateUser( Window* pParent, const SfxItemSet& _rAttrSet ) 453cdf0e10cSrcweir { 454cdf0e10cSrcweir return ( new OUserDriverDetailsPage( pParent, _rAttrSet ) ); 455cdf0e10cSrcweir } 456cdf0e10cSrcweir 457cdf0e10cSrcweir // ----------------------------------------------------------------------- FillItemSet(SfxItemSet & _rSet)458cdf0e10cSrcweir sal_Bool OUserDriverDetailsPage::FillItemSet( SfxItemSet& _rSet ) 459cdf0e10cSrcweir { 460cdf0e10cSrcweir sal_Bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet); 461cdf0e10cSrcweir 462cdf0e10cSrcweir fillInt32(_rSet,&m_aNFPortNumber,DSID_CONN_PORTNUMBER,bChangedSomething); 463cdf0e10cSrcweir fillString(_rSet,&m_aEDHostname,DSID_CONN_HOSTNAME,bChangedSomething); 464cdf0e10cSrcweir fillBool(_rSet,&m_aUseCatalog,DSID_USECATALOG,bChangedSomething); 465cdf0e10cSrcweir 466cdf0e10cSrcweir return bChangedSomething; 467cdf0e10cSrcweir } 468cdf0e10cSrcweir // ----------------------------------------------------------------------- fillControls(::std::vector<ISaveValueWrapper * > & _rControlList)469cdf0e10cSrcweir void OUserDriverDetailsPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) 470cdf0e10cSrcweir { 471cdf0e10cSrcweir OCommonBehaviourTabPage::fillControls(_rControlList); 472cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aEDHostname)); 473cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aUseCatalog)); 474cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<NumericField>(&m_aNFPortNumber)); 475cdf0e10cSrcweir } 476cdf0e10cSrcweir // ----------------------------------------------------------------------- fillWindows(::std::vector<ISaveValueWrapper * > & _rControlList)477cdf0e10cSrcweir void OUserDriverDetailsPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) 478cdf0e10cSrcweir { 479cdf0e10cSrcweir OCommonBehaviourTabPage::fillWindows(_rControlList); 480cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHostname)); 481cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aPortNumber)); 482cdf0e10cSrcweir } 483cdf0e10cSrcweir // ----------------------------------------------------------------------- implInitControls(const SfxItemSet & _rSet,sal_Bool _bSaveValue)484cdf0e10cSrcweir void OUserDriverDetailsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) 485cdf0e10cSrcweir { 486cdf0e10cSrcweir // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) 487cdf0e10cSrcweir sal_Bool bValid, bReadonly; 488cdf0e10cSrcweir getFlags(_rSet, bValid, bReadonly); 489cdf0e10cSrcweir 490cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pUseCatalogItem, SfxBoolItem, DSID_USECATALOG, sal_True); 491cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True); 492cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, DSID_CONN_PORTNUMBER, sal_True); 493cdf0e10cSrcweir 494cdf0e10cSrcweir if ( bValid ) 495cdf0e10cSrcweir { 496cdf0e10cSrcweir m_aEDHostname.SetText(pHostName->GetValue()); 497cdf0e10cSrcweir m_aEDHostname.ClearModifyFlag(); 498cdf0e10cSrcweir 499cdf0e10cSrcweir m_aNFPortNumber.SetValue(pPortNumber->GetValue()); 500cdf0e10cSrcweir m_aNFPortNumber.ClearModifyFlag(); 501cdf0e10cSrcweir 502cdf0e10cSrcweir m_aUseCatalog.Check(pUseCatalogItem->GetValue()); 503cdf0e10cSrcweir } 504cdf0e10cSrcweir 505cdf0e10cSrcweir OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); 506cdf0e10cSrcweir } 507cdf0e10cSrcweir //======================================================================== 508cdf0e10cSrcweir //= OMySQLODBCDetailsPage 509cdf0e10cSrcweir //======================================================================== OMySQLODBCDetailsPage(Window * pParent,const SfxItemSet & _rCoreAttrs)510cdf0e10cSrcweir OMySQLODBCDetailsPage::OMySQLODBCDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ) 511cdf0e10cSrcweir :OCommonBehaviourTabPage(pParent, PAGE_MYSQL_ODBC, _rCoreAttrs, CBTP_USE_CHARSET ) 512cdf0e10cSrcweir { 513cdf0e10cSrcweir } 514cdf0e10cSrcweir 515cdf0e10cSrcweir // ----------------------------------------------------------------------- CreateMySQLODBC(Window * pParent,const SfxItemSet & _rAttrSet)516cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateMySQLODBC( Window* pParent, const SfxItemSet& _rAttrSet ) 517cdf0e10cSrcweir { 518cdf0e10cSrcweir return ( new OMySQLODBCDetailsPage( pParent, _rAttrSet ) ); 519cdf0e10cSrcweir } 520cdf0e10cSrcweir 521cdf0e10cSrcweir //======================================================================== 522cdf0e10cSrcweir //= OMySQLJDBCDetailsPage 523cdf0e10cSrcweir //======================================================================== OGeneralSpecialJDBCDetailsPage(Window * pParent,sal_uInt16 _nResId,const SfxItemSet & _rCoreAttrs,sal_uInt16 _nPortId)524cdf0e10cSrcweir OGeneralSpecialJDBCDetailsPage::OGeneralSpecialJDBCDetailsPage( Window* pParent,sal_uInt16 _nResId, const SfxItemSet& _rCoreAttrs ,sal_uInt16 _nPortId) 525cdf0e10cSrcweir :OCommonBehaviourTabPage(pParent, _nResId, _rCoreAttrs, CBTP_USE_CHARSET ,false) 526cdf0e10cSrcweir ,m_aFL_1 (this, ModuleRes( FL_SEPARATOR1) ) 527cdf0e10cSrcweir ,m_aFTHostname (this, ModuleRes(FT_HOSTNAME)) 528cdf0e10cSrcweir ,m_aEDHostname (this, ModuleRes(ET_HOSTNAME)) 529cdf0e10cSrcweir ,m_aPortNumber (this, ModuleRes(FT_PORTNUMBER)) 530cdf0e10cSrcweir ,m_aNFPortNumber (this, ModuleRes(NF_PORTNUMBER)) 531cdf0e10cSrcweir ,m_aFTSocket (this, ModuleRes(FT_SOCKET)) 532cdf0e10cSrcweir ,m_aEDSocket (this, ModuleRes(ET_SOCKET)) 533cdf0e10cSrcweir ,m_aFTDriverClass (this, ModuleRes(FT_JDBCDRIVERCLASS)) 534cdf0e10cSrcweir ,m_aEDDriverClass (this, ModuleRes(ET_JDBCDRIVERCLASS)) 535cdf0e10cSrcweir ,m_aTestJavaDriver (this, ModuleRes(PB_TESTDRIVERCLASS)) 536cdf0e10cSrcweir ,m_nPortId(_nPortId) 537cdf0e10cSrcweir ,m_bUseClass(true) 538cdf0e10cSrcweir { 539cdf0e10cSrcweir SFX_ITEMSET_GET(_rCoreAttrs, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); 540cdf0e10cSrcweir SFX_ITEMSET_GET(_rCoreAttrs, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); 541cdf0e10cSrcweir ::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL; 542cdf0e10cSrcweir if (pTypeCollection && pUrlItem && pUrlItem->GetValue().Len() ) 543cdf0e10cSrcweir { 544cdf0e10cSrcweir m_sDefaultJdbcDriverName = pTypeCollection->getJavaDriverClass(pUrlItem->GetValue()); 545cdf0e10cSrcweir } 546cdf0e10cSrcweir if ( m_sDefaultJdbcDriverName.Len() ) 547cdf0e10cSrcweir { 548cdf0e10cSrcweir m_aEDDriverClass.SetModifyHdl(getControlModifiedLink()); 549cdf0e10cSrcweir m_aEDDriverClass.SetModifyHdl(LINK(this, OGeneralSpecialJDBCDetailsPage, OnEditModified)); 550cdf0e10cSrcweir m_aTestJavaDriver.SetClickHdl(LINK(this,OGeneralSpecialJDBCDetailsPage,OnTestJavaClickHdl)); 551cdf0e10cSrcweir } 552cdf0e10cSrcweir else 553cdf0e10cSrcweir { 554cdf0e10cSrcweir m_bUseClass = false; 555cdf0e10cSrcweir m_aFTDriverClass.Show(sal_False); 556cdf0e10cSrcweir m_aEDDriverClass.Show(sal_False); 557cdf0e10cSrcweir m_aTestJavaDriver.Show(sal_False); 558cdf0e10cSrcweir } 559cdf0e10cSrcweir 560cdf0e10cSrcweir m_aFTSocket.Show(PAGE_MYSQL_JDBC == _nResId && !m_bUseClass); 561cdf0e10cSrcweir m_aEDSocket.Show(PAGE_MYSQL_JDBC == _nResId && !m_bUseClass); 562cdf0e10cSrcweir 563cdf0e10cSrcweir m_aEDHostname.SetModifyHdl(getControlModifiedLink()); 564cdf0e10cSrcweir m_aNFPortNumber.SetModifyHdl(getControlModifiedLink()); 565cdf0e10cSrcweir m_aEDSocket.SetModifyHdl(getControlModifiedLink()); 566cdf0e10cSrcweir 567cdf0e10cSrcweir Window* pWindows[] = { &m_aFTHostname,&m_aEDHostname, 568cdf0e10cSrcweir &m_aPortNumber,&m_aNFPortNumber,&m_aFTSocket,&m_aEDSocket, 569cdf0e10cSrcweir &m_aFTDriverClass, &m_aEDDriverClass,&m_aTestJavaDriver, 570cdf0e10cSrcweir m_pCharsetLabel, m_pCharset}; 571cdf0e10cSrcweir 572cdf0e10cSrcweir sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]); 573cdf0e10cSrcweir for (sal_Int32 i=1; i < nCount; ++i) 574cdf0e10cSrcweir pWindows[i]->SetZOrder(pWindows[i-1], WINDOW_ZORDER_BEHIND); 575cdf0e10cSrcweir 576cdf0e10cSrcweir FreeResource(); 577cdf0e10cSrcweir } 578cdf0e10cSrcweir 579cdf0e10cSrcweir // ----------------------------------------------------------------------- fillControls(::std::vector<ISaveValueWrapper * > & _rControlList)580cdf0e10cSrcweir void OGeneralSpecialJDBCDetailsPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) 581cdf0e10cSrcweir { 582cdf0e10cSrcweir OCommonBehaviourTabPage::fillControls(_rControlList); 583cdf0e10cSrcweir if ( m_bUseClass ) 584cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aEDDriverClass)); 585cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aEDHostname)); 586cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<NumericField>(&m_aNFPortNumber)); 587cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aEDSocket)); 588cdf0e10cSrcweir } 589cdf0e10cSrcweir // ----------------------------------------------------------------------- fillWindows(::std::vector<ISaveValueWrapper * > & _rControlList)590cdf0e10cSrcweir void OGeneralSpecialJDBCDetailsPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) 591cdf0e10cSrcweir { 592cdf0e10cSrcweir OCommonBehaviourTabPage::fillWindows(_rControlList); 593cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHostname)); 594cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aPortNumber)); 595cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTSocket)); 596cdf0e10cSrcweir if ( m_bUseClass ) 597cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTDriverClass)); 598cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedLine>(&m_aFL_1)); 599cdf0e10cSrcweir } 600cdf0e10cSrcweir 601cdf0e10cSrcweir // ----------------------------------------------------------------------- FillItemSet(SfxItemSet & _rSet)602cdf0e10cSrcweir sal_Bool OGeneralSpecialJDBCDetailsPage::FillItemSet( SfxItemSet& _rSet ) 603cdf0e10cSrcweir { 604cdf0e10cSrcweir sal_Bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet); 605cdf0e10cSrcweir if ( m_bUseClass ) 606cdf0e10cSrcweir fillString(_rSet,&m_aEDDriverClass,DSID_JDBCDRIVERCLASS,bChangedSomething); 607cdf0e10cSrcweir fillString(_rSet,&m_aEDHostname,DSID_CONN_HOSTNAME,bChangedSomething); 608cdf0e10cSrcweir fillString(_rSet,&m_aEDSocket,DSID_CONN_SOCKET,bChangedSomething); 609cdf0e10cSrcweir fillInt32(_rSet,&m_aNFPortNumber,m_nPortId,bChangedSomething ); 610cdf0e10cSrcweir 611cdf0e10cSrcweir return bChangedSomething; 612cdf0e10cSrcweir } 613cdf0e10cSrcweir // ----------------------------------------------------------------------- implInitControls(const SfxItemSet & _rSet,sal_Bool _bSaveValue)614cdf0e10cSrcweir void OGeneralSpecialJDBCDetailsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) 615cdf0e10cSrcweir { 616cdf0e10cSrcweir // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) 617cdf0e10cSrcweir sal_Bool bValid, bReadonly; 618cdf0e10cSrcweir getFlags(_rSet, bValid, bReadonly); 619cdf0e10cSrcweir 620cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pDrvItem, SfxStringItem, DSID_JDBCDRIVERCLASS, sal_True); 621cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True); 622cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, m_nPortId, sal_True); 623cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pSocket, SfxStringItem, DSID_CONN_SOCKET, sal_True); 624cdf0e10cSrcweir 625cdf0e10cSrcweir if ( bValid ) 626cdf0e10cSrcweir { 627cdf0e10cSrcweir if ( m_bUseClass ) 628cdf0e10cSrcweir { 629cdf0e10cSrcweir m_aEDDriverClass.SetText(pDrvItem->GetValue()); 630cdf0e10cSrcweir m_aEDDriverClass.ClearModifyFlag(); 631cdf0e10cSrcweir } 632cdf0e10cSrcweir 633cdf0e10cSrcweir m_aEDHostname.SetText(pHostName->GetValue()); 634cdf0e10cSrcweir m_aEDHostname.ClearModifyFlag(); 635cdf0e10cSrcweir 636cdf0e10cSrcweir m_aNFPortNumber.SetValue(pPortNumber->GetValue()); 637cdf0e10cSrcweir m_aNFPortNumber.ClearModifyFlag(); 638cdf0e10cSrcweir 639cdf0e10cSrcweir m_aEDSocket.SetText(pSocket->GetValue()); 640cdf0e10cSrcweir m_aEDSocket.ClearModifyFlag(); 641cdf0e10cSrcweir } 642cdf0e10cSrcweir 643cdf0e10cSrcweir OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); 644cdf0e10cSrcweir 645cdf0e10cSrcweir // to get the correcxt value when saveValue was called by base class 646cdf0e10cSrcweir if ( m_bUseClass && !m_aEDDriverClass.GetText().Len() ) 647cdf0e10cSrcweir { 648cdf0e10cSrcweir m_aEDDriverClass.SetText(m_sDefaultJdbcDriverName); 649cdf0e10cSrcweir m_aEDDriverClass.SetModifyFlag(); 650cdf0e10cSrcweir } 651cdf0e10cSrcweir } 652cdf0e10cSrcweir // ----------------------------------------------------------------------- 653cdf0e10cSrcweir IMPL_LINK(OGeneralSpecialJDBCDetailsPage, OnTestJavaClickHdl, PushButton*, /*_pButton*/) 654cdf0e10cSrcweir { 655cdf0e10cSrcweir OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); 656cdf0e10cSrcweir OSL_ENSURE(m_bUseClass,"Who called me?"); 657cdf0e10cSrcweir 658cdf0e10cSrcweir sal_Bool bSuccess = sal_False; 659cdf0e10cSrcweir try 660cdf0e10cSrcweir { 661cdf0e10cSrcweir if ( m_aEDDriverClass.GetText().Len() ) 662cdf0e10cSrcweir { 663cdf0e10cSrcweir // TODO chage jvmaccess 664cdf0e10cSrcweir ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM(m_pAdminDialog->getORB()); 665cdf0e10cSrcweir bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aEDDriverClass.GetText()); 666cdf0e10cSrcweir } 667cdf0e10cSrcweir } 668cdf0e10cSrcweir catch(Exception&) 669cdf0e10cSrcweir { 670cdf0e10cSrcweir } 671cdf0e10cSrcweir 672cdf0e10cSrcweir sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; 673cdf0e10cSrcweir OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String() ); 674cdf0e10cSrcweir aMsg.Execute(); 675cdf0e10cSrcweir return 0L; 676cdf0e10cSrcweir } 677cdf0e10cSrcweir // ----------------------------------------------------------------------- IMPL_LINK(OGeneralSpecialJDBCDetailsPage,OnEditModified,Edit *,_pEdit)678cdf0e10cSrcweir IMPL_LINK(OGeneralSpecialJDBCDetailsPage, OnEditModified, Edit*, _pEdit) 679cdf0e10cSrcweir { 680cdf0e10cSrcweir if ( m_bUseClass && _pEdit == &m_aEDDriverClass ) 681cdf0e10cSrcweir m_aTestJavaDriver.Enable( m_aEDDriverClass.GetText().Len() != 0 ); 682cdf0e10cSrcweir 683cdf0e10cSrcweir // tell the listener we were modified 684cdf0e10cSrcweir callModifiedHdl(); 685cdf0e10cSrcweir return 0L; 686cdf0e10cSrcweir } 687cdf0e10cSrcweir 688cdf0e10cSrcweir //======================================================================== 689cdf0e10cSrcweir //= MySQLNativePage 690cdf0e10cSrcweir //======================================================================== MySQLNativePage(Window * pParent,const SfxItemSet & _rCoreAttrs)691cdf0e10cSrcweir MySQLNativePage::MySQLNativePage( Window* pParent, const SfxItemSet& _rCoreAttrs ) 692cdf0e10cSrcweir :OCommonBehaviourTabPage(pParent, PAGE_MYSQL_NATIVE, _rCoreAttrs, CBTP_USE_CHARSET, false ) 693cdf0e10cSrcweir ,m_aSeparator1 ( this, ModuleRes( FL_SEPARATOR1) ) 694cdf0e10cSrcweir ,m_aMySQLSettings ( *this, getControlModifiedLink() ) 695cdf0e10cSrcweir ,m_aSeparator2 ( this, ModuleRes(FL_SEPARATOR2)) 696cdf0e10cSrcweir ,m_aUserNameLabel ( this, ModuleRes(FT_USERNAME)) 697cdf0e10cSrcweir ,m_aUserName ( this, ModuleRes(ET_USERNAME)) 698cdf0e10cSrcweir ,m_aPasswordRequired ( this, ModuleRes(CB_PASSWORD_REQUIRED)) 699cdf0e10cSrcweir { 700cdf0e10cSrcweir m_aUserName.SetModifyHdl(getControlModifiedLink()); 701cdf0e10cSrcweir 702cdf0e10cSrcweir Window* pWindows[] = { &m_aMySQLSettings, &m_aSeparator2, &m_aUserNameLabel, &m_aUserName, 703cdf0e10cSrcweir &m_aPasswordRequired, m_pCharsetLabel, m_pCharset}; 704cdf0e10cSrcweir sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]); 705cdf0e10cSrcweir for (sal_Int32 i=1; i < nCount; ++i) 706cdf0e10cSrcweir pWindows[i]->SetZOrder(pWindows[i-1], WINDOW_ZORDER_BEHIND); 707cdf0e10cSrcweir 708cdf0e10cSrcweir LayoutHelper::positionBelow( m_aSeparator1, m_aMySQLSettings, RelatedControls, 3 ); 709cdf0e10cSrcweir m_aMySQLSettings.Show(); 710cdf0e10cSrcweir 711cdf0e10cSrcweir FreeResource(); 712cdf0e10cSrcweir } 713cdf0e10cSrcweir 714cdf0e10cSrcweir // ----------------------------------------------------------------------- fillControls(::std::vector<ISaveValueWrapper * > & _rControlList)715cdf0e10cSrcweir void MySQLNativePage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) 716cdf0e10cSrcweir { 717cdf0e10cSrcweir OCommonBehaviourTabPage::fillControls( _rControlList ); 718cdf0e10cSrcweir m_aMySQLSettings.fillControls( _rControlList ); 719cdf0e10cSrcweir 720cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aUserName)); 721cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aPasswordRequired)); 722cdf0e10cSrcweir } 723cdf0e10cSrcweir // ----------------------------------------------------------------------- fillWindows(::std::vector<ISaveValueWrapper * > & _rControlList)724cdf0e10cSrcweir void MySQLNativePage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) 725cdf0e10cSrcweir { 726cdf0e10cSrcweir OCommonBehaviourTabPage::fillWindows( _rControlList ); 727cdf0e10cSrcweir m_aMySQLSettings.fillWindows( _rControlList); 728cdf0e10cSrcweir 729cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedLine>(&m_aSeparator1)); 730cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedLine>(&m_aSeparator2)); 731cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aUserNameLabel)); 732cdf0e10cSrcweir } 733cdf0e10cSrcweir 734cdf0e10cSrcweir // ----------------------------------------------------------------------- FillItemSet(SfxItemSet & _rSet)735cdf0e10cSrcweir sal_Bool MySQLNativePage::FillItemSet( SfxItemSet& _rSet ) 736cdf0e10cSrcweir { 737cdf0e10cSrcweir sal_Bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet( _rSet ); 738cdf0e10cSrcweir 739cdf0e10cSrcweir bChangedSomething |= m_aMySQLSettings.FillItemSet( _rSet ); 740cdf0e10cSrcweir 741cdf0e10cSrcweir if ( m_aUserName.GetText() != m_aUserName.GetSavedValue() ) 742cdf0e10cSrcweir { 743cdf0e10cSrcweir _rSet.Put( SfxStringItem( DSID_USER, m_aUserName.GetText() ) ); 744cdf0e10cSrcweir _rSet.Put( SfxStringItem( DSID_PASSWORD, String())); 745cdf0e10cSrcweir bChangedSomething = sal_True; 746cdf0e10cSrcweir } 747cdf0e10cSrcweir fillBool(_rSet,&m_aPasswordRequired,DSID_PASSWORDREQUIRED,bChangedSomething); 748cdf0e10cSrcweir 749cdf0e10cSrcweir return bChangedSomething; 750cdf0e10cSrcweir } 751cdf0e10cSrcweir // ----------------------------------------------------------------------- implInitControls(const SfxItemSet & _rSet,sal_Bool _bSaveValue)752cdf0e10cSrcweir void MySQLNativePage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) 753cdf0e10cSrcweir { 754cdf0e10cSrcweir // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) 755cdf0e10cSrcweir sal_Bool bValid, bReadonly; 756cdf0e10cSrcweir getFlags(_rSet, bValid, bReadonly); 757cdf0e10cSrcweir 758cdf0e10cSrcweir m_aMySQLSettings.implInitControls( _rSet ); 759cdf0e10cSrcweir 760cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pUidItem, SfxStringItem, DSID_USER, sal_True); 761cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pAllowEmptyPwd, SfxBoolItem, DSID_PASSWORDREQUIRED, sal_True); 762cdf0e10cSrcweir 763cdf0e10cSrcweir if ( bValid ) 764cdf0e10cSrcweir { 765cdf0e10cSrcweir m_aUserName.SetText(pUidItem->GetValue()); 766cdf0e10cSrcweir m_aUserName.ClearModifyFlag(); 767cdf0e10cSrcweir m_aPasswordRequired.Check(pAllowEmptyPwd->GetValue()); 768cdf0e10cSrcweir } 769cdf0e10cSrcweir 770cdf0e10cSrcweir OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); 771cdf0e10cSrcweir } 772cdf0e10cSrcweir 773cdf0e10cSrcweir // ----------------------------------------------------------------------- CreateMySQLJDBC(Window * pParent,const SfxItemSet & _rAttrSet)774cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateMySQLJDBC( Window* pParent, const SfxItemSet& _rAttrSet ) 775cdf0e10cSrcweir { 776cdf0e10cSrcweir return ( new OGeneralSpecialJDBCDetailsPage( pParent,PAGE_MYSQL_JDBC, _rAttrSet,DSID_MYSQL_PORTNUMBER ) ); 777cdf0e10cSrcweir } 778cdf0e10cSrcweir // ----------------------------------------------------------------------- CreateMySQLNATIVE(Window * pParent,const SfxItemSet & _rAttrSet)779cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateMySQLNATIVE( Window* pParent, const SfxItemSet& _rAttrSet ) 780cdf0e10cSrcweir { 781cdf0e10cSrcweir return ( new MySQLNativePage( pParent, _rAttrSet ) ); 782cdf0e10cSrcweir } 783cdf0e10cSrcweir 784cdf0e10cSrcweir // ----------------------------------------------------------------------- CreateOracleJDBC(Window * pParent,const SfxItemSet & _rAttrSet)785cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateOracleJDBC( Window* pParent, const SfxItemSet& _rAttrSet ) 786cdf0e10cSrcweir { 787cdf0e10cSrcweir return ( new OGeneralSpecialJDBCDetailsPage( pParent,PAGE_ORACLE_JDBC, _rAttrSet,DSID_ORACLE_PORTNUMBER) ); 788cdf0e10cSrcweir } 789cdf0e10cSrcweir 790cdf0e10cSrcweir 791cdf0e10cSrcweir //======================================================================== 792cdf0e10cSrcweir //= OAdabasDetailsPage 793cdf0e10cSrcweir //======================================================================== OAdabasDetailsPage(Window * pParent,const SfxItemSet & _rCoreAttrs)794cdf0e10cSrcweir OAdabasDetailsPage::OAdabasDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ) 795cdf0e10cSrcweir :OCommonBehaviourTabPage(pParent, PAGE_ADABAS, _rCoreAttrs, CBTP_USE_CHARSET ,false) 796cdf0e10cSrcweir ,m_aFTHostname (this, ModuleRes(FT_HOSTNAME)) 797cdf0e10cSrcweir ,m_aEDHostname (this, ModuleRes(ET_HOSTNAME)) 798cdf0e10cSrcweir ,m_aFL_1 (this, ModuleRes( FL_SEPARATOR1) ) 799cdf0e10cSrcweir ,m_FT_CACHE_SIZE( this, ModuleRes( FT_CACHE_SIZE ) ) 800cdf0e10cSrcweir ,m_NF_CACHE_SIZE( this, ModuleRes( NF_CACHE_SIZE ) ) 801cdf0e10cSrcweir ,m_FT_DATA_INCREMENT( this, ModuleRes( FT_DATA_INCREMENT ) ) 802cdf0e10cSrcweir ,m_NF_DATA_INCREMENT( this, ModuleRes( NF_DATA_INCREMENT ) ) 803cdf0e10cSrcweir ,m_aFL_2( this, ModuleRes( FL_SEPARATOR2 ) ) 804cdf0e10cSrcweir ,m_FT_CTRLUSERNAME( this, ModuleRes( FT_CTRLUSERNAME ) ) 805cdf0e10cSrcweir ,m_ET_CTRLUSERNAME( this, ModuleRes( ET_CTRLUSERNAME ) ) 806cdf0e10cSrcweir ,m_FT_CTRLPASSWORD( this, ModuleRes( FT_CTRLPASSWORD ) ) 807cdf0e10cSrcweir ,m_ET_CTRLPASSWORD( this, ModuleRes( ET_CTRLPASSWORD ) ) 808cdf0e10cSrcweir ,m_CB_SHUTDB( this, ModuleRes( CB_SHUTDB ) ) 809cdf0e10cSrcweir ,m_PB_STAT( this, ModuleRes( PB_STAT ) ) 810cdf0e10cSrcweir { 811cdf0e10cSrcweir m_aEDHostname.SetModifyHdl(getControlModifiedLink()); 812cdf0e10cSrcweir 813cdf0e10cSrcweir FreeResource(); 814cdf0e10cSrcweir 815cdf0e10cSrcweir m_PB_STAT.SetClickHdl( LINK(this,OAdabasDetailsPage,PBClickHdl)); 816cdf0e10cSrcweir 817cdf0e10cSrcweir m_CB_SHUTDB.SetClickHdl( LINK(this,OAdabasDetailsPage,AttributesChangedHdl)); 818cdf0e10cSrcweir m_NF_CACHE_SIZE.SetModifyHdl( LINK(this,OAdabasDetailsPage,AttributesChangedHdl)); 819cdf0e10cSrcweir m_NF_DATA_INCREMENT.SetModifyHdl( LINK(this,OAdabasDetailsPage,AttributesChangedHdl)); 820cdf0e10cSrcweir m_ET_CTRLUSERNAME.SetModifyHdl( LINK(this,OAdabasDetailsPage,AttributesChangedHdl)); 821cdf0e10cSrcweir m_ET_CTRLPASSWORD.SetModifyHdl( LINK(this,OAdabasDetailsPage,AttributesChangedHdl)); 822cdf0e10cSrcweir 823cdf0e10cSrcweir m_ET_CTRLUSERNAME.SetLoseFocusHdl( LINK(this,OAdabasDetailsPage,LoseFocusHdl)); 824cdf0e10cSrcweir m_ET_CTRLPASSWORD.SetLoseFocusHdl( LINK(this,OAdabasDetailsPage,LoseFocusHdl)); 825cdf0e10cSrcweir 826cdf0e10cSrcweir m_NF_DATA_INCREMENT.SetMin(20); 827cdf0e10cSrcweir m_NF_DATA_INCREMENT.SetMax(LONG_MAX); 828cdf0e10cSrcweir m_NF_DATA_INCREMENT.SetValue(20); 829cdf0e10cSrcweir m_NF_DATA_INCREMENT.SetDecimalDigits(0); 830cdf0e10cSrcweir 831cdf0e10cSrcweir m_NF_CACHE_SIZE.SetMin(4); 832cdf0e10cSrcweir m_NF_CACHE_SIZE.SetMax(LONG_MAX); 833cdf0e10cSrcweir m_NF_CACHE_SIZE.SetValue(4); 834cdf0e10cSrcweir m_NF_CACHE_SIZE.SetDecimalDigits(0); 835cdf0e10cSrcweir 836cdf0e10cSrcweir Window* pWindows[] = { &m_aFTHostname,&m_aEDHostname 837cdf0e10cSrcweir ,&m_FT_CACHE_SIZE,&m_NF_CACHE_SIZE 838cdf0e10cSrcweir ,&m_FT_DATA_INCREMENT,&m_NF_DATA_INCREMENT 839cdf0e10cSrcweir ,&m_FT_CTRLUSERNAME,&m_ET_CTRLUSERNAME 840cdf0e10cSrcweir ,&m_FT_CTRLPASSWORD,&m_ET_CTRLPASSWORD 841cdf0e10cSrcweir ,&m_CB_SHUTDB 842cdf0e10cSrcweir ,m_pCharsetLabel, m_pCharset,&m_PB_STAT}; 843cdf0e10cSrcweir 844cdf0e10cSrcweir sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]); 845cdf0e10cSrcweir for (sal_Int32 i=1; i < nCount; ++i) 846cdf0e10cSrcweir pWindows[i]->SetZOrder(pWindows[i-1], WINDOW_ZORDER_BEHIND); 847cdf0e10cSrcweir } 848cdf0e10cSrcweir 849cdf0e10cSrcweir // ----------------------------------------------------------------------- CreateAdabas(Window * pParent,const SfxItemSet & _rAttrSet)850cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateAdabas( Window* pParent, const SfxItemSet& _rAttrSet ) 851cdf0e10cSrcweir { 852cdf0e10cSrcweir return ( new OAdabasDetailsPage( pParent, _rAttrSet ) ); 853cdf0e10cSrcweir } 854cdf0e10cSrcweir 855cdf0e10cSrcweir // ----------------------------------------------------------------------- fillControls(::std::vector<ISaveValueWrapper * > & _rControlList)856cdf0e10cSrcweir void OAdabasDetailsPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) 857cdf0e10cSrcweir { 858cdf0e10cSrcweir OCommonBehaviourTabPage::fillControls(_rControlList); 859cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aEDHostname)); 860cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<NumericField>(&m_NF_CACHE_SIZE)); 861cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<NumericField>(&m_NF_DATA_INCREMENT)); 862cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_ET_CTRLUSERNAME)); 863cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_ET_CTRLPASSWORD)); 864cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_CB_SHUTDB)); 865cdf0e10cSrcweir } 866cdf0e10cSrcweir // ----------------------------------------------------------------------- fillWindows(::std::vector<ISaveValueWrapper * > & _rControlList)867cdf0e10cSrcweir void OAdabasDetailsPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) 868cdf0e10cSrcweir { 869cdf0e10cSrcweir OCommonBehaviourTabPage::fillWindows(_rControlList); 870cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHostname)); 871cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedLine>(&m_aFL_1)); 872cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_FT_CACHE_SIZE)); 873cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_FT_DATA_INCREMENT)); 874cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedLine>(&m_aFL_2)); 875cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_FT_CTRLUSERNAME)); 876cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_FT_CTRLPASSWORD)); 877cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<PushButton>(&m_PB_STAT)); 878cdf0e10cSrcweir } 879cdf0e10cSrcweir // ----------------------------------------------------------------------- implInitControls(const SfxItemSet & _rSet,sal_Bool _bSaveValue)880cdf0e10cSrcweir void OAdabasDetailsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) 881cdf0e10cSrcweir { 882cdf0e10cSrcweir // first check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) 883cdf0e10cSrcweir sal_Bool bValid, bReadonly; 884cdf0e10cSrcweir getFlags(_rSet, bValid, bReadonly); 885cdf0e10cSrcweir 886cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True); 887cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pCtrlUserItem, SfxStringItem, DSID_CONN_CTRLUSER, sal_True); 888cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pCtrlPwdItem, SfxStringItem, DSID_CONN_CTRLPWD, sal_True); 889cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pShutItem, SfxBoolItem, DSID_CONN_SHUTSERVICE, sal_True); 890cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pIncItem, SfxInt32Item, DSID_CONN_DATAINC, sal_True); 891cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pCacheItem, SfxInt32Item, DSID_CONN_CACHESIZE, sal_True); 892cdf0e10cSrcweir if ( bValid ) 893cdf0e10cSrcweir { 894cdf0e10cSrcweir m_aEDHostname.SetText(pHostName->GetValue()); 895cdf0e10cSrcweir m_aEDHostname.ClearModifyFlag(); 896cdf0e10cSrcweir m_CB_SHUTDB.Check( pShutItem->GetValue() ); 897cdf0e10cSrcweir m_NF_DATA_INCREMENT.SetValue( pIncItem->GetValue() ); 898cdf0e10cSrcweir m_NF_CACHE_SIZE.SetValue( pCacheItem->GetValue() ); 899cdf0e10cSrcweir m_ET_CTRLUSERNAME.SetText(pCtrlUserItem->GetValue()); 900cdf0e10cSrcweir m_ET_CTRLPASSWORD.SetText(pCtrlPwdItem->GetValue()); 901cdf0e10cSrcweir m_CB_SHUTDB.Enable(m_ET_CTRLUSERNAME.GetText().Len() && m_ET_CTRLPASSWORD.GetText().Len()); 902cdf0e10cSrcweir } 903cdf0e10cSrcweir 904cdf0e10cSrcweir OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); 905cdf0e10cSrcweir } 906cdf0e10cSrcweir // ----------------------------------------------------------------------- FillItemSet(SfxItemSet & _rSet)907cdf0e10cSrcweir sal_Bool OAdabasDetailsPage::FillItemSet( SfxItemSet& _rSet ) 908cdf0e10cSrcweir { 909cdf0e10cSrcweir sal_Bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet); 910cdf0e10cSrcweir 911cdf0e10cSrcweir fillString(_rSet,&m_aEDHostname,DSID_CONN_HOSTNAME,bChangedSomething); 912cdf0e10cSrcweir fillBool(_rSet,&m_CB_SHUTDB,DSID_CONN_SHUTSERVICE,bChangedSomething); 913cdf0e10cSrcweir fillInt32(_rSet,&m_NF_DATA_INCREMENT,DSID_CONN_DATAINC,bChangedSomething ); 914cdf0e10cSrcweir fillInt32(_rSet,&m_NF_CACHE_SIZE,DSID_CONN_CACHESIZE,bChangedSomething ); 915cdf0e10cSrcweir fillString(_rSet,&m_ET_CTRLUSERNAME,DSID_CONN_CTRLUSER,bChangedSomething ); 916cdf0e10cSrcweir fillString(_rSet,&m_ET_CTRLPASSWORD,DSID_CONN_CTRLPWD,bChangedSomething ); 917cdf0e10cSrcweir 918cdf0e10cSrcweir return bChangedSomething; 919cdf0e10cSrcweir } 920cdf0e10cSrcweir //------------------------------------------------------------------------ IMPL_LINK(OAdabasDetailsPage,AttributesChangedHdl,void *,EMPTYARG)921cdf0e10cSrcweir IMPL_LINK( OAdabasDetailsPage, AttributesChangedHdl, void *, EMPTYARG ) 922cdf0e10cSrcweir { 923cdf0e10cSrcweir m_CB_SHUTDB.Enable(m_ET_CTRLUSERNAME.GetText().Len() && m_ET_CTRLPASSWORD.GetText().Len()); 924cdf0e10cSrcweir bAttrsChanged = sal_True; 925cdf0e10cSrcweir callModifiedHdl(); 926cdf0e10cSrcweir return 0; 927cdf0e10cSrcweir } 928cdf0e10cSrcweir //------------------------------------------------------------------------ 929cdf0e10cSrcweir IMPL_LINK( OAdabasDetailsPage, LoseFocusHdl, Edit *, /*pEdit*/ ) 930cdf0e10cSrcweir { 931cdf0e10cSrcweir m_CB_SHUTDB.Enable(m_ET_CTRLUSERNAME.GetText().Len() && m_ET_CTRLPASSWORD.GetText().Len()); 932cdf0e10cSrcweir return 0; 933cdf0e10cSrcweir } 934cdf0e10cSrcweir //------------------------------------------------------------------------ 935cdf0e10cSrcweir IMPL_LINK( OAdabasDetailsPage, PBClickHdl, Button *, /*pButton*/ ) 936cdf0e10cSrcweir { 937cdf0e10cSrcweir OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); 938cdf0e10cSrcweir if ( m_pAdminDialog ) 939cdf0e10cSrcweir { 940cdf0e10cSrcweir m_pAdminDialog->saveDatasource(); 941cdf0e10cSrcweir try 942cdf0e10cSrcweir { 943cdf0e10cSrcweir Reference< XConnection > xConnection = m_pAdminDialog->createConnection().first; 944cdf0e10cSrcweir if ( xConnection.is() ) 945cdf0e10cSrcweir { 946cdf0e10cSrcweir OAdabasStatistics aDlg(this,m_sUser,xConnection,m_pAdminDialog->getORB()); 947cdf0e10cSrcweir aDlg.Execute(); 948cdf0e10cSrcweir ::comphelper::disposeComponent(xConnection); 949cdf0e10cSrcweir } 950cdf0e10cSrcweir } 951cdf0e10cSrcweir catch(Exception&) 952cdf0e10cSrcweir { 953cdf0e10cSrcweir } 954cdf0e10cSrcweir } 955cdf0e10cSrcweir 956cdf0e10cSrcweir return 0; 957cdf0e10cSrcweir } 958cdf0e10cSrcweir 959cdf0e10cSrcweir 960cdf0e10cSrcweir //======================================================================== 961cdf0e10cSrcweir //= OLDAPDetailsPage 962cdf0e10cSrcweir //======================================================================== OLDAPDetailsPage(Window * pParent,const SfxItemSet & _rCoreAttrs)963cdf0e10cSrcweir OLDAPDetailsPage::OLDAPDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ) 964cdf0e10cSrcweir :OCommonBehaviourTabPage(pParent, PAGE_LDAP, _rCoreAttrs,0,false) 965cdf0e10cSrcweir ,m_aFL_1 (this, ModuleRes( FL_SEPARATOR1) ) 966cdf0e10cSrcweir ,m_aBaseDN (this, ModuleRes(FT_BASEDN)) 967cdf0e10cSrcweir ,m_aETBaseDN (this, ModuleRes(ET_BASEDN)) 968cdf0e10cSrcweir ,m_aCBUseSSL (this, ModuleRes(CB_USESSL)) 969cdf0e10cSrcweir ,m_aPortNumber (this, ModuleRes(FT_PORTNUMBER)) 970cdf0e10cSrcweir ,m_aNFPortNumber (this, ModuleRes(NF_PORTNUMBER)) 971cdf0e10cSrcweir ,m_aFTRowCount (this, ModuleRes(FT_LDAPROWCOUNT)) 972cdf0e10cSrcweir ,m_aNFRowCount (this, ModuleRes(NF_LDAPROWCOUNT)) 973cdf0e10cSrcweir { 974cdf0e10cSrcweir m_aETBaseDN.SetModifyHdl(getControlModifiedLink()); 975cdf0e10cSrcweir m_aCBUseSSL.SetToggleHdl(getControlModifiedLink()); 976cdf0e10cSrcweir m_aNFPortNumber.SetModifyHdl(getControlModifiedLink()); 977cdf0e10cSrcweir m_aNFRowCount.SetModifyHdl(getControlModifiedLink()); 978cdf0e10cSrcweir 979cdf0e10cSrcweir m_aNFRowCount.SetUseThousandSep(sal_False); 980cdf0e10cSrcweir m_iNormalPort = 389; 981cdf0e10cSrcweir m_iSSLPort = 636; 982cdf0e10cSrcweir m_aCBUseSSL.SetClickHdl(LINK(this, OLDAPDetailsPage,OnCheckBoxClick)); 983cdf0e10cSrcweir FreeResource(); 984cdf0e10cSrcweir } 985cdf0e10cSrcweir 986cdf0e10cSrcweir // ----------------------------------------------------------------------- CreateLDAP(Window * pParent,const SfxItemSet & _rAttrSet)987cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateLDAP( Window* pParent, const SfxItemSet& _rAttrSet ) 988cdf0e10cSrcweir { 989cdf0e10cSrcweir return ( new OLDAPDetailsPage( pParent, _rAttrSet ) ); 990cdf0e10cSrcweir } 991cdf0e10cSrcweir 992cdf0e10cSrcweir // ----------------------------------------------------------------------- FillItemSet(SfxItemSet & _rSet)993cdf0e10cSrcweir sal_Bool OLDAPDetailsPage::FillItemSet( SfxItemSet& _rSet ) 994cdf0e10cSrcweir { 995cdf0e10cSrcweir sal_Bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet); 996cdf0e10cSrcweir 997cdf0e10cSrcweir fillString(_rSet,&m_aETBaseDN,DSID_CONN_LDAP_BASEDN,bChangedSomething); 998cdf0e10cSrcweir fillInt32(_rSet,&m_aNFPortNumber,DSID_CONN_LDAP_PORTNUMBER,bChangedSomething); 999cdf0e10cSrcweir fillInt32(_rSet,&m_aNFRowCount,DSID_CONN_LDAP_ROWCOUNT,bChangedSomething); 1000cdf0e10cSrcweir fillBool(_rSet,&m_aCBUseSSL,DSID_CONN_LDAP_USESSL,bChangedSomething); 1001cdf0e10cSrcweir return bChangedSomething; 1002cdf0e10cSrcweir } 1003cdf0e10cSrcweir //------------------------------------------------------------------------ IMPL_LINK(OLDAPDetailsPage,OnCheckBoxClick,CheckBox *,pCheckBox)1004cdf0e10cSrcweir IMPL_LINK( OLDAPDetailsPage, OnCheckBoxClick, CheckBox*, pCheckBox ) 1005cdf0e10cSrcweir { 1006cdf0e10cSrcweir callModifiedHdl(); 1007cdf0e10cSrcweir if ( pCheckBox == &m_aCBUseSSL) 1008cdf0e10cSrcweir { 1009cdf0e10cSrcweir if ( m_aCBUseSSL.IsChecked() ) 1010cdf0e10cSrcweir { 1011cdf0e10cSrcweir m_iNormalPort = static_cast<sal_Int32>(m_aNFPortNumber.GetValue()); 1012cdf0e10cSrcweir m_aNFPortNumber.SetValue(m_iSSLPort); 1013cdf0e10cSrcweir } 1014cdf0e10cSrcweir else 1015cdf0e10cSrcweir { 1016cdf0e10cSrcweir m_iSSLPort = static_cast<sal_Int32>(m_aNFPortNumber.GetValue()); 1017cdf0e10cSrcweir m_aNFPortNumber.SetValue(m_iNormalPort); 1018cdf0e10cSrcweir } 1019cdf0e10cSrcweir } 1020cdf0e10cSrcweir return 0; 1021cdf0e10cSrcweir } 1022cdf0e10cSrcweir 1023cdf0e10cSrcweir // ----------------------------------------------------------------------- fillControls(::std::vector<ISaveValueWrapper * > & _rControlList)1024cdf0e10cSrcweir void OLDAPDetailsPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) 1025cdf0e10cSrcweir { 1026cdf0e10cSrcweir OCommonBehaviourTabPage::fillControls(_rControlList); 1027cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETBaseDN)); 1028cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aCBUseSSL)); 1029cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<NumericField>(&m_aNFPortNumber)); 1030cdf0e10cSrcweir _rControlList.push_back(new OSaveValueWrapper<NumericField>(&m_aNFRowCount)); 1031cdf0e10cSrcweir } 1032cdf0e10cSrcweir // ----------------------------------------------------------------------- fillWindows(::std::vector<ISaveValueWrapper * > & _rControlList)1033cdf0e10cSrcweir void OLDAPDetailsPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) 1034cdf0e10cSrcweir { 1035cdf0e10cSrcweir OCommonBehaviourTabPage::fillWindows(_rControlList); 1036cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aBaseDN)); 1037cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aPortNumber)); 1038cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTRowCount)); 1039cdf0e10cSrcweir _rControlList.push_back(new ODisableWrapper<FixedLine>(&m_aFL_1)); 1040cdf0e10cSrcweir } 1041cdf0e10cSrcweir // ----------------------------------------------------------------------- implInitControls(const SfxItemSet & _rSet,sal_Bool _bSaveValue)1042cdf0e10cSrcweir void OLDAPDetailsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) 1043cdf0e10cSrcweir { 1044cdf0e10cSrcweir // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) 1045cdf0e10cSrcweir sal_Bool bValid, bReadonly; 1046cdf0e10cSrcweir getFlags(_rSet, bValid, bReadonly); 1047cdf0e10cSrcweir 1048cdf0e10cSrcweir 1049cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pBaseDN, SfxStringItem, DSID_CONN_LDAP_BASEDN, sal_True); 1050cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pUseSSL, SfxBoolItem, DSID_CONN_LDAP_USESSL, sal_True); 1051cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, DSID_CONN_LDAP_PORTNUMBER, sal_True); 1052cdf0e10cSrcweir SFX_ITEMSET_GET(_rSet, pRowCount, SfxInt32Item, DSID_CONN_LDAP_ROWCOUNT, sal_True); 1053cdf0e10cSrcweir 1054cdf0e10cSrcweir if ( bValid ) 1055cdf0e10cSrcweir { 1056cdf0e10cSrcweir m_aETBaseDN.SetText(pBaseDN->GetValue()); 1057cdf0e10cSrcweir m_aNFPortNumber.SetValue(pPortNumber->GetValue()); 1058cdf0e10cSrcweir m_aNFRowCount.SetValue(pRowCount->GetValue()); 1059cdf0e10cSrcweir m_aCBUseSSL.Check(pUseSSL->GetValue()); 1060cdf0e10cSrcweir } 1061cdf0e10cSrcweir 1062cdf0e10cSrcweir OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); 1063cdf0e10cSrcweir } 1064cdf0e10cSrcweir 1065cdf0e10cSrcweir 1066cdf0e10cSrcweir //======================================================================== 1067cdf0e10cSrcweir //= OTextDetailsPage 1068cdf0e10cSrcweir //======================================================================== DBG_NAME(OTextDetailsPage)1069cdf0e10cSrcweir DBG_NAME(OTextDetailsPage) 1070cdf0e10cSrcweir //------------------------------------------------------------------------ 1071cdf0e10cSrcweir OTextDetailsPage::OTextDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ) 1072cdf0e10cSrcweir :OCommonBehaviourTabPage(pParent, PAGE_TEXT, _rCoreAttrs, 0, false ) 1073cdf0e10cSrcweir { 1074cdf0e10cSrcweir DBG_CTOR(OTextDetailsPage,NULL); 1075cdf0e10cSrcweir 1076cdf0e10cSrcweir m_pTextConnectionHelper = new OTextConnectionHelper( this, TC_EXTENSION | TC_HEADER | TC_SEPARATORS | TC_CHARSET ); 1077cdf0e10cSrcweir FreeResource(); 1078cdf0e10cSrcweir } 1079cdf0e10cSrcweir 1080cdf0e10cSrcweir // ----------------------------------------------------------------------- ~OTextDetailsPage()1081cdf0e10cSrcweir OTextDetailsPage::~OTextDetailsPage() 1082cdf0e10cSrcweir { 1083cdf0e10cSrcweir DELETEZ(m_pTextConnectionHelper); 1084cdf0e10cSrcweir 1085cdf0e10cSrcweir DBG_DTOR(OTextDetailsPage,NULL); 1086cdf0e10cSrcweir } 1087cdf0e10cSrcweir 1088cdf0e10cSrcweir // ----------------------------------------------------------------------- CreateText(Window * pParent,const SfxItemSet & _rAttrSet)1089cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateText( Window* pParent, const SfxItemSet& _rAttrSet ) 1090cdf0e10cSrcweir { 1091cdf0e10cSrcweir return ( new OTextDetailsPage( pParent, _rAttrSet ) ); 1092cdf0e10cSrcweir } 1093cdf0e10cSrcweir // ----------------------------------------------------------------------- fillControls(::std::vector<ISaveValueWrapper * > & _rControlList)1094cdf0e10cSrcweir void OTextDetailsPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) 1095cdf0e10cSrcweir { 1096cdf0e10cSrcweir OCommonBehaviourTabPage::fillControls(_rControlList); 1097cdf0e10cSrcweir m_pTextConnectionHelper->fillControls(_rControlList); 1098cdf0e10cSrcweir 1099cdf0e10cSrcweir } 1100cdf0e10cSrcweir // ----------------------------------------------------------------------- fillWindows(::std::vector<ISaveValueWrapper * > & _rControlList)1101cdf0e10cSrcweir void OTextDetailsPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) 1102cdf0e10cSrcweir { 1103cdf0e10cSrcweir OCommonBehaviourTabPage::fillWindows(_rControlList); 1104cdf0e10cSrcweir m_pTextConnectionHelper->fillWindows(_rControlList); 1105cdf0e10cSrcweir 1106cdf0e10cSrcweir } 1107cdf0e10cSrcweir // ----------------------------------------------------------------------- implInitControls(const SfxItemSet & _rSet,sal_Bool _bSaveValue)1108cdf0e10cSrcweir void OTextDetailsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) 1109cdf0e10cSrcweir { 1110cdf0e10cSrcweir // first check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) 1111cdf0e10cSrcweir sal_Bool bValid, bReadonly; 1112cdf0e10cSrcweir getFlags(_rSet, bValid, bReadonly); 1113cdf0e10cSrcweir 1114cdf0e10cSrcweir m_pTextConnectionHelper->implInitControls(_rSet, bValid); 1115cdf0e10cSrcweir OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); 1116cdf0e10cSrcweir } 1117cdf0e10cSrcweir 1118cdf0e10cSrcweir // ----------------------------------------------------------------------- FillItemSet(SfxItemSet & rSet)1119cdf0e10cSrcweir sal_Bool OTextDetailsPage::FillItemSet( SfxItemSet& rSet ) 1120cdf0e10cSrcweir { 1121cdf0e10cSrcweir sal_Bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(rSet); 1122cdf0e10cSrcweir bChangedSomething = m_pTextConnectionHelper->FillItemSet(rSet, bChangedSomething); 1123cdf0e10cSrcweir return bChangedSomething; 1124cdf0e10cSrcweir } 1125cdf0e10cSrcweir 1126cdf0e10cSrcweir // ----------------------------------------------------------------------- prepareLeave()1127cdf0e10cSrcweir sal_Bool OTextDetailsPage::prepareLeave() 1128cdf0e10cSrcweir { 1129cdf0e10cSrcweir return m_pTextConnectionHelper->prepareLeave(); 1130cdf0e10cSrcweir } 1131cdf0e10cSrcweir 1132cdf0e10cSrcweir //------------------------------------------------------------------------ CreateGeneratedValuesPage(Window * _pParent,const SfxItemSet & _rAttrSet)1133cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateGeneratedValuesPage( Window* _pParent, const SfxItemSet& _rAttrSet ) 1134cdf0e10cSrcweir { 1135cdf0e10cSrcweir return new GeneratedValuesPage( _pParent, _rAttrSet ); 1136cdf0e10cSrcweir } 1137cdf0e10cSrcweir 1138cdf0e10cSrcweir //------------------------------------------------------------------------ CreateSpecialSettingsPage(Window * _pParent,const SfxItemSet & _rAttrSet)1139cdf0e10cSrcweir SfxTabPage* ODriversSettings::CreateSpecialSettingsPage( Window* _pParent, const SfxItemSet& _rAttrSet ) 1140cdf0e10cSrcweir { 1141cdf0e10cSrcweir ::rtl::OUString eType = ODbDataSourceAdministrationHelper::getDatasourceType( _rAttrSet ); 1142cdf0e10cSrcweir DataSourceMetaData aMetaData( eType ); 1143cdf0e10cSrcweir return new SpecialSettingsPage( _pParent, _rAttrSet, aMetaData ); 1144cdf0e10cSrcweir } 1145cdf0e10cSrcweir //......................................................................... 1146cdf0e10cSrcweir } // namespace dbaui 1147cdf0e10cSrcweir //......................................................................... 1148