/* -*- 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 .
*/
/** adds a control with the given name to the list @param _rxControl the control to add. Must not be <NULL/> @param _pBName the name of the control, or <NULL/> if an automatic name should be generated @return the identifier of the newly added control
*/
ControlIdentifier addControl( const uno::Reference< awt::XControl >& _rxControl, const OUString* _pName );
/** determines whether or not the list is empty
*/ bool empty() const { return maControls.empty(); }
/** retrieves all controls currently in the list
*/ void getControls( uno::Sequence< uno::Reference< awt::XControl > >& _out_rControls ) const;
/** retrieves all identifiers of all controls currently in the list
*/ void getIdentifiers( uno::Sequence< sal_Int32 >& _out_rIdentifiers ) const;
/** returns the first control which is registered under the given name
*/
uno::Reference< awt::XControl >
getControlForName( const OUString& _rName ) const;
/** returns the identifier which a control is registered for, or -1 if the control isn't registered
*/
ControlIdentifier
getControlIdentifier( const uno::Reference< awt::XControl >& _rxControl );
/** retrieves the control for a given id @param _nIdentifier the identifier for the control @param _out_rxControl takes the XControl upon successful return @return <TRUE/> if and only if a control with the given id is part of the list
*/ bool getControlForIdentifier( ControlIdentifier _nIdentifier, uno::Reference< awt::XControl >& _out_rxControl ) const;
/** removes a control from the list, given by id @param _nId The identifier of the control to remove.
*/ void removeControlById( ControlIdentifier _nId );
/** replaces a control from the list with another one @param _nId The identifier of the control to replace @param _rxNewControl the new control to put into the list
*/ void replaceControlById( ControlIdentifier _nId, const uno::Reference< awt::XControl >& _rxNewControl );
private: /** adds a control @param _rxControl the control to add to the container @param _pName pointer to the name of the control. Might be <NULL/>, in this case, a name is generated. @return the identifier of the newly inserted control
*/
ControlIdentifier impl_addControl( const uno::Reference< awt::XControl >& _rxControl, const OUString* _pName
);
/** finds a free identifier @throw uno::RuntimeException if no free identifier can be found
*/
ControlIdentifier impl_getFreeIdentifier_throw();
/** finds a free name @throw uno::RuntimeException if no free name can be found
*/
OUString impl_getFreeName_throw();
};
void SAL_CALL DialogStepChangedListener::propertyChange( const beans::PropertyChangeEvent& evt )
{ // evt.PropertyName HAS to be "Step" because we only use the listener for that
sal_Int32 nDialogStep = 0;
evt.NewValue >>= nDialogStep;
implUpdateVisibility( nDialogStep, mxControlContainer );
}
lang::EventObject aDisposeEvent;
aDisposeEvent.Source = static_cast< uno::XAggregation* >( this );
// Notify listeners about disposal of this Container (This is much faster if they // listen on the controls and the container).
maDisposeListeners.disposeAndClear( aDisposeEvent );
maCListeners.disposeAndClear( aDisposeEvent );
uno::Reference< awt::XControl > xControl; if ( !mpControls->getControlForIdentifier( _nIdentifier, xControl ) ) throw container::NoSuchElementException(
u"There is no element with the given identifier."_ustr,
*this
);
uno::Reference< awt::XControl > xExistentControl; if ( !mpControls->getControlForIdentifier( _nIdentifier, xExistentControl ) ) throw container::NoSuchElementException(
u"There is no element with the given identifier."_ustr,
*this
);
uno::Reference< awt::XControl > xNewControl; if ( !( _rElement >>= xNewControl ) ) throw lang::IllegalArgumentException(
u"Elements must support the XControl interface."_ustr,
*this,
1
);
void UnoControlContainer::PrepareWindowDescriptor( css::awt::WindowDescriptor& rDesc )
{ // HACK due to the fact that we can't really use VSCROLL & HSCROLL // for Dialog ( css::awt::VclWindowPeerAttribute::VSCROLL // has the same value as // css::awt::WindowAttribute::NODECORATION ) // For convenience in the PropBrowse using HSCROLL and VSCROLL ensures // the Correct text. We exchange them here and the control knows // about this hack ( it sucks badly I know ) if ( rDesc.WindowAttributes & css::awt::VclWindowPeerAttribute::VSCROLL )
{
rDesc.WindowAttributes &= ~css::awt::VclWindowPeerAttribute::VSCROLL;
rDesc.WindowAttributes |= css::awt::VclWindowPeerAttribute::AUTOVSCROLL;
} if ( rDesc.WindowAttributes & css::awt::VclWindowPeerAttribute::HSCROLL )
{
rDesc.WindowAttributes &= ~css::awt::VclWindowPeerAttribute::HSCROLL;
rDesc.WindowAttributes |= css::awt::VclWindowPeerAttribute::AUTOHSCROLL;
}
}
¤ 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.0.19Bemerkung:
(vorverarbeitet)
¤
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.