/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::sdbc::XConnection; using ::com::sun::star::sdbc::XDriver;
// SpecialSettingsPage struct BooleanSettingDesc
{
std::unique_ptr<weld::CheckButton>& xControl; // the dialog's control which displays this setting
OUString sControlId; // the widget name of the control in the .ui
sal_uInt16 nItemId; // the ID of the item (in an SfxItemSet) which corresponds to this setting bool bInvertedDisplay; // true if and only if the checkbox is checked when the item is sal_False, and vice versa bool bOptionalBool; // type is OptionalBool
};
void SpecialSettingsPage::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
{ for (autoconst& booleanSetting : m_aBooleanSettings)
{ if (booleanSetting.xControl)
{
_rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Toggleable>(booleanSetting.xControl.get()));
}
}
if ( m_bHasBooleanComparisonMode )
_rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::ComboBox>(m_xBooleanComparisonMode.get())); if ( m_bHasMaxRowScan )
_rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::SpinButton>(m_xMaxRowScan.get()));
}
void SpecialSettingsPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
{ // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) bool bValid, bReadonly;
getFlags( _rSet, bValid, bReadonly );
if ( !bValid )
{
OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue); return;
}
m_aTriStates.clear();
// the boolean items for (autoconst& booleanSetting : m_aBooleanSettings)
{ if (!booleanSetting.xControl) continue;
if ( !aValue.has_value() )
{
booleanSetting.xControl->set_state(TRISTATE_INDET);
} else
{ bool bValue = *aValue; if ( booleanSetting.bInvertedDisplay )
bValue = !bValue;
booleanSetting.xControl->set_active(bValue);
} if (bTriState)
m_aTriStates[booleanSetting.xControl.get()] = booleanSetting.xControl->get_state();
}
if (m_xAppendTableAlias && m_xAsBeforeCorrelationName)
{ // make m_xAsBeforeCorrelationName depend on m_xAppendTableAlias
m_xAsBeforeCorrelationName->set_sensitive(m_xAppendTableAlias->get_active());
}
// the non-boolean items if ( m_bHasBooleanComparisonMode )
{ const SfxInt32Item* pBooleanComparison = _rSet.GetItem<SfxInt32Item>(DSID_BOOLEANCOMPARISON);
m_xBooleanComparisonMode->set_active(static_cast<sal_uInt16>(pBooleanComparison->GetValue()));
}
void GeneratedValuesPage::fillControls( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
{
_rControlList.emplace_back( new OSaveValueWidgetWrapper<weld::Toggleable>( m_xAutoRetrievingEnabled.get() ) );
_rControlList.emplace_back( new OSaveValueWidgetWrapper<weld::Entry>( m_xAutoIncrement.get() ) );
_rControlList.emplace_back( new OSaveValueWidgetWrapper<weld::Entry>( m_xAutoRetrieving.get() ) );
}
void GeneratedValuesPage::implInitControls( const SfxItemSet& _rSet, bool _bSaveValue )
{ // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) bool bValid, bReadonly;
getFlags(_rSet, bValid, bReadonly);
// forward the values to the controls if (bValid)
{ bool bEnabled = pAutoRetrieveEnabledItem->GetValue();
m_xAutoRetrievingEnabled->set_active(bEnabled);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.