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_awt_XImageConsumer_idl__
28#define __com_sun_star_awt_XImageConsumer_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34//=============================================================================
35
36 module com {  module sun {  module star {  module awt {
37
38 published interface XImageProducer;
39
40//=============================================================================
41
42/** specifies a data sink for an image.
43
44    <p>An image consumer is a component which wants to display or just
45    receive an image from an image producer.</p>
46
47    @see XImageProducer
48 */
49published interface XImageConsumer: com::sun::star::uno::XInterface
50{
51	//-------------------------------------------------------------------------
52
53	/** initializes the consumer with image dimensions.
54	 */
55	[oneway] void init( [in] long Width,
56			 [in] long Height );
57
58	//-------------------------------------------------------------------------
59
60	/** changes color model for next pixels
61		typically called once after initialization.
62	 */
63	[oneway] void setColorModel( [in] short BitCount,
64			 [in] sequence<long> RGBAPal,
65			 [in] long RedMask,
66			 [in] long GreenMask,
67			 [in] long BlueMask,
68			 [in] long AlphaMask );
69
70	//-------------------------------------------------------------------------
71
72	/** delivers a chunk of pixels as <atom>long</atom> values.
73
74		<p>The pixels of the image are delivered using one or more calls
75		to this method.  Each call specifies the location and size of the
76		rectangle of source pixels that are contained in the array of pixels.
77		The specified color model object should be used to convert
78		the pixels into their corresponding color and alpha components.  Pixel
79		(m,n) is stored in the pixels array at index (n * <var>nScanSize</var>
80		+ m + nOffset).</p>
81	 */
82	[oneway] void setPixelsByBytes( [in] long nX,
83			 [in] long nY,
84			 [in] long nWidth,
85			 [in] long nHeight,
86			 [in] sequence<byte> aProducerData,
87			 [in] long nOffset,
88			 [in] long nScanSize );
89
90	//-------------------------------------------------------------------------
91
92	/** delivers a chunk of pixels as <atom>byte</atom> values.
93
94		<p>The pixels of the image are delivered using one or more calls
95		to this method.  Each call specifies the location and size of the
96		rectangle of source pixels that are contained in the array of pixels.
97		The specified color model object should be used to convert
98		the pixels into their corresponding color and alpha components.  Pixel
99		(m,n) is stored in the pixels array at index (n * <var>nScanSize</var>
100		+ m + nOffset).</p>
101	 */
102	[oneway] void setPixelsByLongs( [in] long nX,
103			 [in] long nY,
104			 [in] long nWidth,
105			 [in] long nHeight,
106			 [in] sequence<long> aProducerData,
107			 [in] long nOffset,
108			 [in] long nScanSize );
109
110	//-------------------------------------------------------------------------
111
112	/** is called for the notification of the degree to which the
113		image is delivered.
114
115		<p>The complete method is called when the image producer
116		has finished delivering all of the pixels that the source image
117		contains, or when a single frame of a multi-frame animation has
118		been completed, or when an error in loading or producing the
119		image has occurred.  The image consumer should remove itself from the
120		list of consumers registered with the image producer
121		at this time, unless it is interested in successive frames.</p>
122	 */
123	[oneway] void complete( [in] long Status,
124			 [in] XImageProducer xProducer );
125
126};
127
128//=============================================================================
129
130}; }; }; };
131
132#endif
133