From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- .../sun/star/inspection/DefaultHelpProvider.idl | 58 +++ .../sun/star/inspection/GenericPropertyHandler.idl | 51 +++ .../star/inspection/InteractiveSelectionResult.idl | 66 +++ offapi/com/sun/star/inspection/LineDescriptor.idl | 189 +++++++++ offapi/com/sun/star/inspection/ObjectInspector.idl | 96 +++++ .../sun/star/inspection/ObjectInspectorModel.idl | 106 +++++ .../star/inspection/PropertyCategoryDescriptor.idl | 57 +++ .../sun/star/inspection/PropertyControlType.idl | 144 +++++++ .../sun/star/inspection/PropertyLineElement.idl | 51 +++ .../sun/star/inspection/StringRepresentation.idl | 37 ++ .../com/sun/star/inspection/XHyperlinkControl.idl | 55 +++ offapi/com/sun/star/inspection/XNumericControl.idl | 82 ++++ .../com/sun/star/inspection/XObjectInspector.idl | 117 ++++++ .../sun/star/inspection/XObjectInspectorModel.idl | 178 ++++++++ .../com/sun/star/inspection/XObjectInspectorUI.idl | 169 ++++++++ .../com/sun/star/inspection/XPropertyControl.idl | 106 +++++ .../star/inspection/XPropertyControlContext.idl | 48 +++ .../star/inspection/XPropertyControlFactory.idl | 69 ++++ .../star/inspection/XPropertyControlObserver.idl | 63 +++ .../com/sun/star/inspection/XPropertyHandler.idl | 447 +++++++++++++++++++++ .../com/sun/star/inspection/XStringListControl.idl | 61 +++ .../sun/star/inspection/XStringRepresentation.idl | 59 +++ 22 files changed, 2309 insertions(+) create mode 100644 offapi/com/sun/star/inspection/DefaultHelpProvider.idl create mode 100644 offapi/com/sun/star/inspection/GenericPropertyHandler.idl create mode 100644 offapi/com/sun/star/inspection/InteractiveSelectionResult.idl create mode 100644 offapi/com/sun/star/inspection/LineDescriptor.idl create mode 100644 offapi/com/sun/star/inspection/ObjectInspector.idl create mode 100644 offapi/com/sun/star/inspection/ObjectInspectorModel.idl create mode 100644 offapi/com/sun/star/inspection/PropertyCategoryDescriptor.idl create mode 100644 offapi/com/sun/star/inspection/PropertyControlType.idl create mode 100644 offapi/com/sun/star/inspection/PropertyLineElement.idl create mode 100644 offapi/com/sun/star/inspection/StringRepresentation.idl create mode 100644 offapi/com/sun/star/inspection/XHyperlinkControl.idl create mode 100644 offapi/com/sun/star/inspection/XNumericControl.idl create mode 100644 offapi/com/sun/star/inspection/XObjectInspector.idl create mode 100644 offapi/com/sun/star/inspection/XObjectInspectorModel.idl create mode 100644 offapi/com/sun/star/inspection/XObjectInspectorUI.idl create mode 100644 offapi/com/sun/star/inspection/XPropertyControl.idl create mode 100644 offapi/com/sun/star/inspection/XPropertyControlContext.idl create mode 100644 offapi/com/sun/star/inspection/XPropertyControlFactory.idl create mode 100644 offapi/com/sun/star/inspection/XPropertyControlObserver.idl create mode 100644 offapi/com/sun/star/inspection/XPropertyHandler.idl create mode 100644 offapi/com/sun/star/inspection/XStringListControl.idl create mode 100644 offapi/com/sun/star/inspection/XStringRepresentation.idl (limited to 'offapi/com/sun/star/inspection') diff --git a/offapi/com/sun/star/inspection/DefaultHelpProvider.idl b/offapi/com/sun/star/inspection/DefaultHelpProvider.idl new file mode 100644 index 000000000..5c2be9aa7 --- /dev/null +++ b/offapi/com/sun/star/inspection/DefaultHelpProvider.idl @@ -0,0 +1,58 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_inspection_DefaultHelpProvider_idl__ +#define __com_sun_star_inspection_DefaultHelpProvider_idl__ + +#include + + +module com { module sun { module star { module inspection { + +interface XObjectInspectorUI; + + +/** implements a component which can default-fill the help section of an + ObjectInspector. + +

The component registers a XPropertyControlObserver at an + XObjectInspectoryUI interface. Whenever it then is notified + of a XPropertyControl getting the focus, it will try to deduce + the extended help text of this control's window, and set this help text at the + object inspector's help section.

+ */ +service DefaultHelpProvider : com::sun::star::uno::XInterface +{ + /** creates a help provider instance + @param InspectorUI + provides access to the UI of the ObjectInspector which should be + observed. Must not be `NULL`. + @throws ::com::sun::star::lang::IllegalArgumentException + if the given inspector UI is `NULL`. + */ + create( [in] XObjectInspectorUI InspectorUI ) + raises ( ::com::sun::star::lang::IllegalArgumentException ); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/GenericPropertyHandler.idl b/offapi/com/sun/star/inspection/GenericPropertyHandler.idl new file mode 100644 index 000000000..a399885ac --- /dev/null +++ b/offapi/com/sun/star/inspection/GenericPropertyHandler.idl @@ -0,0 +1,51 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_GenericPropertyHandler_idl__ +#define __com_sun_star_inspection_GenericPropertyHandler_idl__ + +#include + +module com { module sun { module star { module inspection { + +/** implements a general-purpose XPropertyHandler + +

The property handler implemented by this service will do an introspection + on the provided components, and expose the properties obtained via + XIntrospectionAccess::getProperties.

+ +

The handler will automatically determine the best type of property control + to represent a certain property, depending on the property type. This includes, + for example, list box controls to represent enumeration properties.

+ + @see XPropertyHandler + @see scom::sun::star::beans::XIntrospectionAccess + @see XPropertyControl + + @since OOo 2.0.3 +*/ +service GenericPropertyHandler : XPropertyHandler; + + +}; }; }; }; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/InteractiveSelectionResult.idl b/offapi/com/sun/star/inspection/InteractiveSelectionResult.idl new file mode 100644 index 000000000..028a1697f --- /dev/null +++ b/offapi/com/sun/star/inspection/InteractiveSelectionResult.idl @@ -0,0 +1,66 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_inspection_InteractiveSelectionResult_idl__ +#define __com_sun_star_inspection_InteractiveSelectionResult_idl__ + +module com { module sun { module star { module inspection { + +/** describes possible results of an interactive selection of a property value + in an object inspector + + @see XPropertyHandler::onInteractivePropertySelection + + @since OOo 2.0.3 +*/ +enum InteractiveSelectionResult +{ + /** The interactive selection of a property value was canceled. + */ + Cancelled, + + /** The interactive selection of a property value succeeded, and the + new property value chosen by the user has already been set at the + inspected component. + */ + Success, + + /** The interactive selection of a property value succeeded, a new + property value has been obtained, but not yet set at the inspected + component. + +

In this case, the obtained value is passed to the caller of + XPropertyHandler::onInteractivePropertySelection(), which is + responsible for forwarding this value to the inspected component.

+ */ + ObtainedValue, + + /** The interactive selection of a property value is still pending. + +

This is usually used when this selection involves non-modal user interface.

+ */ + Pending +}; + + +}; }; }; }; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/LineDescriptor.idl b/offapi/com/sun/star/inspection/LineDescriptor.idl new file mode 100644 index 000000000..93fc05cae --- /dev/null +++ b/offapi/com/sun/star/inspection/LineDescriptor.idl @@ -0,0 +1,189 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_LineDescriptor_idl__ +#define __com_sun_star_inspection_LineDescriptor_idl__ + +#include + +module com { module sun { module star { module inspection { + +interface XPropertyControl; + +/** describes the appearance of a line representing a single property in an ObjectInspector. + + Such a line consists of +
  • a label with a human-readable name for the property
  • +
  • a control which is used for user interaction - i.e. it displays the current property + value, and allows the user entering a new one.
  • +
  • (optional) one or two buttons which, when clicked, can start a more complex, interactive + property value input. For instance, if you have a property whose value is a path in the + file system, such a button could be used to let the user browse for a path with a + usual file picker.
  • +
