1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef __com_sun_star_rendering_XBitmapPalette_idl__
28 #define __com_sun_star_rendering_XBitmapPalette_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include
<com
/sun
/star
/uno
/XInterface.idl
>
33 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
34 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
36 #ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
37 #include
<com
/sun
/star
/lang
/IndexOutOfBoundsException.idl
>
39 #ifndef __com_sun_star_rendering_XColorSpace_idl__
40 #include
<com
/sun
/star
/rendering
/XColorSpace.idl
>
44 module com
{ module sun
{ module star
{ module rendering
{
46 /** Interface to access the palette of a color-indexed bitmap.
50 interface XBitmapPalette
: ::com
::sun
::star
::uno
::XInterface
52 /** Request the number of palette entries available.
54 @return the number of entries in this palette.
56 long getNumberOfEntries
();
58 //-------------------------------------------------------------------------
60 /** Request the color for the given palette entry.
63 Output parameter for the color components at the given palette
67 The index of the palette entry to be retrieved. Valid range is
68 [0,getNumberOfEntries()-1].
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.
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.
80 boolean getIndex
( [out] sequence
<ColorComponent
> entry, [in] long nIndex
)
81 raises
(com
::sun
::star
::lang
::IndexOutOfBoundsException
);
83 //-------------------------------------------------------------------------
85 /** Set the color for the given palette entry.
88 Sequence of device color values in the associated bitmap's
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.
97 The index of the palette entry to be changed. Valid range is
98 [0,getNumberOfEntries()-1].
100 @return whether the palette entry was changed. For read-only
101 entries, this method always returns <FALSE/>.
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.
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.
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
);
115 //-------------------------------------------------------------------------
117 /** Query associated color space.<p>
119 @return the color space that is associated with this palette.
121 XColorSpace getColorSpace
( );