merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / ui / XImageManager.idl
blob2c5f3882fffe5758bde3ddcab236956a54e2e9d7
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 ************************************************************************/
28 #ifndef __com_sun_star_ui_XImageManager_idl__
29 #define __com_sun_star_ui_XImageManager_idl__
31 #ifndef __com_sun_star_lang_XComponent_idl__
32 #include <com/sun/star/lang/XComponent.idl>
33 #endif
35 #ifndef __com_sun_star_graphic_XGraphic_idl__
36 #include <com/sun/star/graphic/XGraphic.idl>
37 #endif
39 #ifndef __com_sun_star_ui_XUIConfigurationListener_idl__
40 #include <com/sun/star/ui/XUIConfigurationListener.idl>
41 #endif
43 #ifndef __com_sun_star_ui_XUIConfigurationPersistence_idl__
44 #include <com/sun/star/ui/XUIConfigurationPersistence.idl>
45 #endif
47 #ifndef __com_sun_star_ui_XUIConfiguration_idl__
48 #include <com/sun/star/ui/XUIConfiguration.idl>
49 #endif
51 #ifndef __com_sun_star_ui_ImageType_idl__
52 #include <com/sun/star/ui/ImageType.idl>
53 #endif
55 #ifndef __com_sun_star_lang_XInitialization_idl__
56 #include <com/sun/star/lang/XInitialization.idl>
57 #endif
59 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
60 #include <com/sun/star/lang/IllegalArgumentException.idl>
61 #endif
63 #ifndef __com_sun_star_lang_IllegalAccessException_idl__
64 #include <com/sun/star/lang/IllegalAccessException.idl>
65 #endif
67 module com { module sun { module star { module ui {
69 /** specifies access functions to an images manager interface to add,
70 replace and remove images assocations to command URLs.
72 <p>
73 An image manager controls a number of image sets which are specified
74 by a <type>ImageType</type>.
75 </p>
78 interface XImageManager
80 /** resets the image manager to default data.
82 <p>
83 This means that all user images of the instance will be removed.
84 </p>
86 void reset();
88 /** retrieves the list of command URLs which have images associated.
90 @param nImageType
91 specifies the image type for this operation.
93 @return
94 all command URLs within the images manager that have an image
95 associated.
97 sequence< string > getAllImageNames( [in] short nImageType );
99 /** determines if a command URL has an associated image.
101 @param nImageType
102 specifies the image type for this operation.
104 @param ResourceURL
105 a command URL that should be checked for an associated image.
107 @return
108 <TRUE/> if an image is associated, otherwise <FALSE/>.
110 boolean hasImage( [in] short nImageType, [in] string aCommandURL ) raises ( com::sun::star::lang::IllegalArgumentException );
112 /** retrieves the associated images of command URLs.
114 @param nImageType
115 specifies the image type for this association operation.
117 @param aCommandURLSequence
118 a sequence of command URLs for which the images are requested.
120 @return
121 a sequence of graphics object which are associated with the
122 provided command URLs. If an unknown command URL is provided or
123 a command URL has no associated image a graphics object with an
124 empty image is provided. If the sequence
125 <var>aCommandURLSequence</var> contains an invalid command
126 URL a <type scope="com::sun::star::lang">IllegalArgumentException</type>
127 is thrown.
129 sequence< ::com::sun::star::graphic::XGraphic > getImages( [in] short nImageType, [in] sequence< string > aCommandURLSequence ) raises ( com::sun::star::lang::IllegalArgumentException );
131 /** replaces the associated images of command URLs.
133 @param nImageType
134 specifies the image type for this association operation.
136 @param aCommandURLSequence
137 a sequence of command URLs for which images should be replaced.
139 @param aGraphicsSequence
140 a sequence of graphic objects which should replace the old images
141 of the provided command URLs.
144 If a command URL cannot be found the replace call will be omitted. If
145 <var>aCommandURLSequence</var> contains an invalid command URL a
146 <type scope="com::sun::star::lang">IllegalArgumentException</type>
147 is thrown. If the image manager is associated with a read-only configuration
148 manager a <type scope="com::sun::star::lang">IllegalAccessException</type>
149 is thrown.
150 </p>
152 void replaceImages( [in] short nImageType, [in] sequence< string > aCommandURLSequence, [in] sequence< ::com::sun::star::graphic::XGraphic > aGraphicsSequence ) raises ( com::sun::star::lang::IllegalArgumentException, com::sun::star::lang::IllegalAccessException );
154 /** removes associated images to a command URL.
156 @param nImageType
157 specifies the image type for this association operation.
159 @param aCommandURLSequence
160 a sequence of command URLs for which the images should be removed.
163 If the <var>aCommandURLSequence</var> contains an invalid command URL a
164 <type scope="com::sun::star::lang">IllegalArgumentException</type> is
165 thrown. If the image manager is associated with a read-only configuration
166 manager a <type scope="com::sun::star::lang">IllegalAccessException</type>
167 is thrown.
168 </p>
170 void removeImages( [in] short nImageType, [in] sequence< string > aResourceURLSequence ) raises ( com::sun::star::lang::IllegalArgumentException, com::sun::star::lang::IllegalAccessException );
172 /** inserts new image/command associations to a image manager.
174 @param nImageType
175 specifies the image type for this association operation.
177 @param aCommandURLSequence
178 a sequence of command URLs which specify which commands get an new image.
180 @param aGraphicSequence
181 a sequence of graphic objects which should be associated with the provided
182 command URLs.
185 If an association is already present it is replaced. If
186 <var>aCommandURLSequence</var> contains an invalid command URL a
187 <type scope="com::sun::star::lang">IllegalArgumentException</type>
188 is thrown. If the configuration manager is read-only a
189 <type scope="com::sun::star::lang">IllegalAccessException</type> is
190 thrown.
191 </p>
193 void insertImages( [in] short nImageType, [in] sequence< string > aCommandURLSequence, [in] sequence< ::com::sun::star::graphic::XGraphic > aGraphicSequence ) raises ( com::sun::star::container::ElementExistException, com::sun::star::lang::IllegalArgumentException, com::sun::star::lang::IllegalAccessException );
195 /** provides access to persistence functions to load/store images
196 data from a storage.
198 interface com::sun::star::ui::XUIConfigurationPersistence;
200 /** provides functions to add and remove listeners for changes within an
201 image manager.
204 An image manager implementation notifies its listener whenever an image
205 set has been changed, due to insert, remove or replace operations. To
206 minimize the overhead for notifications an image manager places all
207 inserted and/or replaced images into a single notify call. A container
208 which implements <type scope="com::sun::star::container">XNameAccess</type>
209 holds the information. The access key is a command URL and provides a
210 <type scope="::com::sun::star::graphic">XGraphic</type>. This container
211 is placed into the
212 <member scope="com::sun::star::ui">ConfigurationEvent::Element</member>.
213 The image set which has been changed is put into the
214 <member scope="com::sun::star::ui">ConfigurationEvent::aInfo</member>.
215 </p>
217 interface com::sun::star::ui::XUIConfiguration;
219 /** allows controlling or observing the lifetime of an imahge manager
220 instance.
222 <p>The owner of the object may dispose of this object using
223 <member scope="com::sun::star::lang">XComponent::dispose()</member>.
224 </p>
226 interface ::com::sun::star::lang::XComponent;
228 /** initializes an image manager instance.
230 An image manager instance must be initialized using
231 <member scope=com::sun::star::lang>XInitialization::initialize</member>
232 before it can be used.<br>
233 The following property must be provided if the image manager is
234 related to a module:
235 <ul>
236 <li><b>ModuleIdentifier</b>specifies a string property which is the
237 unique identifier of module.
238 </li>
239 <li><b>UserConfigStorage</b>specifies a
240 <type scope="com::sun::star::embed">XStorage</type> property which
241 provides access to the configuration storage of the module.
242 </li>
243 <li><b>UserRootCommit</b>specifies an optional
244 <type scope="com::sun::star::embed">XTransactedObject</type>
245 property which makes it possible to commit a root storage.
246 </li>
247 </ul>
249 interface ::com::sun::star::lang::XInitialization;
252 //=============================================================================
254 }; }; }; };
256 #endif