/*************************************************************************
 *
 *  $RCSfile: XRmBitmap.idl,v $
 *
 *  $Revision: 1.1 $
 *
 *  last change: $Author: mh $ $Date: 2003/02/12 13:59:12 $
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2002
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2002 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (the "License"); You may not use this file
 *  except in compliance with the License. You may obtain a copy of the
 *  License at http://www.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *  Copyright: 2002 by Sun Microsystems, Inc.
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/
#ifndef __com_sun_star_portal_client_XRmBitmap_idl__
#define __com_sun_star_portal_client_XRmBitmap_idl__

#ifndef __com_sun_star_uno_XInterface_idl__
#include <com/sun/star/uno/XInterface.idl>
#endif

#ifndef __com_sun_star_portal_client_XRmOutputDevice_idl__
#include <com/sun/star/portal/client/XRmOutputDevice.idl>
#endif

module com
{
module sun
{
module star
{
module portal
{
module client
{

/** interface to use bitmaps
*/
interface XRmBitmap : com::sun::star::uno::XInterface
{
	// -----------------------------------------------------------------------
	/** Initialize bitmap for transfer
		@param width			[in]: A valid width, set to 0 is legal, the already existant bitmap data should be purged then.
		@param height			[in]: A valid height, set to 0 is legal, the already bitmap data should be purged then.
		@param depth			[in]: A valid color depth.
		@param palette			[in]: Palette for palette bitmaps, the palette entries are in the order blue(or index), green, red, bool. 
									  The bool tells wether the first byte is an index or not.
		@param format			[in]: a format descriptor of the bitmap data
		@param scanlinesize		[in]: number of bytes of one scanline
		@param compressiontype	[in]: Set the compression algorithm used on the byte sequence in Transfer call with 0 meaning uncompressed.
	*/
	[oneway] void		InitiateTransfer( [in] long width, 
						  [in] long height, 
						  [in] long depth, 
						  [in] sequence< byte > palette, 
						  [in] long format, 
						  [in] long scanlinesize, 
						  [in] long compressiontype );
	 /* InitiateTransfer: 
	 * the next parameters determine the format of the scanlines transported by
	 * subsequent Transfer calls: palette for palette bitmaps,
	 * the palette entries are in the order blue(or index), green, red, bool.
	 * the bool tells wether the first byte is an index or not.
	 * (implementation detail: this is a vcl BitmapColor)
	 * format and scanlinesize determine how to interpret the scanlines transported
	 * in each Transfer call. compressiontype marks the compression algorithm
	 * used on the byte sequences in Transfer call with 0 meaning uncompressed.
	 * InitiateTransfer with width and height set to 0 is
	 * legal, the bitmap data should be purged then.
	 */
	
	// -----------------------------------------------------------------------
	/** Transport one or more scanlines of the bitmap initialized in InitiateTransfer.
		@param aData [in]: the scanline data
	 */
	[oneway] void		Transfer( [in] ByteSequence aData );

	// -----------------------------------------------------------------------
	/** Get the current implementation of the bitmap (only valid in the same process context)
		@return pointer to the bitmap implementation
	 */
	unsigned long		QueryBitmapPtr();

	// -----------------------------------------------------------------------
	/** Draw bitmap or part of it to the given output device (supports scaling)
		@param nDestX			[in]: destination x position
		@param nDestY			[in]: destination y position
		@param nDestWidth		[in]: destination height (can be used for scaling)
		@param nDestHeight		[in]: destination width (can be used for scaling)
		@param nSrcX			[in]: source x position inside the bitmap
		@param nSrcY			[in]: source y position inside the bitmap
		@param nSrcWidth		[in]: source width of the bitmap part
		@param nSrcHeight		[in]: source height of the bitmap part
		@param xOutputDevice	[in]: reference to a output device to draw to
	 */
	[oneway] void		Draw(	[in] long nDestX, 
					[in] long nDestY, 
					[in] long nDestWidth, 
					[in] long nDestHeight,
					[in] long nSrcX, 
					[in] long nSrcY, 
					[in] long nSrcWidth, 
					[in] long nSrcHeight,
					[in] XRmOutputDevice xOutputDevice );
	
	// -----------------------------------------------------------------------
	/** Draw bitmap or part of it to the given output device and use a bitmap mask and alpha blending (supports scaling)
		@param nDestX			[in]: destination x position
		@param nDestY			[in]: destination y position
		@param nDestWidth		[in]: destination height (can be used for scaling)
		@param nDestHeight		[in]: destination width (can be used for scaling)
		@param nSrcX			[in]: source x position inside the bitmap
		@param nSrcY			[in]: source y position inside the bitmap
		@param nSrcWidth		[in]: source width of the bitmap part
		@param nSrcHeight		[in]: source height of the bitmap part
		@param xBitmap			[in]: the bitmap to draw
		@param xBitmapMask		[in]: the mask to apply
		@param xOutputDevice	[in]: output device to use for drawing
		@param bAlpha			[in]: true: alpha transparency, false: stencil type mask
	 */
	[oneway] void		DrawEx( [in] long nDestX, 
					[in] long nDestY, 
					[in] long nDestWidth, 
					[in] long nDestHeight, 
					[in] long nSrcX, 
					[in] long nSrcY, 
					[in] long nSrcWidth, 
					[in] long nSrcHeight,
					[in] XRmBitmap xBitmap, 
					[in] XRmBitmap xBitmapMask, 
					[in] XRmOutputDevice xOutputDevice, 
					[in] boolean bAlpha );

	// -----------------------------------------------------------------------
	/** Draw the bitmap to the given output device with a mask
		@param nDestX			[in]: destination x position
		@param nDestY			[in]: destination y position
		@param nDestWidth		[in]: destination height (can be used for scaling)
		@param nDestHeight		[in]: destination width (can be used for scaling)
		@param nSrcX			[in]: source x position inside the bitmap
		@param nSrcY			[in]: source y position inside the bitmap
		@param nSrcWidth		[in]: source width of the bitmap part
		@param nSrcHeight		[in]: source height of the bitmap part
		@param xBitmap			[in]: a mask bitmap
		@param nColor			[in]: a color used for the bitmap mask
		@param xOutputDevice	[in]: output device to use for drawing
	 */
	[oneway] void		DrawMask( [in] long nDestX, 
					  [in] long nDestY, 
					  [in] long nDestWidth, 
					  [in] long nDestHeight,
					  [in] long nSrcX, 
					  [in] long nSrcY, 
					  [in] long nSrcWidth, 
					  [in] long nSrcHeight,
					  [in] XRmBitmap xBitmap, 
					  [in] unsigned long nColor, 
					  [in] XRmOutputDevice xOutputDevice );

	// -----------------------------------------------------------------------
	/** Create a bitmap from a given output device rectangle area
		@param nX				[in]: left position of the rectangle area
		@param nY				[in]: top position of the rectangle area
		@param nWidth			[in]: width of the rectangle area
		@param nHeight			[in]: height of the rectangle area
		@param xOutputDevice	[in]: the source output device to get the bitmap data from
	 */
	[oneway] void		CreateBitmap(	[in] long nX, 
						[in] long nY, 
						[in] long nWidth, 
						[in] long nHeight,
						[in] XRmOutputDevice xOutputDevice );

	// -----------------------------------------------------------------------
	/** Get the bitmap data
		@param rData [out]: a sequence with the bitmap data
	 */
	void				GetBitmap( [out] ByteSequence rData );
};

}; // module client
}; // module portal
}; // module star
}; // module sun
}; // module com

#endif
