/*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: XBitmapPalette.idl,v $
 *
 *  $Revision: 1.6 $
 *
 *  last change: $Author: kz $ $Date: 2006-01-31 18:21:23 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 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
 *
 ************************************************************************/
#ifndef __com_sun_star_rendering_XBitmapPalette_idl__
#define __com_sun_star_rendering_XBitmapPalette_idl__

#ifndef __com_sun_star_uno_XInterface_idl__
#include <com/sun/star/uno/XInterface.idl>
#endif
#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
#include <com/sun/star/lang/IllegalArgumentException.idl>
#endif
#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
#endif
#ifndef __com_sun_star_rendering_XColorSpace_idl__
#include <com/sun/star/rendering/XColorSpace.idl>
#endif


module com { module sun { module star { module rendering {

/** Interface to access the palette of a color-indexed bitmap.

    @since OOo 2.0.0
 */
interface XBitmapPalette : ::com::sun::star::uno::XInterface
{
    /** Request the number of palette entries available.

        @return the number of entries in this palette.
     */
    long                        getNumberOfEntries();

    //-------------------------------------------------------------------------

    /** Request the color for the given palette entry.

        @param nIndex
        The index of the palette entry to be retrieved. Valid range is
        [0,getNumberOfEntries()-1].

        @return the device color sequence of the requested palette
        entry.

        @throws com::sun::star::lang::IndexOutOfBoundsException
        if the index is smaller than zero or larger than
        <member>XBitmapPalette::getNumberOfEntries()</member>-1.
     */
    sequence<ColorComponent>    getPaletteIndex( [in] long nIndex )
        raises (com::sun::star::lang::IndexOutOfBoundsException);

    //-------------------------------------------------------------------------

    /** Set the color for the given palette entry.

        @param color
        Sequence of device color values in the associated bitmap's
        device color format.

        @param nIndex
        The index of the palette entry to be changed. Valid range is
        [0,getNumberOfEntries()-1].

        @return whether the palette entry was changed. For read-only
        entries, this method always returns <FALSE>.

        @throws com::sun::star::lang::IndexOutOfBoundsException
        if the index is smaller than zero or larger than
        <member>XBitmapPalette::getNumberOfEntries()</member>-1.

        @throws com::sun::star::lang::IllegalArgumentException
        if the given sequence of color components does not match the
        associated bitmap's device color format.
     */
    boolean                     setPaletteIndex( [in] sequence<ColorComponent> color, [in] long nIndex )
        raises (com::sun::star::lang::IndexOutOfBoundsException,
                com::sun::star::lang::IllegalArgumentException);

    //-------------------------------------------------------------------------

    /** Query associated color space.<p>

        @return the color space that is associated with this palette.
     */
    XColorSpace                 getColorSpace( );
};

}; }; }; };

#endif
