1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: FormControllerDispatcher.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_form_FormControllerDispatcher_idl__
31 #define __com_sun_star_form_FormControllerDispatcher_idl__
33 #ifndef __com_sun_star_frame_XDispatchProvider_idl__
34 #include
<com
/sun
/star
/frame
/XDispatchProvider.idl
>
37 //=============================================================================
39 module com
{ module sun
{ module star
{ module form
{
41 //=============================================================================
43 /** specifies a component which can be used to dispatch form controller functionality.
45 <p>A form controller dispatcher is an instance which provides access to dispatchers
46 (<type scope="com::sun::star::frame">XDispatch</type>) for certain form controller
49 <p>The way how access to these dispatchers is provided is not defined. It may either
50 be directly via an <type scope="com::sun::star::frame">XDispatchProvider</type> interface,
51 or indirectly, e.g. by registering dispatch interceptors (<type scope="com::sun::star::frame">XDispatchProviderInterceptor</type>)
52 at another instance which supports this (by exposing the <type scope="com::sun::star::frame">XDispatchProviderInterception</type>
55 <p>In any scenario, foreign components have a (implicit or explicit) possibility to request a dispatcher
58 <p>Below, there's a list of URLs which have a defined meaning - if a <type>FormControllerDispatcher</type>
59 implementation supports one of them, there must be a guaranteed semantices. However, concrete implementations
60 may support an arbitrary sub or super set of these URLs.</p>
62 <p>In general, all URLs start with the same prefix, namely <em>.uno:FormController/</em>. To this, a suffix is
63 appended which describes the requested functionality.<br/>
64 Example: The URL suffix for deleting the current record is <em>deleteRecord</em>, so the complete URL for
65 requesting a dispatcher for this functionality is <em>.uno:FormController/deleteRecord</em>.</p>
67 <p>Some URLs may require parameters. For this, the sequence of <type scope="com::sun::star::beans">PropertyValue</type>s
68 passed to the <member scope="com::sun::star::frame">XDispatch::dispatch</member> call is used - every property value is
69 used as one named parameter.</p>
71 <p>For all URLs, interested parties can register as status listeners (<type scope="com::sun::star::frame">XStatusListener</type>)
72 at the dispatchers, and be notified whenever the functionality associated with the URL becomes enabled or
74 For instance, the URL with the suffix <em>moveToFirst</em> is associated with moving the form to the first
75 record, and it will be disabled in case the form is already positioned on the first record.</p>
77 <p>Nearly all of the functionality offered by a <type>FormControllerDispatcher</type> can also be
78 reached by other means. E.g., moving a form to its first record can be achieved by calling the
79 method <member scope="com::sun::star::sdbc">XResultSet::first</member> of the form.<br/>
80 However, the advantage of using a <type>FormControllerDispatcher</type> is that it's usually implemented
81 by a component which has additional knowledge about the form. For instance, in a document which
82 displays a form, there might be a control which contains uncommitted changes, plus a control
83 whose changes were already committed to the current record, but <em>not</em> to the database. Simply
84 calling <member scope="com::sun::star::sdbc">XResultSet::first</member> on the form would lose
85 both the content in the uncommitted control, and the changes in the current record.<br/>
86 An <type>FormControllerDispatcher</type> is expected to care for both of these.</p>
88 <table style="width:100%;" border="0" cellpadding="2" cellspacing="2"><tbody>
90 <tr style="vertical-align: top;">
91 <td><b>URL suffix</b></td>
92 <td><b>functionality</b></td>
95 <tr style="vertical-align: top;">
96 <td><em>positionForm</em></td>
97 <td>positions the form on a record given by absolute number.<br/>
98 There's one parameter for this functionality, named <em>Position</em>, which must be a long
99 value specifying the absolute position to which the form should be moved</td>
102 <tr style="vertical-align: top;">
103 <td><em>RecordCount</em></td>
104 <td>This is a passive functionality: It cannot be dispatched, instead, interested parties may
105 use the dispatcher to add as <type scope="com::sun::star::frame">XStatusListener</type>, and be
106 notified when the record count changes.<br/>
107 The status value which is being notified (<member scope="com::sun::star::frame">FeatureStateEvent::State</member>)
108 is a string which can be used to display the record count. In particular, if the record count is not yet known
109 (<member scope="com::sun::star::sdb">RowSet::IsRowCountFinal</member> is <FALSE/>), this is indicated in the
113 <tr style="vertical-align: top;">
114 <td><em>moveToFirst</em></td>
115 <td>moves the form to the first record</td>
118 <tr style="vertical-align: top;">
119 <td><em>moveToPrev</em></td>
120 <td>moves the form to the record preceding the current one</td>
123 <tr style="vertical-align: top;">
124 <td><em>moveToNext</em></td>
125 <td>moves the form to the record after the current one</td>
128 <tr style="vertical-align: top;">
129 <td><em>moveToLast</em></td>
130 <td>moves the form to the last record</td>
133 <tr style="vertical-align: top;">
134 <td><em>moveToNew</em></td>
135 <td>moves the form to the virtual "insert row", where new records can be inserted</td>
138 <tr style="vertical-align: top;">
139 <td><em>saveRecord</em></td>
140 <td>Commits any potentially pending changes in the current control, and saves the current record to
141 the database, or inserts a new record if the form is currently positioned on the virtual insertion row.</td>
144 <tr style="vertical-align: top;">
145 <td><em>undoRecord</em></td>
146 <td>reverts the changes done to the current record. Basically, this means refreshing the
147 current row from the database, and updating all controls with the new content.</td>
150 <tr style="vertical-align: top;">
151 <td><em>deleteRecord</em></td>
152 <td>deletes the current record, after asking the user for confirmation.</td>
155 <tr style="vertical-align: top;">
156 <td><em>refreshForm</em></td>
157 <td>reloads the complete form. After this, the form is positioned on the first record</td>
160 <tr style="vertical-align: top;">
161 <td><em>sortUp</em></td>
162 <td>Adds an order clause to the form, to sort it ascending by the field which the current control is bound to,
163 and then reloads the form.</td>
166 <tr style="vertical-align: top;">
167 <td><em>sortDown</em></td>
168 <td>Adds an order clause to the form, to sort it descending by the field which the current control is bound to,
169 and then reloads the form.</td>
172 <tr style="vertical-align: top;">
173 <td><em>sort</em></td>
174 <td>opens an dialog, which allows the user to manipulate the current sorting order of the form. If the dialog
175 is closed with OK, the form is reloaded after setting the new sorting order.</td>
178 <tr style="vertical-align: top;">
179 <td><em>autoFilter</em></td>
180 <td>creates, from the current control, a filter for the form. This is, if the current control is bound to
181 the field, say, "customer", and contains the value "Furs, Inc.", then a filter "customer = 'Furs, Inc.'"
182 is created and set at the form. After this, the form is reloaded.</td>
185 <tr style="vertical-align: top;">
186 <td><em>filter</em></td>
187 <td>opens an dialog, which allows the user to manipulate the current filter of the form. If the dialog
188 is closed with OK, the form is reloaded after setting the new filter.</td>
191 <tr style="vertical-align: top;">
192 <td><em>applyFilter</em></td>
193 <td><p>Toggles the <member scope="com::sun::star::sdb">RowSet::ApplyFilter</member> property
195 <p>Additionally, status listeners will be provided with the current (boolean) state of this property
196 in the <member scope="com::sun::star::frame">FeatureStateEvent::State</member> member of the event
197 notified by the dispatcher.</p></td>
200 <tr style="vertical-align: top;">
201 <td><em>removeFilterOrder</em></td>
202 <td>completely removes any filter and sorting order from the form, and reloads it.</td>
209 published service FormControllerDispatcher
211 //-------------------------------------------------------------------------
212 /** allows direct access to the dispatchers provided by the component.
214 [optional] interface com
::sun
::star
::frame
::XDispatchProvider
;
217 //=============================================================================
221 /*=============================================================================
223 =============================================================================*/