xref: /aoo42x/main/offapi/com/sun/star/awt/XGraphics.idl (revision d1e7efc3)
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#ifndef __com_sun_star_awt_XGraphics_idl__
23#define __com_sun_star_awt_XGraphics_idl__
24
25#include <com/sun/star/uno/XInterface.idl>
26#include <com/sun/star/util/Color.idl>
27#include <com/sun/star/awt/SimpleFontMetric.idl>
28#include <com/sun/star/awt/FontDescriptor.idl>
29#include <com/sun/star/awt/RasterOperation.idl>
30#include <com/sun/star/awt/Gradient.idl>
31#include <com/sun/star/awt/Rectangle.idl>
32#include <com/sun/star/graphic/XGraphic.idl>
33
34module com {  module sun {  module star {  module awt {
35
36published interface XRegion;
37published interface XDisplayBitmap;
38published interface XFont;
39published interface XDevice;
40
41/** provides the basic output operation of a device.
42 */
43published interface XGraphics: com::sun::star::uno::XInterface
44{
45    /** the device of this graphics
46     */
47    [attribute, readonly] XDevice Device;
48
49    /** the text color used by text operations.
50     */
51    [attribute] com::sun::star::util::Color TextColor;
52
53    /** the fill color used by text operations.
54     */
55    [attribute] com::sun::star::util::Color TextFillColor;
56
57    /** the line color.
58     */
59    [attribute] com::sun::star::util::Color LineColor;
60
61    /** the fill color.
62     */
63    [attribute] com::sun::star::util::Color FillColor;
64
65    /** the raster operation.
66
67        <p>If the device does not support raster operations,
68        this attribute is ignored.</p>
69     */
70    [attribute] RasterOperation RasterOp;
71
72    /** the font used by text operations.
73     */
74    [attribute] XFont Font;
75
76    /** the font metric of the current font.
77     */
78    [attribute, readonly] SimpleFontMetric FontMetric;
79
80    /** creates a new font and sets the font.
81     */
82    [oneway] void selectFont( [in] FontDescriptor aDescription );
83
84    /** sets the clip region to specified clipping.
85     */
86    [oneway] void setClipRegion( [in] XRegion Clipping );
87
88    /** builds the intersection with the current region.
89     */
90    [oneway] void intersectClipRegion( [in] XRegion xClipping );
91
92    /** saves all current settings (Font, TextColor, TextFillColor,
93        LineColor, FillColor, RasterOp, ClipRegion).
94     */
95    [oneway] void push();
96
97    /** restores all previous saved settings.
98     */
99    [oneway] void pop();
100
101    /** clears the given rectangle on the device
102
103        @since OpenOffice 4.0
104     */
105    [oneway] void clear( [in] Rectangle aRect );
106
107    /** copies a rectangle of pixels from another device into this one.
108     */
109    [oneway] void copy( [in] XDevice xSource,
110             [in] long nSourceX,
111             [in] long nSourceY,
112             [in] long nSourceWidth,
113             [in] long nSourceHeight,
114             [in] long nDestX,
115             [in] long nDestY,
116             [in] long nDestWidth,
117             [in] long nDestHeight );
118
119    /** draws a part of the specified bitmap to the output device.
120     */
121    [oneway] void draw( [in] XDisplayBitmap xBitmapHandle,
122             [in] long SourceX,
123             [in] long SourceY,
124             [in] long SourceWidth,
125             [in] long SourceHeight,
126             [in] long DestX,
127             [in] long DestY,
128             [in] long DestWidth,
129             [in] long DestHeight );
130
131    /** sets a single pixel in the output device.
132     */
133    [oneway] void drawPixel( [in] long X,
134             [in] long Y );
135
136    /** draws a line in the output device.
137     */
138    [oneway] void drawLine( [in] long X1,
139             [in] long Y1,
140             [in] long X2,
141             [in] long Y2 );
142
143    /** draws a rectangle in the output device.
144     */
145    [oneway] void drawRect( [in] long X,
146             [in] long Y,
147             [in] long Width,
148             [in] long Height );
149
150    /** draws a rectangle with rounded corners in the output device.
151     */
152    [oneway] void drawRoundedRect( [in] long X,
153             [in] long Y,
154             [in] long Width,
155             [in] long Height,
156             [in] long nHorzRound,
157             [in] long nVertRound );
158
159    /** draws multiple lines in the output device at once.
160     */
161    [oneway] void drawPolyLine( [in] sequence<long> DataX,
162             [in] sequence<long> DataY );
163
164    /** draws a polygon line in the output device.
165     */
166    [oneway] void drawPolygon( [in] sequence<long> DataX,
167             [in] sequence<long> DataY );
168
169    /** draws multiple polygons in the output device at once.
170     */
171    [oneway] void drawPolyPolygon( [in] sequence< sequence<long> > DataX,
172             [in] sequence< sequence<long> > DataY );
173
174    /** draws an ellipse in the output device.
175     */
176    [oneway] void drawEllipse( [in] long X,
177             [in] long Y,
178             [in] long Width,
179             [in] long Height );
180
181    /** draws an arc (part of a circle) in the output device.
182     */
183    [oneway] void drawArc( [in] long X,
184             [in] long Y,
185             [in] long Width,
186             [in] long Height,
187             [in] long X1,
188             [in] long Y1,
189             [in] long X2,
190             [in] long Y2 );
191
192    /** draws a circular area in the output device.
193     */
194    [oneway] void drawPie( [in] long X,
195             [in] long Y,
196             [in] long Width,
197             [in] long Height,
198             [in] long X1,
199             [in] long Y1,
200             [in] long X2,
201             [in] long Y2 );
202
203    /** draws a chord of a circular area in the output device.
204
205        <p>A chord is a segment of a circle. You get two chords from a
206        circle if you intersect the circle with a straight line
207        joining two points on the circle.</p>
208     */
209    [oneway] void drawChord( [in] long nX,
210             [in] long nY,
211             [in] long nWidth,
212             [in] long nHeight,
213             [in] long nX1,
214             [in] long nY1,
215             [in] long nX2,
216             [in] long nY2 );
217
218    /** draws a color dispersion in the output device.
219     */
220    [oneway] void drawGradient( [in] long nX,
221             [in] long nY,
222             [in] long nWidth,
223             [in] long Height,
224             [in] Gradient aGradient );
225
226    /** draws text in the output device.
227     */
228    [oneway] void drawText( [in] long X,
229             [in] long Y,
230             [in] string Text );
231
232    /** draws texts in the output device using an explicit kerning table.
233     */
234    [oneway] void drawTextArray( [in] long X,
235             [in] long Y,
236             [in] string Text,
237             [in] sequence<long> Longs );
238
239    /** draws a <type scope="com::sun::star::graphic">XGraphic</type>
240        in the output device.
241
242        <p>Note that some devices may not support this operation.</p>
243
244        @since OpenOffice 4.0
245
246        @param  nX
247            the X coordinate on the device where the graphic will be drawn
248
249        @param  nY
250            the Y coordinate on the device where the graphic will be drawn
251
252        @param  nWidth
253            the width of the region on the device
254
255        @param  nHeight
256            the height of the region on the device
257
258        @param  nStyle
259            the style used to draw the image.
260            See <type scope="com::sun::star::awt">ImageDrawMode</type>.
261
262        @param  aGraphic
263            the <type scope="com::sun::star::graphic">XGraphic</type>
264            to be drawn onto the device
265     */
266    [oneway] void drawImage( [in] long nX,
267                             [in] long nY,
268                             [in] long nWidth,
269                             [in] long nHeight,
270                             [in] short nStyle,
271                             [in] ::com::sun::star::graphic::XGraphic aGraphic );
272
273};
274
275}; }; }; };
276
277#endif
278