/**************************************************************
*
* 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
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
#ifndef __com_sun_star_drawing_framework_XConfigurationController_idl__
#define __com_sun_star_drawing_framework_XConfigurationController_idl__
#ifndef __com_sun_star_drawing_framework_ConfigurationChangeEvent_idl__
#include There are two configurations of resources:
When the two configurations differ then the current configuration is updated eventually to reflect the requested configuration. An update takes place when the following three conditions are fullfilled.
Requests for configuration changes are handled in a two step process:
This process goes on until the queue of request objects becomes empty. Until this point only the requested configuration has been modified. No resources have been activated or deactivated.
The second update step activates or deactivates resources so that the current configuration (the one that comprises the actually active resources) reflects the requested configuration.
The order in which resources are activated or deactivated depends on the dependency between the resources. For example a view depends on the pane it is displayed in. Resources that other resources depend on are activated first and deactivated last. The order is undefined for unrelated resources.
Note that the second update step may not be able to activate (or even to deactivate) all the requested resources. Either because they are temporarily or permanently unavailable. For example, during the start-up of a new Impress application the side panes are displayed with a visible delay because they are not provided sooner by the underlying framework. Such anavailable resources are not forgotten but remain in the requested configuration. Every time the configuration controller updates its current configuration these resources are requested once more.
The configuration controller sends the following events:
The
The
The requested configuration is available in the
The requested configuration is
available in the
The
The
The request is processed asynchronously. Notifications about configuration changes are sent after this call returns.
@param xResourceId The resource whose activation is requested. @param eModeWhen eMode is
When eMode is
The request is processed asynchronously. Notifications about configuration changes are sent after this call returns.
Requesting the deactivation of a resource that is not active is not an error.
@param xResourceId The resource whose deactivation is requested. */ void requestResourceDeactivation ( [in] XResourceId xResourceId); /** Return the active resource specified by the given resource id. @param xResourceId A valid resource id. This should, but does not have to be, the resource id of an active resource. @return When the given resource id specifies an active resource then that resource is returned. Otherwise an empty reference is returned. */ XResource getResource ( [in] XResourceId xResourceId); /** Lock the processing of configuration change requests.This is only necessary when more than one change request is being made in a row. It prevents an update being made (with all the visible UI changes) before all change requests are being made.
Recursive
When
Call it when a resource is activated or deactivated without the control and knowledge of the drawing framework. Calling this method (from outside the drawing framework) should hardly every be necessary.
*/ void update (); /** Return a copy of the requested configuration.Modifications to the returned configuration have no effect on the drawing framework.
*/ XConfiguration getRequestedConfiguration (); /** Return a copy of the current configuration.Modifications to the returned configuration have no effect on the drawing framework.
*/ XConfiguration getCurrentConfiguration (); /** Replace the requested configuration with the given configuration and schedule an update of the current configuration.Together with the
The given configuration is transformed into a list of of change requests so that the resulting reqeusted configuration equals the given configuration. This has the advantage that not only the resource activations and deactivations but all configuration changes are properly broadcasted.
Note that because of the configuration change notifications listeners can make more configuratio change requests, so that the resulting requested configuration can be different from the given configuration.
@param xConfiguration This typically is a configuration that was obtained with an earlier