xref: /aoo42x/main/offapi/com/sun/star/xforms/XModel.idl (revision a893be29)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_xforms_XModel_idl__
24#define __com_sun_star_xforms_XModel_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_beans_XPropertySet_idl__
31#include <com/sun/star/beans/XPropertySet.idl>
32#endif
33
34#ifndef __com_sun_star_container_XIndexAccess_idl__
35#include <com/sun/star/container/XSet.idl>
36#endif
37
38#ifndef __com_sun_star_xforms_XDataTypeRepository_idl__
39#include <com/sun/star/xforms/XDataTypeRepository.idl>
40#endif
41
42#ifndef __com_sun_star_xml_dom_XDocument_idl__
43#include <com/sun/star/xml/dom/XDocument.idl>
44#endif
45
46#ifndef __com_sun_star_util_VetoException_idl__
47#include <com/sun/star/util/VetoException.idl>
48#endif
49
50#ifndef __com_sun_star_lang_WrappedTargetException_idl__
51#include <com/sun/star/lang/WrappedTargetException.idl>
52#endif
53
54#ifndef __com_sun_star_task_XInteractionHandler_idl__
55#include <com/sun/star/task/XInteractionHandler.idl>
56#endif
57
58//=============================================================================
59
60module com {  module sun {  module star {  module xforms {
61
62interface XSubmission;
63
64//=============================================================================
65
66/** represent an XForms model
67 */
68interface XModel
69{
70    /** get the XForms model ID */
71    string getID();
72
73    /** set the XForms model ID */
74    void setID( [in] string id );
75
76
77    /** initialize the model */
78    void initialize();
79
80    /** rebuild the model */
81    void rebuild();
82
83    /** re-evaluate all calculate attributes */
84    void recalculate();
85
86    /** re-evaluate all validity attributes */
87    void revalidate();
88
89    /** refresh the model */
90    void refresh();
91
92
93    /** submit form through given submission id
94
95        <p>This is a convenience method. Calling it is equivalent to calling
96        <code><member>getSubmission</member>( <arg>id</arg> ).submit()</code>.</p>
97
98        @param id
99            the ID of the submission to execute
100
101        @throws com::sun::star::util::VetoException
102            when the current model state does not allow a submission. Usually, this indicates that
103            consistency criteria for the model data is not fulfilled.
104
105        @throws com::sun::star::lang::WrappedTargetException
106            when another error occurred during the submission. The
107            <member scope="com::sun::star::lang">WrappedTargetException::TargetException</member> describes
108            this error then.
109    */
110    void submit( [in] string id )
111        raises ( com::sun::star::util::VetoException, com::sun::star::lang::WrappedTargetException );
112
113    /** submit form through given submission id
114
115        <p>This is a convenience method. Calling it is equivalent to calling
116        <code><member>getSubmission</member>( <arg>id</arg>, <arg>handler</arg> ).submit()</code>.</p>
117
118        @param id
119            the ID of the submission to execute
120
121        @param aHandler
122            This handler allows additional user interaction, which may be necessary before
123            the submission can be performed.
124
125        @throws com::sun::star::util::VetoException
126            when the current model state does not allow a submission. Usually, this indicates that
127            consistency criteria for the model data is not fulfilled.
128
129        @throws com::sun::star::lang::WrappedTargetException
130            when another error occurred during the submission. The
131            <member scope="com::sun::star::lang">WrappedTargetException::TargetException</member> describes
132            this error then.
133    */
134    void submitWithInteraction( [in] string id, [in] com::sun::star::task::XInteractionHandler aHandler )
135        raises ( com::sun::star::util::VetoException, com::sun::star::lang::WrappedTargetException );
136
137    /** provides management access to the XSD data types associated with the model
138    */
139    XDataTypeRepository
140        getDataTypeRepository( );
141
142
143    //
144    // instances
145    //
146
147    /** gets container containing all instances;
148
149        <p>The elements of the set are arrays of <type scope="com::sun::star::beans">PropertyValue</type>s,
150        containing the ID, the URL, and the instance itself.</p>
151    */
152    com::sun::star::container::XSet getInstances();
153
154    /** retrieves the instance with the given id
155    */
156    com::sun::star::xml::dom::XDocument getInstanceDocument( [in] string id );
157
158    /** get the default instance for this model
159    */
160    com::sun::star::xml::dom::XDocument getDefaultInstance();
161
162
163    //
164    // bindings
165    //
166
167    /** create a binding element for this model
168
169        <p>The returned binding still needs to be inserted into the bindings container.</p>
170
171        @see getBindings
172    */
173    com::sun::star::beans::XPropertySet createBinding();
174
175    /** clone an arbitrary binding element for this model; still needs
176
177        <p>The returned binding still needs to be inserted into the bindings container.</p>
178
179        @see getBindings
180    */
181    com::sun::star::beans::XPropertySet cloneBinding( [in] com::sun::star::beans::XPropertySet binding );
182
183    /** get a binding with a certain ID
184
185        <p>This is a convenience method: the same result can also be obtained through
186        <member>getBindings</member></p>
187    */
188    com::sun::star::beans::XPropertySet getBinding( [in] string id );
189
190    /** get a container containing all bindings; also supports XNameAccess
191    */
192    com::sun::star::container::XSet getBindings();
193
194
195    //
196    // submissions
197    //
198
199    /** create a submission element for this model
200
201        <p>The returned submission element still needs to be inserted into the submission container.</p>
202
203        @see getSubmissions
204    */
205    XSubmission createSubmission();
206
207    /** clone an arbitrary submission element for this model
208
209        <p>The returned submission element still needs to be inserted into the submission container.</p>
210
211        @see getSubmissions
212    */
213    XSubmission cloneSubmission( [in] com::sun::star::beans::XPropertySet submission );
214
215    /** get a submission with a certain ID.
216
217        <p>This is a convenience method: the same result can also be obtained through
218        <member>getSubmissions</member>.</p>
219    */
220    XSubmission getSubmission( [in] string id );
221
222    /** get container containing all submissions; also supports XNameAccess
223    */
224    com::sun::star::container::XSet getSubmissions();
225};
226
227//=============================================================================
228
229}; }; }; };
230
231/*=============================================================================
232
233=============================================================================*/
234#endif
235