+ + @see XPropertyHandler::describePropertyLine + @see PropertyLineElement + + @since OOo 2.0.3 +*/ +struct LineDescriptor +{ + /** denotes the human-readable display name used to present a property to the user + */ + string DisplayName; + + /** denotes the control which should be used to represent the property at the UI. + + @see XPropertyControlFactory + */ + XPropertyControl Control; + + /** specifies the URL to the help topic to be associated with the property + */ + string HelpURL; + + /** determines whether a button exists which can be used for a more complex, interactive + property value input. + +

If no image for the primary button is specified, but a primary button is present, + the three dots will be displayed on the button.

+ + @see XPropertyHandler::onInteractivePropertySelection + @see HasSecondaryButton + @see PrimaryButtonImageURL + @see PrimaryButtonImage + */ + boolean HasPrimaryButton; + + /** describes a unique id to associate with the primary button + +

In OpenOffice.org, UI elements sometimes require a so-called UniqueID, which can be + used to uniquely (within the whole application) identify this UI element. For instance, + automating the OpenOffice.org UI via a dedicated separate application ("TestTool") requires + such IDs.

+ +

If a primary button exists for a property's UI representation (#HasPrimaryButton), + it gets the ID specified herein.

+ */ + string PrimaryButtonId; + + /** describes the URL of an image to display on the primary button, if any. + +

This URL will be used to obtain an actual com::sun::star::graphic::XGraphic + object from a com::sun::star::graphic::GraphicProvider.

+ +

The property will be ignored if #HasPrimaryButton is `FALSE`.

+ +

If you need to specify a graphic which does not have a URL, but is available as + com::sun::star::graphic::XGraphic only, then you must leave + PrimaryButtonImageURL empty, and use the #PrimaryButtonImage property. + + @see PrimaryButtonImage + */ + string PrimaryButtonImageURL; + + /** describes a graphics to display at the primary button, if any. + +

The property will be ignored if #HasPrimaryButton is `FALSE`, or + if #PrimaryButtonImageURL is a non-empty string.

+ + @see HasPrimaryButton + @see PrimaryButtonImageURL + */ + com::sun::star::graphic::XGraphic PrimaryButtonImage; + + /** determines whether a secondary button exists which can be used for a more complex, interactive + property value input. + +

A secondary button subordinated to the primary button. If no primary button exists + (#HasPrimaryButton), this member is ignored.

+ + @see XPropertyHandler::onInteractivePropertySelection + @see HasSecondaryButton + */ + boolean HasSecondaryButton; + + /** describes a unique id to associate with the primary button + +

If a secondary button exists for a property's UI representation (#HasSecondaryButton), + it gets the ID specified herein.

+ + @see PrimaryButtonId + */ + string SecondaryButtonId; + + /** describes the URL of an image to display on the secondary button, if any. + +

This URL will be used to obtain an actual com::sun::star::graphic::XGraphic + object from a com::sun::star::graphic::GraphicProvider.

+ +

The property will be ignored if #HasSecondaryButton is `FALSE`.

+ +

If you need to specify a graphic which does not have a URL, but is available as + com::sun::star::graphic::XGraphic only, then you must leave + SecondaryButtonImageURL empty, and use the #SecondaryButtonImage property. + + @see SecondaryButtonImage + */ + string SecondaryButtonImageURL; + + /** describes a graphics to display at the secondary button, if any. + +

The property will be ignored if #HasSecondaryButton is `FALSE`, or + if #SecondaryButtonImageURL is a non-empty string.

+ + @see HasSecondaryButton + @see SecondaryButtonImageURL + */ + com::sun::star::graphic::XGraphic SecondaryButtonImage; + + /** describes the indent level for the property + +

If a given property semantically depends on another one, the indent level + can be used to visually represent this fact. For this, the dependent property's + indent level would be one larger than the indent level of the other property.

+ +

Normally, XPropertyHandlers will set this to 0 when describing + the UI for a normal property. + */ + short IndentLevel; + + /** describes the category into which the property should be sorted by the ObjectInspector. + +

An ObjectInspector can visually group properties which semantically belong + together (for instance using tab pages). The decision which properties actually belong together + is made using this #Category attribute.

+ +

For your implementation of XPropertyHandler, it's recommended that you document the programmatic + names used for property categories. This way, your handler might be re-used in + different contexts, where only the XObjectInspectorModel needs to provide consistent + UI names for the categories.

+ + @see XObjectInspectorModel::describeCategories + */ + string Category; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/ObjectInspector.idl b/offapi/com/sun/star/inspection/ObjectInspector.idl new file mode 100644 index 000000000..e0bbef911 --- /dev/null +++ b/offapi/com/sun/star/inspection/ObjectInspector.idl @@ -0,0 +1,96 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_inspection_ObjectInspector_idl__ +#define __com_sun_star_inspection_ObjectInspector_idl__ + +#include +#include + +module com { module sun { module star { module inspection { + +/** describes a com::sun::star::frame::Controller which can be used to + browse and modify properties of components. + +

The controller can be plugged into a com::sun::star::frame::XFrame, and will + provide a visual component for inspecting and modifying component properties.
+ Note that "property" here is a generic term - any aspect of a component can be considered a property, + as long as some property handler is able to describe this aspect in a property-like way.

+ +

The basic idea is that one facet of the inspected component is represented by a single line + of controls: A label, an input control, and optionally one or two buttons which, when pressed, + trigger additional user interaction (e.g. a more sophisticated dialog to enter a property value).

+ +

Additionally, property lines can be grouped into different categories. A usual implementation + of such categories would be tab pages, but other implementations are possible, too.

+ +

Even more, the inspector can optionally display a help section at the bottom of its + window, which can display arbitrary (context-sensitive) help texts.

+ +

An ObjectInspector needs one or more property handlers which describe + the facets of an inspected component - without such handlers, the inspector window will simply + stay empty.

+ +

The property handlers, as well as more information about the layout of the inspector, + are provided by an inspector model, which has to be implemented by the user of the inspector.

+

+ +

Since property handlers might have the need to raise UI, they will be created with a context + value named "DialogParentWindow", which contains an XWindow which should be used as parent of + any windows to raise.
+ If the com::sun::star::uno::XComponentContext in which the ObjectInspector + was created already contains such a value, it is not overwritten. Only if it doesn't, the inspector + will add an own value - which contains the inspector's main window - to the context when creating + handlers.

+ + @see XPropertyHandler + @see LineDescriptor + @see PropertyControlType + @see ObjectInspectorModel + @see com::sun::star::uno::XComponentContext + @see com::sun::star::lang::XMultiComponentFactory + + @since OOo 2.0.3 +*/ +service ObjectInspector : XObjectInspector +{ + /** creates a default instance of the ObjectInspector + + @since OOo 2.2 + */ + createDefault(); + + /** creates an instance of the ObjectInspector, using a given ObjectInspectorModel + + @throws ::com::sun::star::lang::IllegalArgumentException + if Model is `NULL`. + + @since OOo 2.2 + */ + createWithModel( [in] XObjectInspectorModel Model ) + raises ( ::com::sun::star::lang::IllegalArgumentException ); +}; + + +}; }; }; }; + +#endif + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/ObjectInspectorModel.idl b/offapi/com/sun/star/inspection/ObjectInspectorModel.idl new file mode 100644 index 000000000..e70bb4387 --- /dev/null +++ b/offapi/com/sun/star/inspection/ObjectInspectorModel.idl @@ -0,0 +1,106 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_ObjectInspectorModel_idl__ +#define __com_sun_star_inspection_ObjectInspectorModel_idl__ + +#include +#include + +module com { module sun { module star { module inspection { + +/** describes a default implementation of an ObjectInspectorModel + +

