1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_rendering_XPolyPolygon2D_idl__
28#define __com_sun_star_rendering_XPolyPolygon2D_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
34#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
35#endif
36#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
37#include <com/sun/star/lang/IllegalArgumentException.idl>
38#endif
39#ifndef __com_sun_star_rendering_FillRule_idl__
40#include <com/sun/star/rendering/FillRule.idl>
41#endif
42#ifndef __com_sun_star_geometry_RealPoint2D_idl__
43#include <com/sun/star/geometry/RealPoint2D.idl>
44#endif
45
46module com { module sun { module star { module rendering {
47
48/** Generic interface for poly-polygons in 2D.
49
50    @since OOo 2.0
51 */
52published interface XPolyPolygon2D : ::com::sun::star::uno::XInterface
53{
54    /** Add the specified poly-polygon at the given position.
55
56        One can do symbolic path construction with this method. The
57        poly-polygons added by this method are not joined in the sense
58        that they participate in mutual fill rule calculations like
59        the polygons inside a single poly-polygon do. When rendering
60        such a poly-polygon without transparency, it will look like the
61        constituing poly-polygons rendered separately on top of
62        another. Alas, when rendering with transparency, separate
63        rendering will combine the alpha of overlapping areas, whereas
64        addPolyPolygon results in constant alpha, regardless how many
65        internal poly-polygons overlap at a single place.
66
67        @param position
68        The poly-polygon will be added at the given position, i.e. the
69        upper, left edge of the referenced poly-polygon will be at
70        this position relative to the target poly-polygon.
71
72        @param polyPolygon
73        The poly-polygon to add. Note that the content of this
74        poly-polygon is copied, later changes to polyPolygon will have
75        no effect on the poly-polygon it was added to.
76
77        @throws a
78        <type>com::sun::star::lang::IllegalArgumentException</type>,
79        if the XPolyPolygon2D parameter does not support one of the
80        data-providing derivative interfaces
81        (<type>XBezierPolyPolygon2D</type>,
82        <type>XLinePolyPolygon2D</type>).
83     */
84    void		addPolyPolygon( [in] ::com::sun::star::geometry::RealPoint2D position, [in] XPolyPolygon2D polyPolygon )
85        raises (com::sun::star::lang::IllegalArgumentException);
86
87    //-------------------------------------------------------------------------
88
89    /** Query number of polygons inside this poly-polygon
90     */
91    long		getNumberOfPolygons();
92
93    //-------------------------------------------------------------------------
94
95    /** Query number of points inside given polygon
96
97        @param polygon
98        The index of the polygon to query the number of points
99        for. Must be in the range [0,getNumberOfPolygons()-1].
100     */
101    long		getNumberOfPolygonPoints( [in] long polygon )
102        raises (com::sun::star::lang::IndexOutOfBoundsException);
103
104    //-------------------------------------------------------------------------
105
106    /** Query the rule used to determine inside and outside of the
107        poly-polygon.
108     */
109    FillRule	getFillRule();
110
111    //-------------------------------------------------------------------------
112
113    /** Set the rule used to determine inside and outside of the
114        poly-polygon.
115     */
116    void		setFillRule( [in] FillRule fillRule );
117
118    //-------------------------------------------------------------------------
119
120    /** Query whether the specified polygon outline is closed.
121     */
122    boolean		isClosed( [in] long index )
123        raises (com::sun::star::lang::IndexOutOfBoundsException);
124
125    //-------------------------------------------------------------------------
126
127    /** Set the close state of the specified polygon outline. Use -1
128        as the index to affect all polygons of this poly-polygon.
129     */
130    void		setClosed( [in] long index, [in] boolean closedState )
131        raises (com::sun::star::lang::IndexOutOfBoundsException);
132};
133
134}; }; }; };
135
136#endif
137