xref: /AOO41X/main/offapi/com/sun/star/form/XFormsSupplier.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
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_XFormsSupplier_idl__
24#define __com_sun_star_form_XFormsSupplier_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_container_XNameContainer_idl__
31#include <com/sun/star/container/XNameContainer.idl>
32#endif
33
34
35//=============================================================================
36
37 module com {  module sun {  module star {  module form {
38
39//=============================================================================
40
41/** provides the access to a collection of forms.
42 */
43published interface XFormsSupplier: com::sun::star::uno::XInterface
44{
45    //-------------------------------------------------------------------------
46
47    /** accesses the forms.
48
49        @example StarBASIC
50        <listing>
51        REM  *****  BASIC  *****
52
53        Sub createColorSelectionBox
54            ' create a new shape
55            xShape = thisComponent.createInstance( "com.sun.star.drawing.ControlShape" )
56            Dim aPos as new com.sun.star.awt.Point
57            aPos.X = 200
58            aPos.Y = 100
59            xShape.Position = aPos
60            Erase aPos
61            Dim aSize as new com.sun.star.awt.Size
62            aSize.Width = 2500
63            aSize.Height = 5000
64            xShape.Size = aSize
65            Erase aSize
66
67            ' create a combo box model
68            xControlModel = thisComponent.createInstance( "com.sun.star.form.component.ComboBox" )
69            xControlModel.Name = "ColorSelection"
70            xControlModel.Text = "red"
71
72            ' marry the shape and the model
73            xShape.Control = xControlModel
74
75            if ( 0 = thisComponent.DrawPage.Forms.getCount() ) Then
76                xForm = thisComponent.createInstance( "com.sun.star.form.component.DataForm" )
77                xForm.Name = "SampleForm"
78                thisComponent.DrawPage.Forms.insertByIndex( 0, xForm )
79            End If
80            ' insert the control model into the first form of the forms collection of the
81            ' draw page of the document
82            thisComponent.DrawPage.Forms.getByIndex(0).insertByIndex( 0, xControlModel )
83            thisComponent.DrawPage.add( xShape )
84        End Sub
85        </listing>
86
87        @returns
88            the container of all the top-level forms belonging to the component.
89     */
90    com::sun::star::container::XNameContainer getForms();
91
92};
93
94//=============================================================================
95
96}; }; }; };
97
98/*=============================================================================
99
100=============================================================================*/
101#endif
102