1d1766043SAndrew Rist/**************************************************************
2d1766043SAndrew Rist *
3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5d1766043SAndrew Rist * distributed with this work for additional information
6d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10d1766043SAndrew Rist *
11d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12d1766043SAndrew Rist *
13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14d1766043SAndrew Rist * software distributed under the License is distributed on an
15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17d1766043SAndrew Rist * specific language governing permissions and limitations
18d1766043SAndrew Rist * under the License.
19d1766043SAndrew Rist *
20d1766043SAndrew Rist *************************************************************/
21d1766043SAndrew Rist
22d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XPolyPolygon2D_idl__
24cdf0e10cSrcweir#define __com_sun_star_rendering_XPolyPolygon2D_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
30cdf0e10cSrcweir#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
31cdf0e10cSrcweir#endif
32cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
33cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
34cdf0e10cSrcweir#endif
35cdf0e10cSrcweir#ifndef __com_sun_star_rendering_FillRule_idl__
36cdf0e10cSrcweir#include <com/sun/star/rendering/FillRule.idl>
37cdf0e10cSrcweir#endif
38cdf0e10cSrcweir#ifndef __com_sun_star_geometry_RealPoint2D_idl__
39cdf0e10cSrcweir#include <com/sun/star/geometry/RealPoint2D.idl>
40cdf0e10cSrcweir#endif
41cdf0e10cSrcweir
42cdf0e10cSrcweirmodule com { module sun { module star { module rendering {
43cdf0e10cSrcweir
44cdf0e10cSrcweir/** Generic interface for poly-polygons in 2D.
45cdf0e10cSrcweir
46*d695a2a0SJürgen Schmidt    @since OpenOffice 2.0
47cdf0e10cSrcweir */
48cdf0e10cSrcweirpublished interface XPolyPolygon2D : ::com::sun::star::uno::XInterface
49cdf0e10cSrcweir{
50cdf0e10cSrcweir    /** Add the specified poly-polygon at the given position.
51cdf0e10cSrcweir
52cdf0e10cSrcweir        One can do symbolic path construction with this method. The
53cdf0e10cSrcweir        poly-polygons added by this method are not joined in the sense
54cdf0e10cSrcweir        that they participate in mutual fill rule calculations like
55cdf0e10cSrcweir        the polygons inside a single poly-polygon do. When rendering
56cdf0e10cSrcweir        such a poly-polygon without transparency, it will look like the
57cdf0e10cSrcweir        constituing poly-polygons rendered separately on top of
58cdf0e10cSrcweir        another. Alas, when rendering with transparency, separate
59cdf0e10cSrcweir        rendering will combine the alpha of overlapping areas, whereas
60cdf0e10cSrcweir        addPolyPolygon results in constant alpha, regardless how many
61cdf0e10cSrcweir        internal poly-polygons overlap at a single place.
62cdf0e10cSrcweir
63cdf0e10cSrcweir        @param position
64cdf0e10cSrcweir        The poly-polygon will be added at the given position, i.e. the
65cdf0e10cSrcweir        upper, left edge of the referenced poly-polygon will be at
66cdf0e10cSrcweir        this position relative to the target poly-polygon.
67cdf0e10cSrcweir
68cdf0e10cSrcweir        @param polyPolygon
69cdf0e10cSrcweir        The poly-polygon to add. Note that the content of this
70cdf0e10cSrcweir        poly-polygon is copied, later changes to polyPolygon will have
71cdf0e10cSrcweir        no effect on the poly-polygon it was added to.
72cdf0e10cSrcweir
73cdf0e10cSrcweir        @throws a
74cdf0e10cSrcweir        <type>com::sun::star::lang::IllegalArgumentException</type>,
75cdf0e10cSrcweir        if the XPolyPolygon2D parameter does not support one of the
76cdf0e10cSrcweir        data-providing derivative interfaces
77cdf0e10cSrcweir        (<type>XBezierPolyPolygon2D</type>,
78cdf0e10cSrcweir        <type>XLinePolyPolygon2D</type>).
79cdf0e10cSrcweir     */
80cdf0e10cSrcweir    void		addPolyPolygon( [in] ::com::sun::star::geometry::RealPoint2D position, [in] XPolyPolygon2D polyPolygon )
81cdf0e10cSrcweir        raises (com::sun::star::lang::IllegalArgumentException);
82cdf0e10cSrcweir
83cdf0e10cSrcweir    //-------------------------------------------------------------------------
84cdf0e10cSrcweir
85cdf0e10cSrcweir    /** Query number of polygons inside this poly-polygon
86cdf0e10cSrcweir     */
87cdf0e10cSrcweir    long		getNumberOfPolygons();
88cdf0e10cSrcweir
89cdf0e10cSrcweir    //-------------------------------------------------------------------------
90cdf0e10cSrcweir
91cdf0e10cSrcweir    /** Query number of points inside given polygon
92cdf0e10cSrcweir
93cdf0e10cSrcweir        @param polygon
94cdf0e10cSrcweir        The index of the polygon to query the number of points
95cdf0e10cSrcweir        for. Must be in the range [0,getNumberOfPolygons()-1].
96cdf0e10cSrcweir     */
97cdf0e10cSrcweir    long		getNumberOfPolygonPoints( [in] long polygon )
98cdf0e10cSrcweir        raises (com::sun::star::lang::IndexOutOfBoundsException);
99cdf0e10cSrcweir
100cdf0e10cSrcweir    //-------------------------------------------------------------------------
101cdf0e10cSrcweir
102cdf0e10cSrcweir    /** Query the rule used to determine inside and outside of the
103cdf0e10cSrcweir        poly-polygon.
104cdf0e10cSrcweir     */
105cdf0e10cSrcweir    FillRule	getFillRule();
106cdf0e10cSrcweir
107cdf0e10cSrcweir    //-------------------------------------------------------------------------
108cdf0e10cSrcweir
109cdf0e10cSrcweir    /** Set the rule used to determine inside and outside of the
110cdf0e10cSrcweir        poly-polygon.
111cdf0e10cSrcweir     */
112cdf0e10cSrcweir    void		setFillRule( [in] FillRule fillRule );
113cdf0e10cSrcweir
114cdf0e10cSrcweir    //-------------------------------------------------------------------------
115cdf0e10cSrcweir
116cdf0e10cSrcweir    /** Query whether the specified polygon outline is closed.
117cdf0e10cSrcweir     */
118cdf0e10cSrcweir    boolean		isClosed( [in] long index )
119cdf0e10cSrcweir        raises (com::sun::star::lang::IndexOutOfBoundsException);
120cdf0e10cSrcweir
121cdf0e10cSrcweir    //-------------------------------------------------------------------------
122cdf0e10cSrcweir
123cdf0e10cSrcweir    /** Set the close state of the specified polygon outline. Use -1
124cdf0e10cSrcweir        as the index to affect all polygons of this poly-polygon.
125cdf0e10cSrcweir     */
126cdf0e10cSrcweir    void		setClosed( [in] long index, [in] boolean closedState )
127cdf0e10cSrcweir        raises (com::sun::star::lang::IndexOutOfBoundsException);
128cdf0e10cSrcweir};
129cdf0e10cSrcweir
130cdf0e10cSrcweir}; }; }; };
131cdf0e10cSrcweir
132cdf0e10cSrcweir#endif
133