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_rendering_XBitmapPalette_idl__
28#define __com_sun_star_rendering_XBitmapPalette_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
34#include <com/sun/star/lang/IllegalArgumentException.idl>
35#endif
36#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
37#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
38#endif
39#ifndef __com_sun_star_rendering_XColorSpace_idl__
40#include <com/sun/star/rendering/XColorSpace.idl>
41#endif
42
43
44module com { module sun { module star { module rendering {
45
46/** Interface to access the palette of a color-indexed bitmap.
47
48	@since OOo 2.0
49 */
50interface XBitmapPalette : ::com::sun::star::uno::XInterface
51{
52    /** Request the number of palette entries available.
53
54    	@return the number of entries in this palette.
55     */
56    long getNumberOfEntries();
57
58	//-------------------------------------------------------------------------
59
60    /** Request the color for the given palette entry.
61
62        @param entry
63        Output parameter for the color components at the given palette
64        entry.
65
66    	@param nIndex
67        The index of the palette entry to be retrieved. Valid range is
68        [0,getNumberOfEntries()-1].
69
70        @return <TRUE/>, if the given palette entry should be displayed
71        opaque, and <FALSE/> if the entry should be displayed
72        transparent. This is sometimes used for so-called mask
73        transparency, by flagging certain palette entries to be fully
74        transparent when displaying the bitmap.
75
76        @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type>
77        if the index is smaller than zero or larger than
78        <member>XBitmapPalette::getNumberOfEntries()</member>-1.
79     */
80    boolean getIndex( [out] sequence<ColorComponent> entry, [in] long nIndex )
81        raises (com::sun::star::lang::IndexOutOfBoundsException);
82
83	//-------------------------------------------------------------------------
84
85    /** Set the color for the given palette entry.
86
87    	@param color
88        Sequence of device color values in the associated bitmap's
89        device color format.
90
91        @param transparency
92        When <TRUE/>, the specified palette entry is displayed as
93        opaque color. When <FALSE/>, the given entry displays as fully
94        transparent during output.
95
96    	@param nIndex
97        The index of the palette entry to be changed. Valid range is
98        [0,getNumberOfEntries()-1].
99
100    	@return whether the palette entry was changed. For read-only
101    	entries, this method always returns <FALSE/>.
102
103        @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type>
104        if the index is smaller than zero or larger than
105        <member>XBitmapPalette::getNumberOfEntries()</member>-1.
106
107        @throws <type>com::sun::star::lang::IllegalArgumentException</type>
108        if the given sequence of color components does not match the
109        associated bitmap's device color format.
110     */
111    boolean setIndex( [in] sequence<ColorComponent> color, [in] boolean transparency, [in] long nIndex )
112        raises (com::sun::star::lang::IndexOutOfBoundsException,
113                com::sun::star::lang::IllegalArgumentException);
114
115	//-------------------------------------------------------------------------
116
117    /** Query associated color space.<p>
118
119    	@return the color space that is associated with this palette.
120     */
121    XColorSpace getColorSpace( );
122};
123
124}; }; }; };
125
126#endif
127