1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23#ifndef __com_sun_star_rendering_XBitmapPalette_idl__ 24#define __com_sun_star_rendering_XBitmapPalette_idl__ 25 26#ifndef __com_sun_star_uno_XInterface_idl__ 27#include <com/sun/star/uno/XInterface.idl> 28#endif 29#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 30#include <com/sun/star/lang/IllegalArgumentException.idl> 31#endif 32#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__ 33#include <com/sun/star/lang/IndexOutOfBoundsException.idl> 34#endif 35#ifndef __com_sun_star_rendering_XColorSpace_idl__ 36#include <com/sun/star/rendering/XColorSpace.idl> 37#endif 38 39 40module com { module sun { module star { module rendering { 41 42/** Interface to access the palette of a color-indexed bitmap. 43 44 @since OOo 2.0 45 */ 46interface XBitmapPalette : ::com::sun::star::uno::XInterface 47{ 48 /** Request the number of palette entries available. 49 50 @return the number of entries in this palette. 51 */ 52 long getNumberOfEntries(); 53 54 //------------------------------------------------------------------------- 55 56 /** Request the color for the given palette entry. 57 58 @param entry 59 Output parameter for the color components at the given palette 60 entry. 61 62 @param nIndex 63 The index of the palette entry to be retrieved. Valid range is 64 [0,getNumberOfEntries()-1]. 65 66 @return <TRUE/>, if the given palette entry should be displayed 67 opaque, and <FALSE/> if the entry should be displayed 68 transparent. This is sometimes used for so-called mask 69 transparency, by flagging certain palette entries to be fully 70 transparent when displaying the bitmap. 71 72 @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 73 if the index is smaller than zero or larger than 74 <member>XBitmapPalette::getNumberOfEntries()</member>-1. 75 */ 76 boolean getIndex( [out] sequence<ColorComponent> entry, [in] long nIndex ) 77 raises (com::sun::star::lang::IndexOutOfBoundsException); 78 79 //------------------------------------------------------------------------- 80 81 /** Set the color for the given palette entry. 82 83 @param color 84 Sequence of device color values in the associated bitmap's 85 device color format. 86 87 @param transparency 88 When <TRUE/>, the specified palette entry is displayed as 89 opaque color. When <FALSE/>, the given entry displays as fully 90 transparent during output. 91 92 @param nIndex 93 The index of the palette entry to be changed. Valid range is 94 [0,getNumberOfEntries()-1]. 95 96 @return whether the palette entry was changed. For read-only 97 entries, this method always returns <FALSE/>. 98 99 @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 100 if the index is smaller than zero or larger than 101 <member>XBitmapPalette::getNumberOfEntries()</member>-1. 102 103 @throws <type>com::sun::star::lang::IllegalArgumentException</type> 104 if the given sequence of color components does not match the 105 associated bitmap's device color format. 106 */ 107 boolean setIndex( [in] sequence<ColorComponent> color, [in] boolean transparency, [in] long nIndex ) 108 raises (com::sun::star::lang::IndexOutOfBoundsException, 109 com::sun::star::lang::IllegalArgumentException); 110 111 //------------------------------------------------------------------------- 112 113 /** Query associated color space.<p> 114 115 @return the color space that is associated with this palette. 116 */ 117 XColorSpace getColorSpace( ); 118}; 119 120}; }; }; }; 121 122#endif 123