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_rendering_XPolyPolygon2D_idl__
24#define __com_sun_star_rendering_XPolyPolygon2D_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
30#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
31#endif
32#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
33#include <com/sun/star/lang/IllegalArgumentException.idl>
34#endif
35#ifndef __com_sun_star_rendering_FillRule_idl__
36#include <com/sun/star/rendering/FillRule.idl>
37#endif
38#ifndef __com_sun_star_geometry_RealPoint2D_idl__
39#include <com/sun/star/geometry/RealPoint2D.idl>
40#endif
41
42module com { module sun { module star { module rendering {
43
44/** Generic interface for poly-polygons in 2D.
45
46    @since OpenOffice 2.0
47 */
48published interface XPolyPolygon2D : ::com::sun::star::uno::XInterface
49{
50    /** Add the specified poly-polygon at the given position.
51
52        One can do symbolic path construction with this method. The
53        poly-polygons added by this method are not joined in the sense
54        that they participate in mutual fill rule calculations like
55        the polygons inside a single poly-polygon do. When rendering
56        such a poly-polygon without transparency, it will look like the
57        constituing poly-polygons rendered separately on top of
58        another. Alas, when rendering with transparency, separate
59        rendering will combine the alpha of overlapping areas, whereas
60        addPolyPolygon results in constant alpha, regardless how many
61        internal poly-polygons overlap at a single place.
62
63        @param position
64        The poly-polygon will be added at the given position, i.e. the
65        upper, left edge of the referenced poly-polygon will be at
66        this position relative to the target poly-polygon.
67
68        @param polyPolygon
69        The poly-polygon to add. Note that the content of this
70        poly-polygon is copied, later changes to polyPolygon will have
71        no effect on the poly-polygon it was added to.
72
73        @throws a
74        <type>com::sun::star::lang::IllegalArgumentException</type>,
75        if the XPolyPolygon2D parameter does not support one of the
76        data-providing derivative interfaces
77        (<type>XBezierPolyPolygon2D</type>,
78        <type>XLinePolyPolygon2D</type>).
79     */
80    void		addPolyPolygon( [in] ::com::sun::star::geometry::RealPoint2D position, [in] XPolyPolygon2D polyPolygon )
81        raises (com::sun::star::lang::IllegalArgumentException);
82
83    //-------------------------------------------------------------------------
84
85    /** Query number of polygons inside this poly-polygon
86     */
87    long		getNumberOfPolygons();
88
89    //-------------------------------------------------------------------------
90
91    /** Query number of points inside given polygon
92
93        @param polygon
94        The index of the polygon to query the number of points
95        for. Must be in the range [0,getNumberOfPolygons()-1].
96     */
97    long		getNumberOfPolygonPoints( [in] long polygon )
98        raises (com::sun::star::lang::IndexOutOfBoundsException);
99
100    //-------------------------------------------------------------------------
101
102    /** Query the rule used to determine inside and outside of the
103        poly-polygon.
104     */
105    FillRule	getFillRule();
106
107    //-------------------------------------------------------------------------
108
109    /** Set the rule used to determine inside and outside of the
110        poly-polygon.
111     */
112    void		setFillRule( [in] FillRule fillRule );
113
114    //-------------------------------------------------------------------------
115
116    /** Query whether the specified polygon outline is closed.
117     */
118    boolean		isClosed( [in] long index )
119        raises (com::sun::star::lang::IndexOutOfBoundsException);
120
121    //-------------------------------------------------------------------------
122
123    /** Set the close state of the specified polygon outline. Use -1
124        as the index to affect all polygons of this poly-polygon.
125     */
126    void		setClosed( [in] long index, [in] boolean closedState )
127        raises (com::sun::star::lang::IndexOutOfBoundsException);
128};
129
130}; }; }; };
131
132#endif
133