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_form_component_CommandButton_idl__
24#define __com_sun_star_form_component_CommandButton_idl__
25
26#include <com/sun/star/form/FormControlModel.idl>
27#include <com/sun/star/awt/UnoControlButtonModel.idl>
28#include <com/sun/star/form/XImageProducerSupplier.idl>
29#include <com/sun/star/form/XApproveActionBroadcaster.idl>
30#include <com/sun/star/form/FormButtonType.idl>
31#include <com/sun/star/form/XReset.idl>
32
33
34//=============================================================================
35
36 module com {  module sun {  module star {  module form {  module component {
37
38//=============================================================================
39
40/** specifies the control model for a clickable button which is part of a form
41	component hierarchy.
42
43	@see ImageButton
44 */
45published service CommandButton
46{
47	service com::sun::star::awt::UnoControlButtonModel;
48
49	service com::sun::star::form::FormControlModel;
50
51	/** supplies the image producer when the button is to display an image.
52
53		<p>If the <member scope="com::sun::star::awt">UnoControlButtonModel::ImageURL</member> points to the location of an
54		image to be displayed on the button, this interface can be used to retrieve an image
55		producer, which itself will supply the image.</p>
56
57		<p>Usually, a control belonging to the model will use this interface to obtain the
58		image to be painted</p>
59	 */
60	interface com::sun::star::form::XImageProducerSupplier;
61
62	//-------------------------------------------------------------------------
63
64	/** describes the action to be executed by the button when pressed.
65	 */
66	[property] com::sun::star::form::FormButtonType ButtonType;
67
68	/** describes the frame, where to open the document specified by the TargetURL.
69
70		<p>This property is evaluated if the button is of type URL.</p>
71
72		<p>As always, there is a number of target names which have a special meaning, and force
73		a special <type scope="com::sun::star::frame">Frame</type> to be used.</p>
74	 */
75	[property] string TargetFrame;
76
77	/** specifies the URL, which should be opened if the button was clicked.
78
79		<p>This property is evaluated if the button is of type URL.</p>
80
81		@see com::sun::star::form::FormButtonType
82	 */
83	[property] string TargetURL;
84
85    /** specifies the default toggle state for the button, used when it is reset.
86
87        <p>This property is meaningful only when <member scope="com::sun::star::awt">UnoControlButtonModel::Toggle</member>
88        is <TRUE/>. In this case, the <code>DefaultState</code> controls to which <code>State</code> the button will
89        be reset.</p>
90
91        <p>For a given implementation of the interface, if this (optional) property is present, then also the optional
92        interface <type scope="com::sun::star::form">XReset</type> must be present.</p>
93    */
94    [optional, property] boolean DefaultState;
95
96    /** allows resetting the button
97
98        <p>This property is meaningful only when <member scope="com::sun::star::awt">UnoControlButtonModel::Toggle</member>
99        is <TRUE/>. In this case, the <code>DefaultState</code> controls to which <code>State</code> the button will
100        be reset, when <member scope="com::sun::star::form">XReset::reset</member> is invoked.</p>
101
102        <p>For a given implementation of the interface, if this (optional) interface is present, then also the optional
103        property <member>DefaultState</member> must be present.</p>
104    */
105    [optional] interface ::com::sun::star::form::XReset;
106};
107
108//=============================================================================
109
110}; }; }; }; };
111
112#endif
113