This service simplifies usage of an ObjectInspector.

+ +

The XObjectInspectorModel implemented by this service will not provide any property + categories, nor apply any particular order to the properties provided by its handler(s).

+ + @see ObjectInspector + @see XObjectInspectorModel + @see XObjectInspectorModel::describeCategories + @see XObjectInspectorModel::getPropertyOrderIndex + + @since OOo 2.0.3 +*/ +service ObjectInspectorModel : XObjectInspectorModel +{ + /** creates a default ObjectInspectorModel, whose one and only handler factory + creates a GenericPropertyHandler. + */ + createDefault(); + + /** creates a default ObjectInspectorModel, using an externally provided sequence of property handler + factories. + + @param handlerFactories + a sequence of handler factories, as to be provided in the XObjectInspectorModel::HandlerFactories + method. + @throws ::com::sun::star::lang::IllegalArgumentException + if the given sequence is empty. + + @see XObjectInspectorModel::HandlerFactories + */ + createWithHandlerFactories( [in] sequence< any > handlerFactories ) + raises ( ::com::sun::star::lang::IllegalArgumentException ); + + /** creates a default ObjectInspectorModel, using an externally provided sequence of property handler + factories, and describing an ObjectInspector which has a help section. + + @param handlerFactories + a sequence of handler factories, as to be provided in the XObjectInspectorModel::HandlerFactories + method. + + @param minHelpTextLines + denotes the minimum number of lines of text to be reserved for the help + section. + + @param maxHelpTextLines + denotes the maximum number of lines of text to be reserved for the help + section. + + @throws ::com::sun::star::lang::IllegalArgumentException + if handlerFactories is empty. + + @throws ::com::sun::star::lang::IllegalArgumentException + if minHelpTextLines or maxHelpTextLines are negative, + or if minHelpTextLines is greater than maxHelpTextLines. + + @see XObjectInspectorModel::HandlerFactories + @see XObjectInspectorModel::HasHelpSection + @see XObjectInspectorModel::MinHelpTextLines + @see XObjectInspectorModel::MaxHelpTextLines + + @since OOo 2.2 + */ + createWithHandlerFactoriesAndHelpSection( + [in] sequence< any > handlerFactories, + [in] long minHelpTextLines, + [in] long maxHelpTextLines + ) + raises ( ::com::sun::star::lang::IllegalArgumentException ); +}; + + +}; }; }; }; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/PropertyCategoryDescriptor.idl b/offapi/com/sun/star/inspection/PropertyCategoryDescriptor.idl new file mode 100644 index 000000000..e939df39d --- /dev/null +++ b/offapi/com/sun/star/inspection/PropertyCategoryDescriptor.idl @@ -0,0 +1,57 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_inspection_PropertyCategoryDescriptor_idl__ +#define __com_sun_star_inspection_PropertyCategoryDescriptor_idl__ + +module com { module sun { module star { module inspection { + +/** describes a category of properties + @see ObjectInspector + @see XObjectInspectorModel::describeCategory + @see LineDescriptor::Category + + @since OOo 2.0.3 +*/ +struct PropertyCategoryDescriptor +{ + /** contains the programmatic name of the category. + +

This programmatic name is used internally: XPropertyHandler::describePropertyLine() + sets a programmatic category name at LineDescriptor::Category, + and an object inspector uses this to find the proper PropertyCategoryDescriptor.

+ */ + string ProgrammaticName; + + /** provides a human-readable name (which can be presented at the UI) for a category. + */ + string UIName; + + /** provides a help URL to be associated with a category + */ + string HelpURL; +}; + + +}; }; }; }; + +#endif + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/PropertyControlType.idl b/offapi/com/sun/star/inspection/PropertyControlType.idl new file mode 100644 index 000000000..b5eb40952 --- /dev/null +++ b/offapi/com/sun/star/inspection/PropertyControlType.idl @@ -0,0 +1,144 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_PropertyControlType_idl__ +#define __com_sun_star_inspection_PropertyControlType_idl__ + +module com { module sun { module star { module inspection { + +/** describes pre-defined possible control types to be used to display and enter + property values within an ObjectInspector. + +

The type of a control determines its visual appearance, its behavior, and - important + for property handlers using a control - the expected type when reading and writing the + control's value.

