2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 08:36:59 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 08:36:59 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 08:36:59 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 08:36:59 +00:00
|
|
|
* $RCSfile: property.cxx,v $
|
|
|
|
* $Revision: 1.42 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 08:36:59 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 08:36:59 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 08:36:59 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 08:36:59 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 11:22:06 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_toolkit.hxx"
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include <toolkit/helper/property.hxx>
|
|
|
|
#include <toolkit/helper/macros.hxx>
|
|
|
|
#include <osl/mutex.hxx>
|
|
|
|
|
|
|
|
#include <stdlib.h> // qsort/bsearch
|
|
|
|
#include <tools/debug.hxx>
|
|
|
|
#include <com/sun/star/awt/FontWeight.hpp>
|
|
|
|
#include <com/sun/star/awt/FontSlant.hpp>
|
|
|
|
#include <com/sun/star/awt/CharSet.hpp>
|
|
|
|
#include <com/sun/star/awt/FontDescriptor.hpp>
|
|
|
|
#include <com/sun/star/awt/FontWidth.hpp>
|
|
|
|
#include <com/sun/star/awt/FontType.hpp>
|
|
|
|
#include <com/sun/star/awt/FontUnderline.hpp>
|
|
|
|
#include <com/sun/star/awt/FontStrikeout.hpp>
|
|
|
|
#include <com/sun/star/awt/FontPitch.hpp>
|
2007-06-27 11:23:09 +00:00
|
|
|
#include <com/sun/star/awt/tree/XTreeDataModel.hpp>
|
|
|
|
#include <com/sun/star/view/SelectionType.hpp>
|
2005-01-21 15:47:51 +00:00
|
|
|
#include <com/sun/star/style/VerticalAlignment.hpp>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
|
|
|
|
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
2006-10-18 12:15:45 +00:00
|
|
|
#include <com/sun/star/graphic/XGraphic.hpp>
|
2007-01-02 14:35:54 +00:00
|
|
|
#include <com/sun/star/resource/XStringResourceResolver.hpp>
|
2000-11-02 10:12:12 +00:00
|
|
|
#include <comphelper/types.hxx>
|
2003-03-27 16:05:12 +00:00
|
|
|
#include <functional>
|
|
|
|
#include <algorithm>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <toolkit/helper/property.hxx>
|
2005-01-21 15:47:51 +00:00
|
|
|
|
2006-03-14 09:53:54 +00:00
|
|
|
using ::com::sun::star::uno::Any;
|
|
|
|
using ::com::sun::star::uno::Sequence;
|
|
|
|
using ::com::sun::star::uno::Reference;
|
|
|
|
using ::com::sun::star::awt::FontDescriptor;
|
2005-01-21 15:47:51 +00:00
|
|
|
using ::com::sun::star::style::VerticalAlignment;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
struct ImplPropertyInfo
|
|
|
|
{
|
|
|
|
::rtl::OUString aName;
|
|
|
|
sal_uInt16 nPropId;
|
|
|
|
::com::sun::star::uno::Type aType;
|
|
|
|
sal_Int16 nAttribs;
|
|
|
|
sal_Bool bDependsOnOthers; // eg. VALUE depends on MIN/MAX and must be set after MIN/MAX.
|
|
|
|
|
|
|
|
ImplPropertyInfo()
|
|
|
|
{
|
|
|
|
nPropId = 0;
|
|
|
|
nAttribs = 0;
|
|
|
|
bDependsOnOthers = sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
ImplPropertyInfo( const sal_Unicode* pName, sal_uInt16 nId, const ::com::sun::star::uno::Type& rType,
|
|
|
|
sal_Int16 nAttrs, sal_Bool bDepends = sal_False )
|
|
|
|
: aName( pName )
|
|
|
|
{
|
|
|
|
nPropId = nId;
|
|
|
|
aType = rType;
|
|
|
|
nAttribs = nAttrs;
|
|
|
|
bDependsOnOthers = bDepends;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2006-03-14 09:53:54 +00:00
|
|
|
#define DECL_PROP_1( asciiname, id, type, attrib1 ) \
|
|
|
|
ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1 )
|
|
|
|
#define DECL_PROP_2( asciiname, id, type, attrib1, attrib2 ) \
|
|
|
|
ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1 | ::com::sun::star::beans::PropertyAttribute::attrib2 )
|
|
|
|
#define DECL_PROP_3( asciiname, id, type, attrib1, attrib2, attrib3 ) \
|
|
|
|
ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1 | ::com::sun::star::beans::PropertyAttribute::attrib2 | ::com::sun::star::beans::PropertyAttribute::attrib3 )
|
2008-12-16 13:30:53 +00:00
|
|
|
#define DECL_PROP_4( asciiname, id, type, attrib1, attrib2, attrib3, attrib4 ) \
|
|
|
|
ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1 | ::com::sun::star::beans::PropertyAttribute::attrib2 | ::com::sun::star::beans::PropertyAttribute::attrib3 | ::com::sun::star::beans::PropertyAttribute::attrib4 )
|
2006-03-14 09:53:54 +00:00
|
|
|
|
|
|
|
#define DECL_DEP_PROP_1( asciiname, id, type, attrib1 ) \
|
|
|
|
ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1, sal_True )
|
|
|
|
#define DECL_DEP_PROP_2( asciiname, id, type, attrib1, attrib2 ) \
|
|
|
|
ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1 | ::com::sun::star::beans::PropertyAttribute::attrib2, sal_True )
|
|
|
|
#define DECL_DEP_PROP_3( asciiname, id, type, attrib1, attrib2, attrib3 ) \
|
|
|
|
ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1 | ::com::sun::star::beans::PropertyAttribute::attrib2 | ::com::sun::star::beans::PropertyAttribute::attrib3, sal_True )
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
|
|
|
|
{
|
|
|
|
static ImplPropertyInfo* pPropertyInfos = NULL;
|
|
|
|
static sal_uInt16 nElements = 0;
|
|
|
|
if( !pPropertyInfos )
|
|
|
|
{
|
|
|
|
::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
|
|
|
|
if( !pPropertyInfos )
|
|
|
|
{
|
|
|
|
static ImplPropertyInfo __FAR_DATA aImplPropertyInfos [] =
|
|
|
|
{
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_PROP_2 ( "AccessibleName", ACCESSIBLENAME, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "Align", ALIGN, sal_Int16, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "Autocomplete", AUTOCOMPLETE, bool, BOUND, MAYBEDEFAULT ),
|
2007-07-06 13:28:22 +00:00
|
|
|
DECL_PROP_2 ( "AutoHScroll", AUTOHSCROLL, bool, BOUND, MAYBEDEFAULT ),
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_PROP_1 ( "AutoMnemonics", AUTOMNEMONICS, bool, BOUND ),
|
|
|
|
DECL_PROP_2 ( "AutoToggle", AUTOTOGGLE, bool, BOUND, MAYBEDEFAULT ),
|
2007-07-06 13:28:22 +00:00
|
|
|
DECL_PROP_2 ( "AutoVScroll", AUTOVSCROLL, bool, BOUND, MAYBEDEFAULT ),
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_PROP_3 ( "BackgroundColor", BACKGROUNDCOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_DEP_PROP_2 ( "BlockIncrement", BLOCKINCREMENT, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "Border", BORDER, sal_Int16, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_DEP_PROP_3 ( "BorderColor", BORDERCOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "Closeable", CLOSEABLE, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "CurrencySymbol", CURRENCYSYMBOL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
2008-01-14 11:58:28 +00:00
|
|
|
DECL_PROP_2 ( "CustomUnitText", CUSTOMUNITTEXT, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_DEP_PROP_3 ( "Date", DATE, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "DateFormat", EXTDATEFORMAT, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "DateMax", DATEMAX, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "DateMin", DATEMIN, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "DateShowCentury", DATESHOWCENTURY, bool, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "DecimalAccuracy", DECIMALACCURACY, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "DefaultButton", DEFAULTBUTTON, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "DefaultControl", DEFAULTCONTROL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
2007-07-06 13:28:22 +00:00
|
|
|
DECL_PROP_2 ( "DesktopAsParent", DESKTOP_AS_PARENT, bool, BOUND, MAYBEDEFAULT ),
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_PROP_2 ( "DisplayBackgroundColor", DISPLAYBACKGROUNDCOLOR, sal_Int32, BOUND, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "Dropdown", DROPDOWN, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "EchoChar", ECHOCHAR, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "EditMask", EDITMASK, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "EffectiveDefault", EFFECTIVE_DEFAULT, Any, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_3 ( "EffectiveMax", EFFECTIVE_MAX, double, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_3 ( "EffectiveMin", EFFECTIVE_MIN, double, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_DEP_PROP_3 ( "EffectiveValue", EFFECTIVE_VALUE, Any, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "Enabled", ENABLED, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "EnforceFormat", ENFORCE_FORMAT, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "FillColor", FILLCOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "FocusOnClick", FOCUSONCLICK, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontRelief", FONTRELIEF, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontEmphasisMark", FONTEMPHASISMARK, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontDescriptor", FONTDESCRIPTOR, FontDescriptor, BOUND, MAYBEDEFAULT ),
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Teile des ::com::sun::star::awt::FontDescriptor
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_PROP_2 ( "FontName", FONTDESCRIPTORPART_NAME, ::rtl::OUString,BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontStyleName", FONTDESCRIPTORPART_STYLENAME, ::rtl::OUString,BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontFamily", FONTDESCRIPTORPART_FAMILY, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontCharset", FONTDESCRIPTORPART_CHARSET, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontHeight", FONTDESCRIPTORPART_HEIGHT, float, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontWidth", FONTDESCRIPTORPART_WIDTH, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontPitch", FONTDESCRIPTORPART_PITCH, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontWeight", FONTDESCRIPTORPART_WEIGHT, float, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontCharWidth", FONTDESCRIPTORPART_CHARWIDTH, float, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontOrientation", FONTDESCRIPTORPART_ORIENTATION, float, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontSlant", FONTDESCRIPTORPART_SLANT, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontUnderline", FONTDESCRIPTORPART_UNDERLINE, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontStrikeout", FONTDESCRIPTORPART_STRIKEOUT, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontKerning", FONTDESCRIPTORPART_KERNING, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontWordLineMode", FONTDESCRIPTORPART_WORDLINEMODE, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "FontType", FONTDESCRIPTORPART_TYPE, sal_Int16, BOUND, MAYBEDEFAULT ),
|
2004-05-19 12:44:49 +00:00
|
|
|
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_PROP_3 ( "FormatKey", FORMATKEY, sal_Int32, BOUND, MAYBEVOID, TRANSIENT ),
|
|
|
|
DECL_PROP_3 ( "FormatsSupplier", FORMATSSUPPLIER, Reference< ::com::sun::star::util::XNumberFormatsSupplier >, BOUND, MAYBEVOID, TRANSIENT ),
|
2004-05-19 12:44:49 +00:00
|
|
|
|
2006-10-18 12:15:45 +00:00
|
|
|
DECL_PROP_2 ( "Graphic", GRAPHIC, Reference< ::com::sun::star::graphic::XGraphic >, BOUND, TRANSIENT ),
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_PROP_2 ( "HelpText", HELPTEXT, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "HelpURL", HELPURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "HideInactiveSelection", HIDEINACTIVESELECTION, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "HScroll", HSCROLL, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "HardLineBreaks", HARDLINEBREAKS, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "ImageAlign", IMAGEALIGN, sal_Int16, BOUND, MAYBEDEFAULT),
|
|
|
|
DECL_PROP_2 ( "ImagePosition", IMAGEPOSITION, sal_Int16, BOUND, MAYBEDEFAULT),
|
|
|
|
DECL_PROP_2 ( "ImageURL", IMAGEURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "Label", LABEL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "LineColor", LINECOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "LineCount", LINECOUNT, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "LineEndFormat", LINE_END_FORMAT, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_DEP_PROP_2 ( "LineIncrement", LINEINCREMENT, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "LiteralMask", LITERALMASK, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "LiveScroll", LIVE_SCROLL, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "MaxTextLen", MAXTEXTLEN, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "Moveable", MOVEABLE, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_1 ( "MouseTransparent", MOUSETRANSPARENT, bool, BOUND ),
|
|
|
|
DECL_PROP_2 ( "MultiLine", MULTILINE, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "MultiSelection", MULTISELECTION, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "NativeWidgetLook", NATIVE_WIDGET_LOOK, bool, BOUND, MAYBEDEFAULT ),
|
2008-12-16 13:30:53 +00:00
|
|
|
DECL_PROP_2 ( "NoLabel", NOLABEL, bool, BOUND, MAYBEDEFAULT ),
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_PROP_2 ( "Orientation", ORIENTATION, sal_Int32, BOUND, MAYBEDEFAULT ),
|
2007-07-06 13:28:22 +00:00
|
|
|
DECL_PROP_2 ( "PaintTransparent", PAINTTRANSPARENT, bool, BOUND, MAYBEDEFAULT ),
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_PROP_2 ( "PluginParent", PLUGINPARENT, sal_Int64, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "PrependCurrencySymbol", CURSYM_POSITION, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "Printable", PRINTABLE, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_DEP_PROP_3 ( "ProgressValue", PROGRESSVALUE, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "ProgressValueMax", PROGRESSVALUE_MAX, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "ProgressValueMin", PROGRESSVALUE_MIN, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "PushButtonType", PUSHBUTTONTYPE, sal_Int16, BOUND, MAYBEDEFAULT),
|
|
|
|
DECL_PROP_2 ( "ReadOnly", READONLY, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "Repeat", REPEAT, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "RepeatDelay", REPEAT_DELAY, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "ScaleImage", SCALEIMAGE, bool, BOUND, MAYBEDEFAULT ),
|
2008-12-01 12:31:27 +00:00
|
|
|
DECL_PROP_2 ( "ScaleMode", IMAGE_SCALE_MODE, sal_Int16, BOUND, MAYBEDEFAULT ),
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_DEP_PROP_3 ( "ScrollValue", SCROLLVALUE, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "ScrollValueMax", SCROLLVALUE_MAX, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "ScrollValueMin", SCROLLVALUE_MIN, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "SelectedItems", SELECTEDITEMS, Sequence<sal_Int16>, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "ShowThousandsSeparator", NUMSHOWTHOUSANDSEP, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "Sizeable", SIZEABLE, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "Spin", SPIN, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "SpinIncrement", SPININCREMENT, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_DEP_PROP_2 ( "SpinValue", SPINVALUE, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "SpinValueMax", SPINVALUE_MAX, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "SpinValueMin", SPINVALUE_MIN, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_DEP_PROP_2 ( "State", STATE, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "StrictFormat", STRICTFORMAT, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "StringItemList", STRINGITEMLIST, Sequence< ::rtl::OUString >, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "VisualEffect", VISUALEFFECT, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "SymbolColor", SYMBOL_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_3 ( "Tabstop", TABSTOP, bool, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "Text", TEXT, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "TextColor", TEXTCOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_3 ( "TextLineColor", TEXTLINECOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_DEP_PROP_3 ( "Time", TIME, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "TimeFormat", EXTTIMEFORMAT, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "TimeMax", TIMEMAX, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "TimeMin", TIMEMIN, sal_Int32, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "Title", TITLE, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "Toggle", TOGGLE, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "TreatAsNumber", TREATASNUMBER, bool, BOUND, MAYBEDEFAULT,TRANSIENT ),
|
|
|
|
DECL_PROP_2 ( "TriState", TRISTATE, bool, BOUND, MAYBEDEFAULT ),
|
2008-01-14 11:58:28 +00:00
|
|
|
DECL_PROP_2 ( "Unit", UNIT, sal_Int16, BOUND, MAYBEDEFAULT ),
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_PROP_2 ( "VScroll", VSCROLL, bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_DEP_PROP_3 ( "Value", VALUE_DOUBLE, double, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "ValueMax", VALUEMAX_DOUBLE, double, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "ValueMin", VALUEMIN_DOUBLE, double, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "ValueStep", VALUESTEP_DOUBLE, double, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "VerticalAlign", VERTICALALIGN, VerticalAlignment, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
2006-05-04 07:26:53 +00:00
|
|
|
DECL_DEP_PROP_3 ( "VisibleSize", VISIBLESIZE, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
2004-05-19 12:44:49 +00:00
|
|
|
|
2006-03-14 09:53:54 +00:00
|
|
|
DECL_PROP_2 ( "Activated", ACTIVATED, sal_Bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "Complete", COMPLETE, sal_Bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "CurrentItemID", CURRENTITEMID, sal_Int16, BOUND, MAYBEDEFAULT ),
|
2004-05-19 12:44:49 +00:00
|
|
|
|
2006-05-04 07:26:53 +00:00
|
|
|
DECL_PROP_2 ( "WheelWithoutFocus", WHEELWITHOUTFOCUS, sal_Bool, BOUND, MAYBEDEFAULT ),
|
2006-12-20 12:54:10 +00:00
|
|
|
DECL_PROP_2 ( "StepTime", STEP_TIME, sal_Int32, BOUND, MAYBEDEFAULT ),
|
2007-06-20 09:26:57 +00:00
|
|
|
DECL_PROP_2 ( "Decoration", DECORATION, sal_Bool, BOUND, MAYBEDEFAULT ),
|
2006-05-04 07:26:53 +00:00
|
|
|
|
2007-06-27 11:23:09 +00:00
|
|
|
DECL_PROP_2 ( "SelectionType", TREE_SELECTIONTYPE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "Editable", TREE_EDITABLE, sal_Bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "DataModel", TREE_DATAMODEL, Reference< ::com::sun::star::awt::tree::XTreeDataModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
|
|
|
DECL_PROP_2 ( "RootDisplayed", TREE_ROOTDISPLAYED, sal_Bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "ShowsHandles", TREE_SHOWSHANDLES, sal_Bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "ShowsRootHandles", TREE_SHOWSROOTHANDLES, sal_Bool, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "RowHeight", TREE_ROWHEIGHT, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
|
2007-11-26 15:28:07 +00:00
|
|
|
DECL_PROP_2 ( "InvokesStopNodeEditing", TREE_INVOKESSTOPNODEEDITING, sal_Bool, BOUND, MAYBEDEFAULT ),
|
2008-01-29 14:07:23 +00:00
|
|
|
DECL_PROP_2 ( "DialogSourceURL", DIALOGSOURCEURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
2008-12-16 13:30:53 +00:00
|
|
|
DECL_PROP_2 ( "URL", URL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_2 ( "WritingMode", WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT ),
|
|
|
|
DECL_PROP_3 ( "ContextWritingMode", CONTEXT_WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT, TRANSIENT )
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
pPropertyInfos = aImplPropertyInfos;
|
|
|
|
nElements = sizeof( aImplPropertyInfos ) / sizeof( ImplPropertyInfo );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rElementCount = nElements;
|
|
|
|
return pPropertyInfos;
|
|
|
|
}
|
|
|
|
|
2003-03-27 16:05:12 +00:00
|
|
|
|
|
|
|
struct ImplPropertyInfoCompareFunctor : ::std::binary_function<ImplPropertyInfo,::rtl::OUString,bool>
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2003-03-27 16:05:12 +00:00
|
|
|
inline bool operator()(const ImplPropertyInfo& lhs,const ImplPropertyInfo& rhs) const
|
|
|
|
{
|
|
|
|
return lhs.aName.compareTo(rhs.aName) < 0;
|
|
|
|
}
|
|
|
|
inline bool operator()(const ImplPropertyInfo& lhs,const ::rtl::OUString& rhs) const
|
|
|
|
{
|
|
|
|
return lhs.aName.compareTo(rhs) < 0;
|
|
|
|
}
|
|
|
|
inline bool operator()(const ::rtl::OUString& lhs,const ImplPropertyInfo& rhs) const
|
|
|
|
{
|
|
|
|
return lhs.compareTo(rhs.aName) < 0;
|
|
|
|
}
|
|
|
|
};
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
void ImplAssertValidPropertyArray()
|
|
|
|
{
|
|
|
|
static sal_Bool bSorted = sal_False;
|
|
|
|
if( !bSorted )
|
|
|
|
{
|
|
|
|
sal_uInt16 nElements;
|
|
|
|
ImplPropertyInfo* pInfos = ImplGetPropertyInfos( nElements );
|
2003-03-27 16:05:12 +00:00
|
|
|
::std::sort(pInfos, pInfos+nElements,ImplPropertyInfoCompareFunctor());
|
2000-09-18 16:07:07 +00:00
|
|
|
bSorted = sal_True;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_uInt16 GetPropertyId( const ::rtl::OUString& rPropertyName )
|
|
|
|
{
|
|
|
|
ImplAssertValidPropertyArray();
|
|
|
|
|
|
|
|
sal_uInt16 nElements;
|
|
|
|
ImplPropertyInfo* pInfos = ImplGetPropertyInfos( nElements );
|
2003-03-27 16:05:12 +00:00
|
|
|
ImplPropertyInfo* pInf = ::std::lower_bound(pInfos,pInfos+nElements,rPropertyName,ImplPropertyInfoCompareFunctor());
|
|
|
|
/*
|
|
|
|
(ImplPropertyInfo*)
|
2000-09-18 16:07:07 +00:00
|
|
|
bsearch( &aSearch, pInfos, nElements, sizeof( ImplPropertyInfo ), ImplPropertyInfoCompare );
|
2003-03-27 16:05:12 +00:00
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2003-03-27 16:05:12 +00:00
|
|
|
return ( pInf && pInf != (pInfos+nElements) && pInf->aName == rPropertyName) ? pInf->nPropId: 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const ImplPropertyInfo* ImplGetImplPropertyInfo( sal_uInt16 nPropertyId )
|
|
|
|
{
|
|
|
|
ImplAssertValidPropertyArray();
|
|
|
|
|
|
|
|
sal_uInt16 nElements;
|
|
|
|
ImplPropertyInfo* pInfos = ImplGetPropertyInfos( nElements );
|
2003-03-27 16:05:12 +00:00
|
|
|
sal_uInt16 n;
|
|
|
|
for ( n = 0; n < nElements && pInfos[n].nPropId != nPropertyId; ++n)
|
|
|
|
;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2003-03-27 16:05:12 +00:00
|
|
|
return (n < nElements) ? &pInfos[n] : NULL;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_uInt16 GetPropertyOrderNr( sal_uInt16 nPropertyId )
|
|
|
|
{
|
|
|
|
ImplAssertValidPropertyArray();
|
|
|
|
|
|
|
|
sal_uInt16 nElements;
|
|
|
|
ImplPropertyInfo* pInfos = ImplGetPropertyInfos( nElements );
|
|
|
|
for ( sal_uInt16 n = nElements; n; )
|
|
|
|
{
|
|
|
|
if ( pInfos[--n].nPropId == nPropertyId )
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
return 0xFFFF;
|
|
|
|
}
|
|
|
|
|
|
|
|
const ::rtl::OUString& GetPropertyName( sal_uInt16 nPropertyId )
|
|
|
|
{
|
|
|
|
const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
|
|
|
|
DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
|
|
|
|
return pImplPropertyInfo->aName;
|
|
|
|
}
|
|
|
|
|
|
|
|
const ::com::sun::star::uno::Type* GetPropertyType( sal_uInt16 nPropertyId )
|
|
|
|
{
|
|
|
|
const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
|
|
|
|
DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
|
|
|
|
return pImplPropertyInfo ? &pImplPropertyInfo->aType : NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int16 GetPropertyAttribs( sal_uInt16 nPropertyId )
|
|
|
|
{
|
|
|
|
const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
|
|
|
|
DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
|
2006-06-19 22:05:47 +00:00
|
|
|
return pImplPropertyInfo ? pImplPropertyInfo->nAttribs : 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool DoesDependOnOthers( sal_uInt16 nPropertyId )
|
|
|
|
{
|
|
|
|
const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
|
|
|
|
DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
|
|
|
|
return pImplPropertyInfo ? pImplPropertyInfo->bDependsOnOthers : sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CompareProperties( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 )
|
|
|
|
{
|
2000-11-02 10:12:12 +00:00
|
|
|
return ::comphelper::compare( r1, r2 );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|