xref: /core/offapi/com/sun/star/xforms/XModel.idl (revision 5687eba4)
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 *   Licensed to the Apache Software Foundation (ASF) under one or more
12 *   contributor license agreements. See the NOTICE file distributed
13 *   with this work for additional information regarding copyright
14 *   ownership. The ASF licenses this file to you under the Apache
15 *   License, Version 2.0 (the "License"); you may not use this file
16 *   except in compliance with the License. You may obtain a copy of
17 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
21module com {  module sun {  module star {  module xforms {
22
23interface XSubmission;
24
25
26/** represent an XForms model
27 */
28interface XModel
29{
30    /** get the XForms model ID */
31    string getID();
32
33    /** set the XForms model ID */
34    void setID( [in] string id );
35
36
37    /** initialize the model */
38    void initialize();
39
40    /** rebuild the model */
41    void rebuild();
42
43    /** re-evaluate all calculate attributes */
44    void recalculate();
45
46    /** re-evaluate all validity attributes */
47    void revalidate();
48
49    /** refresh the model */
50    void refresh();
51
52
53    /** submit form through given submission id
54
55        <p>This is a convenience method. Calling it is equivalent to calling
56        <code>getSubmission()( id ).submit()</code>.</p>
57
58        @param id
59            the ID of the submission to execute
60
61        @throws com::sun::star::util::VetoException
62            when the current model state does not allow a submission. Usually, this indicates that
63            consistency criteria for the model data is not fulfilled.
64
65        @throws com::sun::star::lang::WrappedTargetException
66            when another error occurred during the submission. The
67            com::sun::star::lang::WrappedTargetException::TargetException describes
68            this error then.
69    */
70    void submit( [in] string id )
71        raises ( com::sun::star::util::VetoException, com::sun::star::lang::WrappedTargetException );
72
73    /** submit form through given submission id
74
75        <p>This is a convenience method. Calling it is equivalent to calling
76        <code>getSubmission()( id, handler ).submit()</code>.</p>
77
78        @param id
79            the ID of the submission to execute
80
81        @param aHandler
82            This handler allows additional user interaction, which may be necessary before
83            the submission can be performed.
84
85        @throws com::sun::star::util::VetoException
86            when the current model state does not allow a submission. Usually, this indicates that
87            consistency criteria for the model data is not fulfilled.
88
89        @throws com::sun::star::lang::WrappedTargetException
90            when another error occurred during the submission. The
91            com::sun::star::lang::WrappedTargetException::TargetException describes
92            this error then.
93    */
94    void submitWithInteraction( [in] string id, [in] com::sun::star::task::XInteractionHandler aHandler )
95        raises ( com::sun::star::util::VetoException, com::sun::star::lang::WrappedTargetException );
96
97    /** provides management access to the XSD data types associated with the model
98    */
99    XDataTypeRepository
100        getDataTypeRepository( );
101
102
103    // instances
104
105    /** gets container containing all instances;
106
107        <p>The elements of the set are arrays of com::sun::star::beans::PropertyValues,
108        containing the ID, the URL, and the instance itself.</p>
109    */
110    com::sun::star::container::XSet getInstances();
111
112    /** retrieves the instance with the given id
113    */
114    com::sun::star::xml::dom::XDocument getInstanceDocument( [in] string id );
115
116    /** get the default instance for this model
117    */
118    com::sun::star::xml::dom::XDocument getDefaultInstance();
119
120
121    // bindings
122
123    /** create a binding element for this model
124
125        <p>The returned binding still needs to be inserted into the bindings container.</p>
126
127        @see getBindings
128    */
129    com::sun::star::beans::XPropertySet createBinding();
130
131    /** clone an arbitrary binding element for this model; still needs
132
133        <p>The returned binding still needs to be inserted into the bindings container.</p>
134
135        @see getBindings
136    */
137    com::sun::star::beans::XPropertySet cloneBinding( [in] com::sun::star::beans::XPropertySet binding );
138
139    /** get a binding with a certain ID
140
141        <p>This is a convenience method: the same result can also be obtained through
142        getBindings()</p>
143    */
144    com::sun::star::beans::XPropertySet getBinding( [in] string id );
145
146    /** get a container containing all bindings; also supports XNameAccess
147    */
148    com::sun::star::container::XSet getBindings();
149
150
151    // submissions
152
153    /** create a submission element for this model
154
155        <p>The returned submission element still needs to be inserted into the submission container.</p>
156
157        @see getSubmissions
158    */
159    XSubmission createSubmission();
160
161    /** clone an arbitrary submission element for this model
162
163        <p>The returned submission element still needs to be inserted into the submission container.</p>
164
165        @see getSubmissions
166    */
167    XSubmission cloneSubmission( [in] com::sun::star::beans::XPropertySet submission );
168
169    /** get a submission with a certain ID.
170
171        <p>This is a convenience method: the same result can also be obtained through
172        getSubmissions().</p>
173    */
174    XSubmission getSubmission( [in] string id );
175
176    /** get container containing all submissions; also supports XNameAccess
177    */
178    com::sun::star::container::XSet getSubmissions();
179};
180
181
182}; }; }; };
183
184/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
185