+ + @see XPropertyControl + @see XPropertyControlFactory + @see XPropertyControl::ValueType + + @since OOo 2.0.3 +*/ +constants PropertyControlType +{ + /** denotes a control which allows the user to choose from a list of + possible property values + +

Controls of type #ListBox exchange their values as string.

+ +

Additionally, those controls support the XStringListControl interface.

+ */ + const short ListBox = 1; + + /** denotes a control which allows the user to choose from a list of + possible property values, combined with the possibility to enter a new + property value. + +

Controls of type #ComboBox exchange their values as string.

+ +

Additionally, those controls support the XStringListControl interface.

+ */ + const short ComboBox = 2; + + /** denotes a control which allows the user to enter property values consisting of a single line of text + +

Controls of type #TextField exchange their values as string.

+ */ + const short TextField = 3; + + /** denotes a control which allows the user to enter pure text, including line breaks + +

Controls of type #MultiLineTextField exchange their values as string.

+ */ + const short MultiLineTextField = 4; + + /** denotes a control which allows the user to enter a single character + +

Controls of type #CharacterField exchange their values as short, + being a single UTF-16 character.

+ */ + const short CharacterField = 5; + + /** denotes a control which allows the user to enter a list of single-line strings + +

Controls of type #StringListField exchange their values as + sequence< string >.

+ */ + const short StringListField = 6; + + /** denotes a control which allows the user to choose from a list of colors. + +

Controls of type #ColorListBox usually exchange their values as + com::sun::star::util::Color.

+ +

Additionally, those controls support the XStringListControl interface. If you use + this interface to add additional entries to the list box, which have no color associated with it, + then you can also exchange values as string. That is, if you write a string into + XPropertyControl::Value, and if this string has previously been added to the list + using the XStringListControl interface, this string is selected. Vice versa, if the user + selects one of those non-color strings in the list, then reading XPropertyControl::Value + will retrieve you this string.

+ */ + const short ColorListBox = 7; + + /** denotes a control which allows the user to enter a numerical value + +

Controls of type #NumericField exchange their values as double.

+ +

Additionally, those controls support the XNumericControl interface.

+ */ + const short NumericField = 8; + + /** denotes a control which allows the user to enter a date value + +

Controls of type #DateField exchange their values as com::sun::star::util::Date.

+ */ + const short DateField = 9; + + /** denotes a control which allows the user to enter a time value + +

Controls of type #TimeField exchange their values as com::sun::star::util::Time.

+ */ + const short TimeField = 10; + + /** denotes a control which allows the user to enter a combined date/time value + +

Controls of type #DateTimeField exchange their values as com::sun::star::util::DateTime.

+ */ + const short DateTimeField = 11; + + /** denotes a control which displays a string in a hyperlink-like appearance + +

Controls of type #HyperlinkField exchange their values as string.

+ +

Additionally, those controls support the XHyperlinkControl interface.

+ */ + const short HyperlinkField = 12; + + /** denotes a non-standard property control, which is usually provided by an XPropertyHandler + */ + const short Unknown = 13; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/PropertyLineElement.idl b/offapi/com/sun/star/inspection/PropertyLineElement.idl new file mode 100644 index 000000000..0aba844f7 --- /dev/null +++ b/offapi/com/sun/star/inspection/PropertyLineElement.idl @@ -0,0 +1,51 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_PropertyLineElement_idl__ +#define __com_sun_star_inspection_PropertyLineElement_idl__ + +module com { module sun { module star { module inspection { + +/** describes elements of a single line in an object inspector, used to represent a + single property + + @see XPropertyHandler::describePropertyLine + @see LineDescriptor + + @since OOo 2.0.3 +*/ +constants PropertyLineElement +{ + /// specifies the input control in a group of controls related to a single property + const short InputControl = 0x01; + /// specifies the primary button (if present) in a group of controls related to a single property + const short PrimaryButton = 0x02; + /// specifies the secondary button (if present) in a group of controls related to a single property + const short SecondaryButton = 0x04; + + /// specifies all elements + const short All = 0xFF; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/StringRepresentation.idl b/offapi/com/sun/star/inspection/StringRepresentation.idl new file mode 100644 index 000000000..a0b400536 --- /dev/null +++ b/offapi/com/sun/star/inspection/StringRepresentation.idl @@ -0,0 +1,37 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_StringRepresentation_idl__ +#define __com_sun_star_inspection_StringRepresentation_idl__ + +#include + +module com { module sun { module star { module inspection { + +service StringRepresentation : XStringRepresentation +{ + create([in]com::sun::star::script::XTypeConverter TypeConverter)raises( com::sun::star::lang::IllegalArgumentException ); + createConstant([in]com::sun::star::script::XTypeConverter TypeConverter,[in] string Constant,[in] sequence Values)raises( com::sun::star::lang::IllegalArgumentException ); +}; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/XHyperlinkControl.idl b/offapi/com/sun/star/inspection/XHyperlinkControl.idl new file mode 100644 index 000000000..05e9c9687 --- /dev/null +++ b/offapi/com/sun/star/inspection/XHyperlinkControl.idl @@ -0,0 +1,55 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_XHyperlinkControl_idl__ +#define __com_sun_star_inspection_XHyperlinkControl_idl__ + +#include +#include + +module com { module sun { module star { module inspection { + +/** defines the interface for an XPropertyControl which displays its value + in a hyperlink-like way + +

Hyperlink controls exchange their value (XPropertyControl::Value) as strings.

+ + @since OOo 2.0.3 +*/ +interface XHyperlinkControl : XPropertyControl +{ + /** adds a listener which will be notified when the user clicked the hyperlink text in the control + @param listener + the listener to notify of hyperlink clicks + */ + void addActionListener( [in] com::sun::star::awt::XActionListener listener ); + + /** removes a listener which was previously added via addActionListener() + @param listener + the listener to revoke + */ + void removeActionListener( [in] com::sun::star::awt::XActionListener listener ); +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/XNumericControl.idl b/offapi/com/sun/star/inspection/XNumericControl.idl new file mode 100644 index 000000000..47a55cda5 --- /dev/null +++ b/offapi/com/sun/star/inspection/XNumericControl.idl @@ -0,0 +1,82 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_XNumericControl_idl__ +#define __com_sun_star_inspection_XNumericControl_idl__ + +#include +#include +#include + +module com { module sun { module star { module inspection { + +/** defines the interface for an XPropertyControl which supports + displaying and entering numerical values. + + @since OOo 2.0.3 +*/ +interface XNumericControl : XPropertyControl +{ + /** describes the number of decimal digits to use for the value + */ + [attribute] short DecimalDigits; + + /** describes the minimum value which is allowed to be entered in the control + */ + [attribute] com::sun::star::beans::Optional MinValue; + + /** describes the maximum value which is allowed to be entered in the control + */ + [attribute] com::sun::star::beans::Optional MaxValue; + + /** describes a com::sun::star::util::MeasureUnit to be applied + for displaying values. + +

Only a certain set of com::sun::star::util::MeasureUnit values is + supported. In particular, every value which denotes a fraction of another + unit (like 100th millimeters) cannot be used as DisplayUnit.

+ + @throws com::sun::star::lang::IllegalArgumentException + if the caller attempts to set an unsupported com::sun::star::util::MeasureUnit + */ + [attribute] short DisplayUnit + { + set raises (com::sun::star::lang::IllegalArgumentException); + }; + + /** describes a com::sun::star::util::MeasureUnit to be + applied for transferring values. + +

The core measurement unit for a property value might differ from the unit which + is used by the control to display it. For instance, your property value might require + that your values denote 100th millimeters, but to the user, you want to present the + value as, say, inches. In this case, a numeric control can automatically handle the + value conversion for you, if you give it a ValueUnit different from the DisplayUnit.

+ + @see XPropertyControl::Value + */ + [attribute] short ValueUnit; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/XObjectInspector.idl b/offapi/com/sun/star/inspection/XObjectInspector.idl new file mode 100644 index 000000000..6d91b12f8 --- /dev/null +++ b/offapi/com/sun/star/inspection/XObjectInspector.idl @@ -0,0 +1,117 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_XObjectInspector_idl__ +#define __com_sun_star_inspection_XObjectInspector_idl__ + +#include +#include +#include + +module com { module sun { module star { module inspection { + +interface XObjectInspectorModel; +interface XObjectInspectorUI; + +/** describes the main interface of an ObjectInspector. + + @see ObjectInspector + + @since OOo 2.0.3 +*/ +interface XObjectInspector +{ + /** allows to plug the inspector into a com::sun::star::frame::XFrame + +

The com::sun::star::frame::XController::setModel() method + accepts only XObjectInspectorModels, and will return `FALSE` if the + to-be-attached model is not `NULL`, but does not support this interface.

+ +

If you do not want to support a full-blown com::sun::star::frame::XModel, + use the #InspectorModel attribute instead.

+ +

The com::sun::star::frame::XController::getViewData() and + com::sun::star::frame::XController::restoreViewData() exchange + string values, which describes as much of the current view state as possible.

+ */ + interface com::sun::star::frame::XController; + + /** allows to intercept functionality + +

This interface is inherited from the com::sun::star::frame::Controller + service, currently, there is no functionality to intercept at an XObjectInspector.

+ */ + interface com::sun::star::frame::XDispatchProvider; + + /** provides access to the current model of the inspector + +

The model is mainly responsible for providing the property handlers. Additionally, + it can provide user interface names and help URLs for property categories.

+ +

Note that there are two ways of setting or retrieving the current model: You can either + use com::sun::star::frame::XModel::setModel(), or, if you do not want + or need to implement the full-blown com::sun::star::frame::XModel interface, + you can use this property directly. Both approaches are semantically equivalent.

+ +

If a new model is set at the inspector, the complete UI will be rebuilt to reflect + the change, using the new property handlers provided by the new model.

+ */ + [attribute] XObjectInspectorModel InspectorModel; + + /** provides access to the user interface of the object inspector. + +

This interface can be used to access and manipulate various aspects of + the user interface. For instance, you can enable and disable certain + property controls (or parts thereof), or register observers for all property + controls.

+ + @since OOo 2.2 + */ + [attribute, readonly] XObjectInspectorUI InspectorUI; + + /** inspects a new collection of one or more objects. + +

If the sequence is empty, the UI of the ObjectInspector will be + cleared.

+ +

If the sequence contains more than one object, the XObjectInspector + will create a complete set of property handlers (as indicated by + XObjectInspectorModel::HandlerFactories) for every of + the objects, and compose their output.

+ + @throws com::sun::star::util::VetoException + if the inspector cannot switch to another object set. This typically happens if + one of the active XPropertyHandler's raised a non-modal user interface, + and vetoed suspension of this UI. + + @see XPropertyHandler::isComposable + @see XPropertyHandler::onInteractivePropertySelection + @see XPropertyHandler::suspend + */ + void inspect( [in] sequence< com::sun::star::uno::XInterface > Objects ) + raises (com::sun::star::util::VetoException); +}; + + +}; }; }; }; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/XObjectInspectorModel.idl b/offapi/com/sun/star/inspection/XObjectInspectorModel.idl new file mode 100644 index 000000000..4906c43cc --- /dev/null +++ b/offapi/com/sun/star/inspection/XObjectInspectorModel.idl @@ -0,0 +1,178 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_XObjectInspectorModel_idl__ +#define __com_sun_star_inspection_XObjectInspectorModel_idl__ + +#include +#include + +module com { module sun { module star { module inspection { + +interface XPropertyHandler; + +/** describes the model of an ObjectInspector + + @see ObjectInspector + + @since OOo 2.0.3 +*/ +interface XObjectInspectorModel +{ + /** describes a set of factories for creating XPropertyHandlers + +

Every element of the sequence must contain information to create a + XPropertyHandler instance. Two ways are currently supported: +

    +
  • A service name:
    + If a sequence element contains a string, this string is interpreted + as service name, and a com::sun::star::lang::XMultiComponentFactory + is asked to create an instance of this service.
  • +
  • A factory:
    + If a sequence element contains an instance implementing the + com::sun::star::lang::XSingleComponentFactory interface, this factory + is used to create a property handler.
  • +

+ +

This attribute is usually only evaluated by the ObjectInspector instance + which the model is currently bound to.

+ +

The order of factories is important: If two property handlers declare themselves responsible + for the same property, the one whose factory is listed last wins. Also, + if a handler B wants to supersede a property of another handler A, + A's factory must precede the factory of B.

+ + @see XPropertyHandler::getSupportedProperties + @see XPropertyHandler::getSupersededProperties + */ + [attribute, readonly] sequence< any > HandlerFactories; + + /** describes the property categories used by the property handlers. + +

Properties can be sorted into different categories, described by the LineDescriptor::Category + attribute, which is filled in XPropertyHandler::describePropertyLine() + method of your property handler.
+ Those names provided by the handlers are programmatic names. All other information + about categories is part of the PropertyCategoryDescriptor, and + describeCategories() assembles information about all categories which + all property handlers provided by the model use.

+ + @return + a sequence of category descriptors. Their relative ordering also describes + the relative ordering of the categories in the ObjectInspector's + user interface.
+ The sequence must not contain two entries with the same programmatic name.
+
+ The model implementation might return an empty sequence here, in this case, the ObjectInspector + automatically builds its category information from the categories provided by the + property handlers. + @see PropertyCategoryDescriptor + @see LineDescriptor::Category + */ + sequence< PropertyCategoryDescriptor > describeCategories(); + + /** retrieves an index in a global property ordering, for a given property name + +

In the user interface of an ObjectInspector, single properties are represented by + single lines, and those lines are displayed successively. To determine an order of + the property lines, the inspector model can associate an "order index" with each property. + The ObjectInspector will then sort the property lines in a way that they + have the same relative ordering as the "order indexes" of their properties.

+ +

Note that the concrete value the model returns for a given property does not + matter. All what matters is that if you want a certain property Foo + to be displayed after another property Bar, then the order index + of Foo should be greater than the order index of Bar. + +

If for two different properties the same order index is returned, the + ObjectInspector will assume the order in which those properties + were provided by the respective property handler + (XPropertyHandler::getSupportedProperties()).
+ If two such properties originate from different handlers, they will be ordered according + to the order of the handlers, as provided in the #HandlerFactories attribute.

+ + @param PropertyName + the property whose global order index should be retrieved + @return + the global order index of PropertyName. + */ + long getPropertyOrderIndex( [in] string PropertyName ); + + /** indicates that the object inspector should have a help section. + +

The object inspector displays lines of property/values, optionally grouped + into categories, as described by the property handlers.
+ Additionally, the inspector can optionally display a section dedicated to help + texts. Clients could use this section to display context-sensitive help, for + instance short texts explaining the currently selected property.

+ + @since OOo 2.2 + */ + [attribute, readonly] boolean HasHelpSection; + + /** denotes the minimum number of lines of text to be reserved for the help + section. + +

This property is ignored by the ObjectInspector if + #HasHelpSection is `FALSE`.

+ +

The layout of the ObjectInspector is undefined if + #MinHelpTextLines is larger than + #MaxHelpTextLines.

+ + @since OOo 2.2 + */ + [attribute, readonly] long MinHelpTextLines; + + /** denotes the maximum number of lines of text to be reserved for the help + section. + +

This property is ignored by the ObjectInspector if + #HasHelpSection is `FALSE`.

+ +

The layout of the ObjectInspector is undefined if + #MaxHelpTextLines is smaller than + #MinHelpTextLines.

+ + @since OOo 2.2 + */ + [attribute, readonly] long MaxHelpTextLines; + + /** determines whether the object inspector's UI should be read-only. + +

In this case, the user is able to browse through all properties, but cannot + change any of them.

+ +

In a read-only object inspector, the property controls are readonly or + disabled themselves, and the primary and secondary buttons of a property line + are both disabled.

+ + @see XPropertyControl + @see LineDescriptor + */ + [attribute, bound] boolean IsReadOnly; +}; + + +}; }; }; }; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/XObjectInspectorUI.idl b/offapi/com/sun/star/inspection/XObjectInspectorUI.idl new file mode 100644 index 000000000..465c28c34 --- /dev/null +++ b/offapi/com/sun/star/inspection/XObjectInspectorUI.idl @@ -0,0 +1,169 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_inspection_XObjectInspectorUI_idl__ +#define __com_sun_star_inspection_XObjectInspectorUI_idl__ + +#include +#include +#include +#include + +module com { module sun { module star { module inspection { + +interface XPropertyControlObserver; + +/** grants access to certain aspects of the user interface of an object + inspector + +

This interface is used as callback for XPropertyHandlers.

+ +

As a consequence, methods operating on the UI for a property, and taking the name of this property, + are tolerant against properties which do not exist. For instance, if a property handler tries to + disable the UI for property Foo, but another handler has superseded this property, then + the ObjectInspector will not have any UI for it. In this case, the call to + enablePropertyUI( "Foo" ) will simply be ignored.

