Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / xforms / XModel.idl
blobc5ecab23f3fcf8ce40ee2b6355bf75707fcb28e3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef __com_sun_star_xforms_XModel_idl__
20 #define __com_sun_star_xforms_XModel_idl__
22 #include <com/sun/star/uno/XInterface.idl>
24 #include <com/sun/star/beans/XPropertySet.idl>
25 #include <com/sun/star/container/XSet.idl>
26 #include <com/sun/star/xforms/XDataTypeRepository.idl>
27 #include <com/sun/star/xml/dom/XDocument.idl>
28 #include <com/sun/star/util/VetoException.idl>
29 #include <com/sun/star/lang/WrappedTargetException.idl>
30 #include <com/sun/star/task/XInteractionHandler.idl>
33 module com { module sun { module star { module xforms {
35 interface XSubmission;
38 /** represent an XForms model
40 interface XModel
42 /** get the XForms model ID */
43 string getID();
45 /** set the XForms model ID */
46 void setID( [in] string id );
49 /** initialize the model */
50 void initialize();
52 /** rebuild the model */
53 void rebuild();
55 /** re-evaluate all calculate attributes */
56 void recalculate();
58 /** re-evaluate all validity attributes */
59 void revalidate();
61 /** refresh the model */
62 void refresh();
65 /** submit form through given submission id
67 <p>This is a convenience method. Calling it is equivalent to calling
68 <code>getSubmission()( id ).submit()</code>.</p>
70 @param id
71 the ID of the submission to execute
73 @throws com::sun::star::util::VetoException
74 when the current model state does not allow a submission. Usually, this indicates that
75 consistency criteria for the model data is not fulfilled.
77 @throws com::sun::star::lang::WrappedTargetException
78 when another error occurred during the submission. The
79 com::sun::star::lang::WrappedTargetException::TargetException describes
80 this error then.
82 void submit( [in] string id )
83 raises ( com::sun::star::util::VetoException, com::sun::star::lang::WrappedTargetException );
85 /** submit form through given submission id
87 <p>This is a convenience method. Calling it is equivalent to calling
88 <code>getSubmission()( id, handler ).submit()</code>.</p>
90 @param id
91 the ID of the submission to execute
93 @param aHandler
94 This handler allows additional user interaction, which may be necessary before
95 the submission can be performed.
97 @throws com::sun::star::util::VetoException
98 when the current model state does not allow a submission. Usually, this indicates that
99 consistency criteria for the model data is not fulfilled.
101 @throws com::sun::star::lang::WrappedTargetException
102 when another error occurred during the submission. The
103 com::sun::star::lang::WrappedTargetException::TargetException describes
104 this error then.
106 void submitWithInteraction( [in] string id, [in] com::sun::star::task::XInteractionHandler aHandler )
107 raises ( com::sun::star::util::VetoException, com::sun::star::lang::WrappedTargetException );
109 /** provides management access to the XSD data types associated with the model
111 XDataTypeRepository
112 getDataTypeRepository( );
115 // instances
117 /** gets container containing all instances;
119 <p>The elements of the set are arrays of com::sun::star::beans::PropertyValues,
120 containing the ID, the URL, and the instance itself.</p>
122 com::sun::star::container::XSet getInstances();
124 /** retrieves the instance with the given id
126 com::sun::star::xml::dom::XDocument getInstanceDocument( [in] string id );
128 /** get the default instance for this model
130 com::sun::star::xml::dom::XDocument getDefaultInstance();
133 // bindings
135 /** create a binding element for this model
137 <p>The returned binding still needs to be inserted into the bindings container.</p>
139 @see getBindings
141 com::sun::star::beans::XPropertySet createBinding();
143 /** clone an arbitrary binding element for this model; still needs
145 <p>The returned binding still needs to be inserted into the bindings container.</p>
147 @see getBindings
149 com::sun::star::beans::XPropertySet cloneBinding( [in] com::sun::star::beans::XPropertySet binding );
151 /** get a binding with a certain ID
153 <p>This is a convenience method: the same result can also be obtained through
154 getBindings()</p>
156 com::sun::star::beans::XPropertySet getBinding( [in] string id );
158 /** get a container containing all bindings; also supports XNameAccess
160 com::sun::star::container::XSet getBindings();
163 // submissions
165 /** create a submission element for this model
167 <p>The returned submission element still needs to be inserted into the submission container.</p>
169 @see getSubmissions
171 XSubmission createSubmission();
173 /** clone an arbitrary submission element for this model
175 <p>The returned submission element still needs to be inserted into the submission container.</p>
177 @see getSubmissions
179 XSubmission cloneSubmission( [in] com::sun::star::beans::XPropertySet submission );
181 /** get a submission with a certain ID.
183 <p>This is a convenience method: the same result can also be obtained through
184 getSubmissions().</p>
186 XSubmission getSubmission( [in] string id );
188 /** get container containing all submissions; also supports XNameAccess
190 com::sun::star::container::XSet getSubmissions();
194 }; }; }; };
196 #endif
198 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */