xref: /AOO41X/main/offapi/com/sun/star/form/component/DataForm.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19cdf0e10cSrcweir *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_form_component_DataForm_idl__
24cdf0e10cSrcweir#define __com_sun_star_form_component_DataForm_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_form_component_Form_idl__
27cdf0e10cSrcweir#include <com/sun/star/form/component/Form.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir#ifndef __com_sun_star_sdb_RowSet_idl__
31cdf0e10cSrcweir#include <com/sun/star/sdb/RowSet.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir#ifndef __com_sun_star_form_TabulatorCycle_idl__
35cdf0e10cSrcweir#include <com/sun/star/form/TabulatorCycle.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir#ifndef __com_sun_star_form_NavigationBarMode_idl__
39cdf0e10cSrcweir#include <com/sun/star/form/NavigationBarMode.idl>
40cdf0e10cSrcweir#endif
41cdf0e10cSrcweir
42cdf0e10cSrcweir#ifndef __com_sun_star_form_XLoadable_idl__
43cdf0e10cSrcweir#include <com/sun/star/form/XLoadable.idl>
44cdf0e10cSrcweir#endif
45cdf0e10cSrcweir
46cdf0e10cSrcweir#ifndef __com_sun_star_sdb_XCompletedExecution_idl__
47cdf0e10cSrcweir#include <com/sun/star/sdb/XCompletedExecution.idl>
48cdf0e10cSrcweir#endif
49cdf0e10cSrcweir
50cdf0e10cSrcweir#ifndef __com_sun_star_awt_TabControllerModel_idl__
51cdf0e10cSrcweir#include <com/sun/star/awt/TabControllerModel.idl>
52cdf0e10cSrcweir#endif
53cdf0e10cSrcweir
54cdf0e10cSrcweir//=============================================================================
55cdf0e10cSrcweir
56cdf0e10cSrcweirmodule com { module sun { module star { module form {
57cdf0e10cSrcweir
58cdf0e10cSrcweir published interface XReset;
59cdf0e10cSrcweir published interface XDatabaseParameterBroadcaster;
60cdf0e10cSrcweir
61cdf0e10cSrcweirmodule component {
62cdf0e10cSrcweir//=============================================================================
63cdf0e10cSrcweir/** This service specifies a form which is connected to a database and
64cdf0e10cSrcweir	displays the results of SQL queries. It provides the possiblity of
65cdf0e10cSrcweir	adding new data records, modifying existing ones, or deleting them.
66cdf0e10cSrcweir
67cdf0e10cSrcweir	<p>A database form is a special kind of enhanced database row set
68cdf0e10cSrcweir	which provides all information for displaying the data and has more
69cdf0e10cSrcweir	possibilities for configuring the data manipulation.</p>
70cdf0e10cSrcweir
71cdf0e10cSrcweir*/
72cdf0e10cSrcweirpublished service DataForm
73cdf0e10cSrcweir{
74cdf0e10cSrcweir	service com::sun::star::sdb::RowSet;
75cdf0e10cSrcweir	service com::sun::star::form::component::Form;
76cdf0e10cSrcweir
77cdf0e10cSrcweir	/** is used to reset controls belonging to the form, and to reset database fields to which the
78cdf0e10cSrcweir        controls are bound
79cdf0e10cSrcweir
80cdf0e10cSrcweir		<p>A <type>DataForm</type> is reset either on explicit request, or after it is moved
81cdf0e10cSrcweir        to the insertion row.</p>
82cdf0e10cSrcweir
83cdf0e10cSrcweir        <p>The insertion row is a virtual row which is used to insert new records. It is reached
84cdf0e10cSrcweir        by calling <member scope="com::sun::star::sdbc">XResultSetUpdate::moveToInsertRow</member>.
85cdf0e10cSrcweir        The <type scope="com::sun::star::sdb">RowSet</type> service specifies exactly which notifications
86cdf0e10cSrcweir        happen in which order when calling <member scope="com::sun::star::sdbc">XResultSetUpdate::moveToInsertRow</member>,
87cdf0e10cSrcweir        and a <type>DataForm</type> implementation extends this with the following contract:
88cdf0e10cSrcweir        <ul><li>After all notifications as defined in the <type scope="com::sun::star::sdb">RowSet</type>
89cdf0e10cSrcweir                service have been sent, the <type>DataForm</type> resets itself, if all
90cdf0e10cSrcweir                <type scope="com::sun::star::form">XResetListeners</type> approve this.</li>
91cdf0e10cSrcweir            <li>After the reset happened, the <member scope="com::sun::star::sdb">RowSet::IsModified</member>
92cdf0e10cSrcweir                property is reset to <FALSE/>. This property might have been switched to <TRUE/> during listener
93cdf0e10cSrcweir                notifications, since listeners are allowed to change field values. Also, the
94cdf0e10cSrcweir                <member scope="com::sun::star::form">XReset::reset</member> implementations of bound control
95cdf0e10cSrcweir                models might have modified the fields they're bound to (by filling them with default values).</li>
96cdf0e10cSrcweir            <li>The reset listeners are notified of the completed reset operation.</li>
97cdf0e10cSrcweir        </ul></p>
98cdf0e10cSrcweir	*/
99cdf0e10cSrcweir	interface com::sun::star::form::XReset;
100cdf0e10cSrcweir
101cdf0e10cSrcweir	/** used to load/unload the form
102cdf0e10cSrcweir		<p>Loading a form is basically the same as executing the underlying row set. In fact, all the
103cdf0e10cSrcweir		functionality of this interface could be simulated by using setting some properties manually,
104cdf0e10cSrcweir        <member scope="com::sun::star::sdbc">XRowSet::execute</member>, moving the row set cursor and so on.</p>
105cdf0e10cSrcweir
106cdf0e10cSrcweir        <p>One main difference between <member>XLoadable::load</member> and <member scope="com::sun::star::sdbc">XRowSet::execute</member>
107cdf0e10cSrcweir		is that if you use the former, the row set is positioned on the first record, while in the latter case
108cdf0e10cSrcweir		it is position <em>before</em> the it.</p>
109cdf0e10cSrcweir	*/
110cdf0e10cSrcweir	interface com::sun::star::form::XLoadable;
111cdf0e10cSrcweir
112cdf0e10cSrcweir	/** can be used to allow an interaction handler to supply missing data during a load process.
113cdf0e10cSrcweir
114cdf0e10cSrcweir		<p>If data is needed during loading a form, then this is usually obtained via broadcaster-listener
115cdf0e10cSrcweir		mechanisms. An example for this (and currently the only one) are parameter values.</p>
116cdf0e10cSrcweir		<p>However, if you use this method, you can pass an interaction handler which should supply these
117cdf0e10cSrcweir		additional data.</p>
118cdf0e10cSrcweir
119cdf0e10cSrcweir		@see com::sun::star::sdb::InteractionHandler
120cdf0e10cSrcweir	*/
121cdf0e10cSrcweir	interface com::sun::star::sdb::XCompletedExecution;
122cdf0e10cSrcweir
123cdf0e10cSrcweir	/** can be used for filling parameters.
124cdf0e10cSrcweir
125cdf0e10cSrcweir		<p>You can add your component as
126cdf0e10cSrcweir		<type scope="com::sun::star::form">XDatabaseParameterListener</type>
127cdf0e10cSrcweir		to a form to get notified whenever the form needs parameter values to be filled in<br/>
128cdf0e10cSrcweir		In a first approach, the form tries to fill any parameters from it's master-detail relation
129cdf0e10cSrcweir		(if any). All values which can't be filled are then passed to all listeners, which can
130cdf0e10cSrcweir		fill them by their own choice.</p>
131cdf0e10cSrcweir
132cdf0e10cSrcweir		<p>This is sligtly changed if the form is loaded using the
133cdf0e10cSrcweir		<member scope="com::sun::star::sdb">XCompletedExecution::connectWithCompletion</member> method. In this case, the parameters
134cdf0e10cSrcweir		are obtained from the interaction handler, not from the listeners</p>
135cdf0e10cSrcweir
136cdf0e10cSrcweir		@see XCompletedExecution
137cdf0e10cSrcweir		@see MasterFields
138cdf0e10cSrcweir		@see DetailFields
139cdf0e10cSrcweir	*/
140cdf0e10cSrcweir	interface com::sun::star::form::XDatabaseParameterBroadcaster;
141cdf0e10cSrcweir
142cdf0e10cSrcweir	//-------------------------------------------------------------------------
143cdf0e10cSrcweir	/** is used for subforms and contains the names of columns of the parent form.
144cdf0e10cSrcweir
145cdf0e10cSrcweir        <p> These columns are typically the foreign key fields of the parent form.
146cdf0e10cSrcweir        The values of theses columns are used to identify the data for the subform.
147cdf0e10cSrcweir        Each time the parent form changes it's current row, the subform requeries
148cdf0e10cSrcweir        it's data based on the values of the master fields.</p>
149cdf0e10cSrcweir
150cdf0e10cSrcweir        <p>If the form is no sub form (e.g. it's parent is not a form itself), this
151cdf0e10cSrcweir        property is not evaluated.</p>
152cdf0e10cSrcweir	*/
153cdf0e10cSrcweir	[property] sequence<string> MasterFields;
154cdf0e10cSrcweir
155cdf0e10cSrcweir	//-------------------------------------------------------------------------
156cdf0e10cSrcweir	/** is used for subforms and contains the names of the columns of the subform
157cdf0e10cSrcweir	    which are related to the master fields of the parent form.
158cdf0e10cSrcweir
159cdf0e10cSrcweir        <p>Entries in this sequence can either denote column names in the sub form,
160cdf0e10cSrcweir        or paramater names.<br/>
161cdf0e10cSrcweir        For instance, you could base the form on the SQL statement
162cdf0e10cSrcweir        <code>SELECT * FROM invoices WHERE cust_ref = :cid</code>, and add <code>cid</code>
163cdf0e10cSrcweir        to the DetailFields property. In this case, the parameter will be filled from
164cdf0e10cSrcweir        the corresponding master field.<br/>
165cdf0e10cSrcweir        Alternatively, you could simply base your form on the table <code>invoices</code>,
166cdf0e10cSrcweir        and add the column name <code>cust_ref</code> to the DetailFields. In this case,
167cdf0e10cSrcweir        and implicit filter clause <code>WHERE cust_ref = :&lt;new_param_name&gt;</code> will
168cdf0e10cSrcweir        be created, and the artificial parameter will be filled from the corresponding
169cdf0e10cSrcweir        master field.<br/>
170cdf0e10cSrcweir        If a string in this property denotes both a column name and a parameter name, it
171cdf0e10cSrcweir        is undefined which way it is interpreted, but implementations of the service are required
172cdf0e10cSrcweir        to either decide for the paramter or the column, and proceed as usual.
173cdf0e10cSrcweir        </p>
174cdf0e10cSrcweir
175cdf0e10cSrcweir        <p>The columns specified herein typically represent a part of the primary key
176cdf0e10cSrcweir        fields or their aliases of the detail form.</p>
177cdf0e10cSrcweir
178cdf0e10cSrcweir        <p>If the form is no sub form (e.g. it's parent is not a form itself), this
179cdf0e10cSrcweir        property is not evaluated.</p>
180cdf0e10cSrcweir	*/
181cdf0e10cSrcweir	[property] sequence<string> DetailFields;
182cdf0e10cSrcweir
183cdf0e10cSrcweir	//-------------------------------------------------------------------------
184cdf0e10cSrcweir	/** returns the kind of tabulator controlling.
185cdf0e10cSrcweir	*/
186cdf0e10cSrcweir	[property] com::sun::star::form::TabulatorCycle Cycle;
187cdf0e10cSrcweir
188cdf0e10cSrcweir	//-------------------------------------------------------------------------
189cdf0e10cSrcweir	/** determines how an navigation bar for this form should act.
190cdf0e10cSrcweir	*/
191cdf0e10cSrcweir	[property] com::sun::star::form::NavigationBarMode NavigationBarMode;
192cdf0e10cSrcweir
193cdf0e10cSrcweir	//-------------------------------------------------------------------------
194cdf0e10cSrcweir	/** determines if insertions into the form's row set are allowed.
195cdf0e10cSrcweir
196cdf0e10cSrcweir		<p>Note that this is a recommendation for user interface components displaying the
197cdf0e10cSrcweir		form. Form implementations may decide to allow for insertions done via the API, even
198cdf0e10cSrcweir		if the property is set to <FALSE/>, but the user interface should respect the property
199cdf0e10cSrcweir		value.</p>
200cdf0e10cSrcweir	*/
201cdf0e10cSrcweir	[property] boolean AllowInserts;
202cdf0e10cSrcweir
203cdf0e10cSrcweir	//-------------------------------------------------------------------------
204cdf0e10cSrcweir	/** determines if modifications of the current record of the form are allowed.
205cdf0e10cSrcweir
206cdf0e10cSrcweir		<p>Note that this is a recommendation for user interface components displaying the
207cdf0e10cSrcweir		form. Form implementations may decide to allow for updates done via the API, even
208cdf0e10cSrcweir		if the property is set to <FALSE/>, but the user interface should respect the property
209cdf0e10cSrcweir		value.</p>
210cdf0e10cSrcweir	*/
211cdf0e10cSrcweir	[property] boolean AllowUpdates;
212cdf0e10cSrcweir
213cdf0e10cSrcweir	//-------------------------------------------------------------------------
214cdf0e10cSrcweir	/** determines if deletions of records of the form are allowed.
215cdf0e10cSrcweir
216cdf0e10cSrcweir		<p>Note that this is a recommendation for user interface components displaying the
217cdf0e10cSrcweir		form. Form implementations may decide to allow for deletions done via the API, even
218cdf0e10cSrcweir		if the property is set to <FALSE/>, but the user interface should respect the property
219cdf0e10cSrcweir		value.</p>
220cdf0e10cSrcweir	*/
221cdf0e10cSrcweir	[property] boolean AllowDeletes;
222cdf0e10cSrcweir};
223cdf0e10cSrcweir
224cdf0e10cSrcweir//=============================================================================
225cdf0e10cSrcweir
226cdf0e10cSrcweir}; }; }; }; };
227cdf0e10cSrcweir
228cdf0e10cSrcweir#endif
229