/************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: FormController.idl,v $ * $Revision: 1.13 $ * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 * only, as published by the Free Software Foundation. * * OpenOffice.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License version 3 for more details * (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU Lesser General Public License * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. * ************************************************************************/ #ifndef __com_sun_star_form_FormController_idl__ #define __com_sun_star_form_FormController_idl__ #ifndef __com_sun_star_form_XFormController_idl__ #include #endif #ifndef __com_sun_star_awt_XTabController_idl__ #include #endif #ifndef __com_sun_star_container_XChild_idl__ #include #endif #ifndef __com_sun_star_lang_XComponent_idl__ #include #endif #ifndef __com_sun_star_container_XEnumerationAccess_idl__ #include #endif #ifndef __com_sun_star_util_XModifyBroadcaster_idl__ #include #endif #ifndef __com_sun_star_form_XConfirmDeleteBroadcaster_idl__ #include #endif #ifndef __com_sun_star_sdb_XSQLErrorBroadcaster_idl__ #include #endif #ifndef __com_sun_star_sdb_XRowSetApproveBroadcaster_idl__ #include #endif #ifndef __com_sun_star_form_XDatabaseParameterBroadcaster_idl__ #include #endif #ifndef __com_sun_star_form_FormControllerDispatcher_idl__ #include #endif //============================================================================= module com { module sun { module star { module form { module runtime { published interface XFormOperations; }; //============================================================================= /** specifies a component controlling the interaction between the user and form functionality.

As soon as a form (containing controls) is to be presented to the user, there is a need for an instance controlling the user interaction.
Such a FormController is responsible for dialog processing, like controlling the tab order and the grouping of controls.

As a form may contain one or many subforms, a FormController may contain one or more other FormControllers, so the form model structure or hierarchy is reflected in the structure of FormControllers.

Responsibilities

A FormController is responsible for a UnoControlContainer, and all controls therein.

Furthermore, a form controller is responsible for preventing invalid user input. That is, if the form contains controls bound to a database, or to an external validator, then the form controller will check their current value when the current record is to be saved to the database.

First, it will check whether any controls with an external validator exist. If so, those validators will be asked to validate the current control content. If this fails, the message provided by the validator is displayed to the user, the control is focused, and the update of the record is vetoed.

Second, the controls are examined for NULL values. If a control is bound to a database field which is declared to be NOT NULL, no auto-increment field, but still , then an error message is shown to the user saying that input is required, the respective control is focused, and the update of the record is vetoed.

Note that you can precent the second check - for database fields containing values - on a per-form and a per-database basis.
For the former, you need to add a boolean property FormsCheckRequiredFields to the form (aka the FormController's model), using its XPropertyContainer::addProperty method, with a value of .
For the latter, you need to set the respective property of the data source's Settings (also named FormsCheckRequiredFields) to .

Alternatively, you can prevent the check on a per-control basis, using the DataAwareControlModel::InputRequired property of a single control model.

@see com::sun::star::form::component:Form @see com::sun::star::awt::XTabController @see com::sun::star::form::binding::BindableControlModel @see com::sun::star::sdb::DataSource::Settings */ published service FormController { /** allows delegating form controller functionality to the component

If a control which the controller is responsible for supports the XDispatchProviderInterception interface, the controller registers a dispatch interceptor. Then, the control can try to delegate part of its functionality to the controller by querying the dispatch interceptor for it.

*/ [optional] service FormControllerDispatcher; /** denotes the instance which is used to implement operations on the form which the controller works for.

This instance can be used, for instance, to determine the current state of certain form features.

*/ [optional, property] ::com::sun::star::form::runtime::XFormOperations FormOperations; /** is used for notifying the (de)activation of the controller. */ interface com::sun::star::form::XFormController; /** is used for tab controlling and grouping of the controls. */ interface com::sun::star::awt::XTabController; /** A FormController may have a parent controller, such as when the related form is a subform. */ interface com::sun::star::container::XChild; /** A FormController must be disposable. */ interface com::sun::star::lang::XComponent; /** A FormController must provide access to its sub controllers. */ interface com::sun::star::container::XEnumerationAccess; /** A FormController must communicate if any of its children (means sub controllers) or contained controls have been modified. */ interface com::sun::star::util::XModifyBroadcaster; /** used to notify deletions of data in the form before they happen.

A form controller listens for deletion events at the form it is responsible for.
If and only if no XConfirmDeleteListener is registered at the controller, it uses an own dialog to ask the user for confirmation.

You may use this interface to integrate your own confirmation dialogs.

*/ interface com::sun::star::form::XConfirmDeleteBroadcaster; /** used to notify errors which happen in the form the controller is responsible for.

A form controller listens for error events at the form it is responsible for.
If and only if no XSQLErrorListener is registered at the controller, it uses an own dialog to notify the user of the error.

*/ interface com::sun::star::sdb::XSQLErrorBroadcaster; /** is used for multiplexing row set events happening on the form which the controller is responsible for. */ interface com::sun::star::sdb::XRowSetApproveBroadcaster; /** is used broadcasting parameter events in the form.

A form controller listens for parameter events at the form it is responsible for.
If and only if no XDatabaseParameterListener is registered at the controller, it uses an own dialog to ask the user for parameter values.

*/ interface com::sun::star::form::XDatabaseParameterBroadcaster; }; //============================================================================= }; }; }; }; /*============================================================================= =============================================================================*/ #endif