/************************************************************************* * * 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: XFormController.idl,v $ * $Revision: 1.9 $ * * 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_XFormController_idl__ #define __com_sun_star_form_XFormController_idl__ #ifndef __com_sun_star_awt_XTabController_idl__ #include #endif #ifndef __com_sun_star_awt_XControl_idl__ #include #endif #ifndef __com_sun_star_form_XFormControllerListener_idl__ #include #endif //============================================================================= module com { module sun { module star { module form { //============================================================================= /** provides functionality to control the activation of forms controls.

There is a duality of forms (DataForm) and form controllers. In a document view, for every loaded form there is a form controller which is responsible for exactly the controls which's models are direct children of the form.
In some sense, a form controller is the view representation of a form, like a form control is the view representation of a form control model.
This is also reflected in this interface: If you call XTabController::getModel on a form controller, the form which the controller is responsible for will be returned.
As always in the model-view-paradigm, there is no way from a model to its controller, mostly, because for one given form, there is one controller for every view of the document.

A controller is called active if one of the controls it is responsible for has the focus, else inactive. To be notified whenever this activation state of a given controller changes, you can add listeners.

@see com::sun::star::form::component::Form */ published interface XFormController: com::sun::star::awt::XTabController { //------------------------------------------------------------------------- /** access to the currently active control @returns the currently active control, or if there is no such control */ com::sun::star::awt::XControl getCurrentControl(); //------------------------------------------------------------------------- /** adds the specified listener to receive notifications whenever the activation state of the controller changes. @param l the listener to add. */ [oneway] void addActivateListener( [in] com::sun::star::form::XFormControllerListener l ); //------------------------------------------------------------------------- /** removes the specified listener @param l the listener to remove. */ [oneway] void removeActivateListener( [in] com::sun::star::form::XFormControllerListener l ); }; //============================================================================= }; }; }; }; /*============================================================================= =============================================================================*/ #endif