+ + @since OOo 2.0.3 +*/ +interface XObjectInspectorUI +{ + /** enables or disables all components belonging to the UI representation of a property + +

This is usually used by an XPropertyHandler if it handles properties, + where one does only make sense if another one has a certain value.

+ + @param PropertyName + denotes the name of the property whose UI is to be enabled or disabled. + @param Enable + `TRUE` if and only if the UI should be disabled, `FALSE` otherwise. + */ + void enablePropertyUI( [in] string PropertyName, [in] boolean Enable ); + + /** enables or disables the single elements which can be part of the UI representation of a property + +

Note that the complete UI for the property must be enabled in order for these settings to + be evaluated. That is, enablePropertyUIElements() does not have any effect if + somebody previously disabled the complete UI for this property with enablePropertyUI().

+ + @param PropertyName + the name of the property whose user interface elements are to be enabled or disabled + + @param Elements + a combination of PropertyLineElement flags specifying which elements are to be + enabled or disabled.
+ Note that if you don't set a particular bit here (say, PropertyLineElement::PrimaryButton), + this does mean that this element's state is not affected by the call - it does + not mean that it is disabled. + @param Enable + `TRUE` if the elements denoted by _nElements should be enabled, `FALSE` if + they should be disabled. + */ + void enablePropertyUIElements( + [in] string PropertyName, + [in] short Elements, + [in] boolean Enable + ); + + /** completely rebuilds the UI for the given property. + +

This method might be used by an XPropertyHandler if it wants to change the type + of control (see PropertyControlType) used to display a certain property.

+ +

The object inspector will then call describePropertyLine again, and update its UI accordingly.

+ +

Note that the property whose UI should be rebuilt must not necessarily be (though usually is) + in the responsibility of the handler which calls this method. The object inspector will look up the + handler with the responsibility for PropertyName and call its + XPropertyHandler::describePropertyLine()

+ + @param PropertyName + the name of the property whose UI is to be completely rebuilt. + */ + void rebuildPropertyUI( [in] string PropertyName ); + + /** shows the UI for a given property + + @param PropertyName + the name of the property whose UI is to be shown + */ + void showPropertyUI( [in] string PropertyName ); + + /** hides the UI for a given property + + @param PropertyName + the name of the property whose UI is to be hidden + */ + void hidePropertyUI( [in] string PropertyName ); + + /** shows or hides all properties belonging to a given category + @see LineDescriptor::Category + @see XObjectInspectorModel::describeCategories + */ + void showCategory( [in] string Category, [in] boolean Show ); + + /** retrieves the control currently used to display a given property + + @param PropertyName + the name of the property whose control should be retrieved + + @return + the XPropertyControl representing the given property, or `NULL` + if there is no such property control. + */ + XPropertyControl + getPropertyControl( [in] string PropertyName ); + + /** registers an observer for all property controls + +

The given XPropertyControlObserver will be notified of all changes + in all property controls.

+ + @see revokeControlObserver + + @since OOo 2.2 + */ + void registerControlObserver( [in] XPropertyControlObserver Observer ); + + /** revokes a previously registered control observer + + @see registerControlObserver + + @since OOo 2.2 + */ + void revokeControlObserver( [in] XPropertyControlObserver Observer ); + + /** sets the text of the help section, if the object inspector contains + one. + + @throws NoSupportException + if the XObjectInspectorModel::HasHelpSection property + requires the help section to be unavailable. + + @since OOo 2.2 + */ + void setHelpSectionText( [in] string HelpText ) + raises ( ::com::sun::star::lang::NoSupportException ); +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/XPropertyControl.idl b/offapi/com/sun/star/inspection/XPropertyControl.idl new file mode 100644 index 000000000..f257a3bbb --- /dev/null +++ b/offapi/com/sun/star/inspection/XPropertyControl.idl @@ -0,0 +1,106 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_XPropertyControl_idl__ +#define __com_sun_star_inspection_XPropertyControl_idl__ + +#include +#include + +module com { module sun { module star { module inspection { + +interface XPropertyControlContext; + +/** defines the interface for a single control in an ObjectInspector + + @since OOo 2.0.3 +*/ +interface XPropertyControl +{ + /** denotes the type of the control, as one of the PropertyControlType + constants + */ + [attribute, readonly] short ControlType; + + /** denotes the current content of the control. + +

At every point in time, this value is either `VOID`, or of the type + described by #ValueType.

+ + @throws com::sun::star::beans::IllegalTypeException + if an attempt is made to set a value which is not `VOID` and whose + type does not equal #ValueType. + */ + [attribute] any Value + { + set raises ( com::sun::star::beans::IllegalTypeException ); + }; + + /** denotes the value type of the control. + + @see Value + */ + [attribute, readonly] type ValueType; + + /** specifies the context of the control within the ObjectInspector. + +

The property control should actively notify its state changes to the context. + In particular, changes in the focus and the value of the control must be notified. + */ + [attribute] XPropertyControlContext ControlContext; + + /** determines whether the control content is currently modified + +

An XPropertyControl internally manages a flag indicating whether + its content is modified. This flag is reset to `FALSE` every time our + #ControlContext is notified of our current value. Also, the control + implementation must set this flag to `TRUE` if and only if the user changed the + control content.

+ + @see notifyModifiedValue + @see ControlContext + @see XPropertyControlContext::valueChanged + */ + boolean isModified(); + + /** notifies the context in which the control lives of the current control value, + if this value is currently modified + + @see isModified + @see ControlContext + @see XPropertyControlListener::valueChanged + */ + void notifyModifiedValue(); + + /** denotes the window which is the real UI representation of the property control. + +

The ObjectInspector will automatically position and size this control + as needed, care for its Z-order, and so on.

+ +

This Window must not be `NULL`, else the whole control is not usable.

+ */ + [attribute, readonly] com::sun::star::awt::XWindow ControlWindow; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/XPropertyControlContext.idl b/offapi/com/sun/star/inspection/XPropertyControlContext.idl new file mode 100644 index 000000000..878710c0b --- /dev/null +++ b/offapi/com/sun/star/inspection/XPropertyControlContext.idl @@ -0,0 +1,48 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_XPropertyControlContext_idl__ +#define __com_sun_star_inspection_XPropertyControlContext_idl__ + +#include + +module com { module sun { module star { module inspection { + +/** specifies the interface of the context of an XPropertyControl. + + @see XPropertyControl::ControlContext + + @since OOo 2.0.3 +*/ +interface XPropertyControlContext : XPropertyControlObserver +{ + /** instructs the XPropertyControlContext to active the next control + + @param CurrentControl + denotes the control which initiated the request. + */ + void activateNextControl( [in] XPropertyControl CurrentControl ); +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/XPropertyControlFactory.idl b/offapi/com/sun/star/inspection/XPropertyControlFactory.idl new file mode 100644 index 000000000..3429647b8 --- /dev/null +++ b/offapi/com/sun/star/inspection/XPropertyControlFactory.idl @@ -0,0 +1,69 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_XPropertyControlFactory_idl__ +#define __com_sun_star_inspection_XPropertyControlFactory_idl__ + +#include + +module com { module sun { module star { module inspection { + +interface XPropertyControl; + +/** a factory for XPropertyControls + + @since OOo 2.0.3 +*/ +interface XPropertyControlFactory +{ + /** creates a XPropertyControl + +

A XPropertyControlFactory can create any of the control types denoted by + the PropertyControlType constants.

+ + @param ControlType + the type of the requested control + + @param CreateReadOnly + determines whether the newly created control should be readonly. + +

If this argument is `TRUE`, this does not necessarily mean that the property cannot be + changed at all in the ObjectInspector. Instead, an XPropertyHandler + can still decide that there is a dedicated UI for entering the property value, + which is usually triggered by a LineDescriptor::PrimaryButton.

+ +

Note that this parameter might be ignored if the XObjectInspectorModel::IsReadOnly + attribute is `TRUE`, in which case all created property controls must be readonly.

+ + @returns + a control of the given type. + + @throws com::sun::star::lang::IllegalArgumentException + if the given ControlType is not a value PropertyControlType + */ + XPropertyControl createPropertyControl( [in] short ControlType, [in] boolean CreateReadOnly ) + raises ( com::sun::star::lang::IllegalArgumentException ); +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/XPropertyControlObserver.idl b/offapi/com/sun/star/inspection/XPropertyControlObserver.idl new file mode 100644 index 000000000..d9805dbd0 --- /dev/null +++ b/offapi/com/sun/star/inspection/XPropertyControlObserver.idl @@ -0,0 +1,63 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_XPropertyControlObserver_idl__ +#define __com_sun_star_inspection_XPropertyControlObserver_idl__ + +#include + + +module com { module sun { module star { module inspection { + +interface XPropertyControl; + + +/** specifies an interface for components to observer certain aspects + of an XPropertyControl. + + @since OOo 2.2 +*/ +interface XPropertyControlObserver +{ + /** notifies the observer that a certain XPropertyControl's UI + representation gained the focus. + + @param Control + denotes the control whose UI representation gained the focus + */ + void focusGained( [in] XPropertyControl Control ); + + /** notifies the observer that a certain XPropertyControl's value + changed. + + @param Control + denotes the control whose value changed. + + @see XPropertyControl::Value + */ + void valueChanged( [in] XPropertyControl Control ); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/XPropertyHandler.idl b/offapi/com/sun/star/inspection/XPropertyHandler.idl new file mode 100644 index 000000000..f65c44672 --- /dev/null +++ b/offapi/com/sun/star/inspection/XPropertyHandler.idl @@ -0,0 +1,447 @@ +/* -*- 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 . + */ +#ifndef __com_sun_star_inspection_XPropertyHandler_idl__ +#define __com_sun_star_inspection_XPropertyHandler_idl__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +module com { module sun { module star { module inspection { + +interface XObjectInspectorUI; +interface XPropertyControlFactory; + +/** is the basic interface for object inspection. + +

The ObjectInspector itself does not know anything about the object + it is inspecting, all information is obtained via XPropertyHandlers. + Also, property handlers are responsible for describing the user interface which should + be used to interact with the user, with respect to a given aspect of the inspected + component.

+ + @see ObjectInspector + @see LineDescriptor + + @since OOo 2.0.3 +*/ +interface XPropertyHandler +{ + /** used for controlling resources acquired by the handler + +

com::sun::star::lang::XComponent::dispose() is invoked when the property handler is not + needed by the object inspector anymore. Handler implementations should clean up any + resources here.

+ */ + interface com::sun::star::lang::XComponent; + + /** binds the property handler to a new component + @param Component + the component to inspect. Must not be `NULL` + @throws com::sun::star::lang::NullPointerException + if the component is `NULL` + */ + void inspect( [in] com::sun::star::uno::XInterface Component ) + raises( com::sun::star::lang::NullPointerException ); + + /** retrieves the current value of a property + @param PropertyName + the name of the property whose value is to be retrieved + @throws com::sun::star::beans::UnknownPropertyException + if the given property is not supported by the property handler + */ + any + getPropertyValue( [in] string PropertyName ) + raises (::com::sun::star::beans::UnknownPropertyException); + + /** sets the value of a property + + @param PropertyName + the name of the property whose value is to be set + @param Value + the property value to set + @throws com::sun::star::beans::UnknownPropertyException + if the given property is not supported by the property handler + */ + void + setPropertyValue( [in] string PropertyName, [in] any Value ) + raises (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException); + + /** returns the state of a property + + @param PropertyName + the name of the property whose state is to be retrieved + @throws com::sun::star::beans::UnknownPropertyException + if the given property is not supported by the property handler + */ + com::sun::star::beans::PropertyState + getPropertyState( [in] string PropertyName ) + raises (::com::sun::star::beans::UnknownPropertyException); + + /** describes the UI to be used to represent the property + @param PropertyName + the name of the property whose user interface is to be described + implementation + @param ControlFactory + a factory for creating XPropertyControl instances. Must not be `NULL`. + @return + the descriptor of the property line. + @throws com::sun::star::beans::UnknownPropertyException + if the given property is not supported by this handler + @throws com::sun::star::lang::NullPointerException + if ControlFactory is `NULL`. + @see PropertyControlType + @see LineDescriptor + */ + LineDescriptor + describePropertyLine( + [in] string PropertyName, + [in] XPropertyControlFactory ControlFactory + ) + raises (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException); + + /** converts a given control-compatible value to a property value + +

In describePropertyLine(), a property handler declared which type of control + should be used to display the value of a certain property. To allow to use the same control + type for different properties, and in particular, for properties of different type, + conversions between controls values and property values are needed.

+ +

This method converts a control value into a property value, which subsequently can be used + in conjunction with setPropertyValue().

+ + @param PropertyName + The name of the conversion's target property. + @param ControlValue + The to-be-converted control value. This value has been obtained from an XPropertyControl, + using its XPropertyControl::Value attribute. + + @throws com::sun::star::beans::UnknownPropertyException + if the given property is not supported by the property handler + + @see convertToControlValue + @see describePropertyLine + @see XPropertyControl + @see getPropertyValue + */ + any + convertToPropertyValue( + [in] string PropertyName, + [in] any ControlValue + ) + raises (::com::sun::star::beans::UnknownPropertyException); + + /** converts a given property value to a control-compatible value + +

In describePropertyLine(), a property handler declared which type of control + should be used to display the value of a certain property. To allow to use the same control + type for different properties, and in particular, for properties of different type, + conversions between controls values and property values are needed.

+ +

This method converts a property value, which has previously been obtained using + getPropertyValue(), into a control-compatible value, which can be used + with XPropertyControl's XPropertyControl::Value attribute.

+ +

A usual application of this method are list boxes: There is a generic list box implementation, + which is able to display a simple list of strings. Usually, every string represents one + possible property value. To translate between those property values and the displayed strings, + convertToControlValue() and convertToPropertyValue() are used.

+ +

The method is not invoked if the control's value type (XPropertyControl::ValueType + equals the property's value type.

+ + @param PropertyName + The name of the property whose value is to be converted. + @param PropertyValue + The to-be-converted property value. + @param ControlValueType + The target type of the conversion. This type is determined by the control which + is used to display the property, which in turn is determined by the handler itself + in describePropertyLine().
+ Speaking strictly, this is passed for convenience only, since every XPropertyHandler + implementation should know exactly which type to expect, since it implicitly determined this type + in describePropertyLine() by creating an appropriate XPropertyControl. + + @throws com::sun::star::beans::UnknownPropertyException + if the given property is not supported by the property handler + + @see convertToPropertyValue + @see describePropertyLine + @see XPropertyControl + @see getPropertyValue + */ + any + convertToControlValue( + [in] string PropertyName, + [in] any PropertyValue, + [in] type ControlValueType + ) + raises (::com::sun::star::beans::UnknownPropertyException); + + /** registers a listener for notification about property value changes + +

An XPropertyHandler implementation might decide to ignore this call. + However, in this case property value changes made by third party components are not + reflected in the object inspector.

+ +

If a handler implementation supports property change listeners, it must be able to cope + with a call to addPropertyChangeListener() even if currently no component is + being inspected. In this case, the listener must become active as soon as a new introspection + is set in the next inspect() call.

+ + @param Listener + the listener to notify about property changes + @throws com::sun::star::lang::NullPointerException + if the listener is `NULL` + @see removePropertyChangeListener + */ + void + addPropertyChangeListener( [in] com::sun::star::beans::XPropertyChangeListener Listener ) + raises ( com::sun::star::lang::NullPointerException ); + + /** revokes a listener for notification about property value changes + @see addPropertyChangeListener + */ + void + removePropertyChangeListener( [in] com::sun::star::beans::XPropertyChangeListener Listener ); + + /** returns the properties which the handler can handle + +

A handler is allowed to return an empty sequence here, indicating that for + the given introspection, no properties handling can be provided. This might happen + when a fixed set of property handlers is used for a variety of components to inspect, + where not all handlers can really cope with all components.

+ +

In the case of returning an empty sequence here, the property handler is ignored + by all further processing in the object inspector.

+ */ + sequence< com::sun::star::beans::Property > + getSupportedProperties(); + + /** returns the properties which are to be superseded by this handler + +

Besides defining an own set of properties (see getSupportedProperties()), + a property handler can also declare that foreign properties (which it is + not responsible for) are superseded by its own properties.

+ +

This is usually used if your handler is used with another, more generic one, which + should continue to be responsible for all properties, except a few which your + handler handles more elegantly.

+ +

In such a case, simply return those properties here.

+ +

There is a precedence in the property handlers used by an ObjectInspector, + which also is important for the superseded properties. This precedence is implied by the + precedence of factories to create the property handlers, as denoted in the + XObjectInspectorModel::HandlerFactories attribute.

+ +

With this in mind, property handlers can only supersede properties which are supported + by a handler preceding them, but not properties of handlers succeeding them.

+ +

For instance, imaging an XObjectInspectorModel which provides three + factories, for handler A, B, and C - in this order. + Now if A supports the property Foo, C supports + Bar, and B supersedes both Foo and Bar, + them the result is Bar is still present. This is because B precedes + C, so it cannot, by definition, supersede properties which are supported by + C.

+ +

If getSupportedProperties() returned an empty sequence, this method will + not be called.

+ + @see XObjectInspectorModel::HandlerFactories + */ + sequence< string > + getSupersededProperties( ); + + /** retrieve the actuating properties which this handler is interested in + +

In general, properties can be declared as "actuating", that is, when their value + changes, the UI for other properties needs to be updated (e.g. enabled or disabled).

+ +

With this method, a handler can declare that it feels responsible for some/all + of the depending properties of certain actuating properties.

+ +

Whenever the value of an actuating property changes, all handlers which expressed + their interest in this particular actuating properties are called with their + actuatingPropertyChanged() method.

+ +

If getSupportedProperties() returned an empty sequence, this method will + not be called

+ */ + sequence< string > + getActuatingProperties( ); + + /** determines whether a given property, which the handler is responsible for, is composable. + +

An object inspector can inspect multiple components at once, displaying the intersection + of their properties. For this, all components are examined for their properties, and all properties + which exist for all components, and are declared to be composable by their respective handler, + are displayed in the inspector UI.

+ + @param PropertyName + the name of the property whose composability is to be determined + @throws com::sun::star::beans::UnknownPropertyException + if the given property is not supported by the property handler + */ + boolean isComposable( [in] string PropertyName ) + raises (::com::sun::star::beans::UnknownPropertyException); + + /** called when a browse button belonging to a property UI representation has been clicked + +

Property handlers can raise a dedicated UI for entering or somehow changing a property value. + Usually, this will be a modal dialog, but it can also be a non-modal user interface component.

+ +

Availability of this feature is indicated by the LineDescriptor::HasPrimaryButton + and LineDescriptor::HasSecondaryButton members of a LineDescriptor, + which the XPropertyHandler fills in its describePropertyLine() method.

+ +

When this method is called, the property handler should raise the UI needed to enter the + property value, and return the result of this (see InteractiveSelectionResult).

+ +

It is recommended that property handlers do not directly set the property value which has + been obtained from the user, but store it in the output-parameter Data, and return + InteractiveSelectionResult::ObtainedValue.

+ +

If a handler sets the new property value directly, and returns + InteractiveSelectionResult::ObtainedValue, this implies that the property + cannot properly be handled in case the object inspector is inspecting an intersection of + multiple components, since in this case onInteractivePropertySelection() + will be called at one handler only, however the new property would have to be forwarded to + all handlers.

+ +

If a property is not composable, directly setting the new property value does not yield any problem, + as long as property listeners are properly notified of the change.

+ + @param PropertyName + The name of the property whose browse button has been clicked + + @param Primary + `TRUE` if and only if the primary button has been clicked, `FALSE` otherwise + + @param outData + If the method returns InteractiveSelectionResult::ObtainedValue, + then outData contains the value which has been interactively obtained + from the user, and which still needs to be set at the inspected component. + + @param InspectorUI + provides access to the object inspector UI. Implementations should use this if + the property selection requires non-modal user input. In those cases, + onInteractivePropertySelection() should return InteractiveSelectionResult::Pending, + and the UI for (at least) the property whose input is still pending should be disabled. + + @return + the result of the interactive property value selection. + + @throws com::sun::star::beans::UnknownPropertyException + if the given property is not supported by the property handler + @throws com::sun::star::lang::NullPointerException + if InspectorUI is `NULL` + + @see describePropertyLine + @see addPropertyChangeListener + @see isComposable + */ + ::com::sun::star::inspection::InteractiveSelectionResult + onInteractivePropertySelection( + [in] string PropertyName, + [in] boolean Primary, + [out] any outData, + [in] XObjectInspectorUI InspectorUI + ) + raises (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException); + + /** updates the UI of dependent properties when the value of a certain actuating property changed + +

This method is called whenever a property value changes, limited to those properties + whose changes the handler expressed interest in (see getActuatingProperties()).

+ + @param ActuatingPropertyName + the id of the actuating property. + @param NewValue + the new value of the property + @param OldValue + the old value of the property + @param InspectorUI + a callback for updating the object inspector UI + @param FirstTimeInit + If `TRUE`, the method is called for the first-time update of the respective property, that + is, when the property browser is just initializing with the properties of the introspected + object.
+ If `FALSE`, there was a real com::sun::star::beans::XPropertyChangeListener::propertyChange() + event which triggered the call.
+
+ In some cases it may be necessary to differentiate between both situations. For instance, + if you want to set the value of another property when an actuating property's value changed, + you should definitely not do this when FirstTimeInit is `TRUE`. + @throws com::sun::star::lang::NullPointerException + if InspectorUI is `NULL` + */ + void + actuatingPropertyChanged( + [in] string ActuatingPropertyName, + [in] any NewValue, + [in] any OldValue, + [in] XObjectInspectorUI InspectorUI, + [in] boolean FirstTimeInit + ) + raises (::com::sun::star::lang::NullPointerException); + + /** suspends the handler + +

A XPropertyHandler is used by a XObjectInspector instance, + which implements the XController interface. By definition, a XObjectInspector always forwards + all suspend requests (com::sun::star::frame::XController::suspend()) to + all its handlers.

+ +

The usual use case for this method are non-modal user interface components used + for property value input. Such a component might have been opened during + onInteractivePropertySelection(). If a property handler receives a + suspend() call, it should forward the suspension request to the UI + component, and veto suspension of the XObjectInspector as appropriate.

+ +

If suspension is not to be vetoed, then all non-modal UI components opened + by the handler should have been closed when it returns from the suspend() call.

+ + @param Suspend + Whether the handler is to be suspended `TRUE` or reactivated (`FALSE`). The + latter happens if a handler was successfully suspended, but an external instance + vetoed the whole suspension process. + + @return + `TRUE` if the handler does allow suspension, `FALSE` if it vetoes it. + */ + boolean suspend( [in] boolean Suspend ); +}; + + +}; }; }; }; + +#endif + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/XStringListControl.idl b/offapi/com/sun/star/inspection/XStringListControl.idl new file mode 100644 index 000000000..caf38d601 --- /dev/null +++ b/offapi/com/sun/star/inspection/XStringListControl.idl @@ -0,0 +1,61 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_XStringListControl_idl__ +#define __com_sun_star_inspection_XStringListControl_idl__ + +#include + +module com { module sun { module star { module inspection { + +/** defines the interface for an XPropertyControl which, additionally + to the basic behavior, supports a list of strings interpreted as possible + property values. + +

