/* -*- 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 .
*/
void PropertyHandlerHelper::describePropertyLine( const Property& _rProperty,
LineDescriptor& /* [out] */ _out_rDescriptor, const Reference< XPropertyControlFactory >& _rxControlFactory )
{ // display the pure property name - no L10N
_out_rDescriptor.DisplayName = _rProperty.Name;
OSL_PRECOND( _rxControlFactory.is(), "PropertyHandlerHelper::describePropertyLine: no factory -> no control!" ); if ( !_rxControlFactory.is() ) return;
// special handling for booleans (this will become a list) if ( _rProperty.Type.getTypeClass() == TypeClass_BOOLEAN )
{
_out_rDescriptor.Control = createListBoxControl(_rxControlFactory, RID_RSC_ENUM_YESNO, SAL_N_ELEMENTS(RID_RSC_ENUM_YESNO), bReadOnlyControl); return;
}
sal_Int16 nControlType = PropertyControlType::TextField; switch ( _rProperty.Type.getTypeClass() )
{ case TypeClass_BYTE: case TypeClass_SHORT: case TypeClass_UNSIGNED_SHORT: case TypeClass_LONG: case TypeClass_UNSIGNED_LONG: case TypeClass_HYPER: case TypeClass_UNSIGNED_HYPER: case TypeClass_FLOAT: case TypeClass_DOUBLE:
nControlType = PropertyControlType::NumericField; break;
case TypeClass_SEQUENCE:
nControlType = PropertyControlType::StringListField; break;
default:
OSL_FAIL( "PropertyHandlerHelper::describePropertyLine: don't know how to represent this at the UI!" );
[[fallthrough]];
case TypeClass_STRING:
nControlType = PropertyControlType::TextField; break;
}
// create a control
_out_rDescriptor.Control = _rxControlFactory->createPropertyControl( nControlType, bReadOnlyControl );
}
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 ist noch experimentell.