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
>
35 #ifndef __com_sun_star_graphic_XGraphic_idl__
36 #include
<com
/sun
/star
/graphic
/XGraphic.idl
>
39 #ifndef __com_sun_star_ui_XUIConfigurationListener_idl__
40 #include
<com
/sun
/star
/ui
/XUIConfigurationListener.idl
>
43 #ifndef __com_sun_star_ui_XUIConfigurationPersistence_idl__
44 #include
<com
/sun
/star
/ui
/XUIConfigurationPersistence.idl
>
47 #ifndef __com_sun_star_ui_XUIConfiguration_idl__
48 #include
<com
/sun
/star
/ui
/XUIConfiguration.idl
>
51 #ifndef __com_sun_star_ui_ImageType_idl__
52 #include
<com
/sun
/star
/ui
/ImageType.idl
>
55 #ifndef __com_sun_star_lang_XInitialization_idl__
56 #include
<com
/sun
/star
/lang
/XInitialization.idl
>
59 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
60 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
63 #ifndef __com_sun_star_lang_IllegalAccessException_idl__
64 #include
<com
/sun
/star
/lang
/IllegalAccessException.idl
>
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.
73 An image manager controls a number of image sets which are specified
74 by a <type>ImageType</type>.
78 interface XImageManager
80 /** resets the image manager to default data.
83 This means that all user images of the instance will be removed.
88 /** retrieves the list of command URLs which have images associated.
91 specifies the image type for this operation.
94 all command URLs within the images manager that have an image
97 sequence
< string > getAllImageNames
( [in] short nImageType
);
99 /** determines if a command URL has an associated image.
102 specifies the image type for this operation.
105 a command URL that should be checked for an associated image.
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.
115 specifies the image type for this association operation.
117 @param aCommandURLSequence
118 a sequence of command URLs for which the images are requested.
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>
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.
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>
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.
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>
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.
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
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
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
198 interface com
::sun
::star
::ui
::XUIConfigurationPersistence
;
200 /** provides functions to add and remove listeners for changes within an
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
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>.
217 interface com
::sun
::star
::ui
::XUIConfiguration
;
219 /** allows controlling or observing the lifetime of an imahge manager
222 <p>The owner of the object may dispose of this object using
223 <member scope="com::sun::star::lang">XComponent::dispose()</member>.
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
236 <li><b>ModuleIdentifier</b>specifies a string property which is the
237 unique identifier of module.
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.
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.
249 interface ::com
::sun
::star
::lang
::XInitialization
;
252 //=============================================================================