A control which would canonically implement this interface is a list box control: + The string list defined by XStringListControl would in the control be + represented as drop-down list containing all the strings.

+ + @since OOo 2.0.3 +*/ +interface XStringListControl : XPropertyControl +{ + /** clears the whole list + */ + void clearList(); + + /** prepends a new entry to the beginning of the list + */ + void prependListEntry( [in] string NewEntry ); + + /** appends a new entry to the end of the list + */ + void appendListEntry( [in] string NewEntry ); + + /** gets all list entries + */ + sequence< string > getListEntries(); +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/inspection/XStringRepresentation.idl b/offapi/com/sun/star/inspection/XStringRepresentation.idl new file mode 100644 index 000000000..9a0cde4d7 --- /dev/null +++ b/offapi/com/sun/star/inspection/XStringRepresentation.idl @@ -0,0 +1,59 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_inspection_XStringRepresentation_idl__ +#define __com_sun_star_inspection_XStringRepresentation_idl__ + +#include + +module com { module sun { module star { module inspection { + +/** handles string representations of property values. + @see +*/ +interface XStringRepresentation +{ + /** converts a into a string. + @param PropertyValue + The to-be-converted property value. + @return + The converted string representation of the property value. + @see XPropertyHandler::convertToControlValue() + */ + string convertToControlValue([in]any PropertyValue) raises( com::sun::star::uno::Exception ); + + /** converts a string into an any with the type defined by the target type. + @param ControlValue + The to-be-converted control value. + @param ControlValueType + The target type of the conversion. + @see XPropertyHandler::convertToPropertyValue() + */ + any convertToPropertyValue( + [in]string ControlValue, + [in]type ControlValueType + ) raises( com::sun::star::uno::Exception ); +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3