1*d1766043SAndrew Rist/**************************************************************
2*d1766043SAndrew Rist *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#ifndef __com_sun_star_ui_XImageManager_idl__
25cdf0e10cSrcweir#define __com_sun_star_ui_XImageManager_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef __com_sun_star_lang_XComponent_idl__
28cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir
31cdf0e10cSrcweir#ifndef __com_sun_star_graphic_XGraphic_idl__
32cdf0e10cSrcweir#include <com/sun/star/graphic/XGraphic.idl>
33cdf0e10cSrcweir#endif
34cdf0e10cSrcweir
35cdf0e10cSrcweir#ifndef __com_sun_star_ui_XUIConfigurationListener_idl__
36cdf0e10cSrcweir#include <com/sun/star/ui/XUIConfigurationListener.idl>
37cdf0e10cSrcweir#endif
38cdf0e10cSrcweir
39cdf0e10cSrcweir#ifndef __com_sun_star_ui_XUIConfigurationPersistence_idl__
40cdf0e10cSrcweir#include <com/sun/star/ui/XUIConfigurationPersistence.idl>
41cdf0e10cSrcweir#endif
42cdf0e10cSrcweir
43cdf0e10cSrcweir#ifndef __com_sun_star_ui_XUIConfiguration_idl__
44cdf0e10cSrcweir#include <com/sun/star/ui/XUIConfiguration.idl>
45cdf0e10cSrcweir#endif
46cdf0e10cSrcweir
47cdf0e10cSrcweir#ifndef __com_sun_star_ui_ImageType_idl__
48cdf0e10cSrcweir#include <com/sun/star/ui/ImageType.idl>
49cdf0e10cSrcweir#endif
50cdf0e10cSrcweir
51cdf0e10cSrcweir#ifndef __com_sun_star_lang_XInitialization_idl__
52cdf0e10cSrcweir#include <com/sun/star/lang/XInitialization.idl>
53cdf0e10cSrcweir#endif
54cdf0e10cSrcweir
55cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
56cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
57cdf0e10cSrcweir#endif
58cdf0e10cSrcweir
59cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalAccessException_idl__
60cdf0e10cSrcweir#include <com/sun/star/lang/IllegalAccessException.idl>
61cdf0e10cSrcweir#endif
62cdf0e10cSrcweir
63cdf0e10cSrcweirmodule com { module sun { module star { module ui {
64cdf0e10cSrcweir
65cdf0e10cSrcweir/** specifies access functions to an images manager interface to add,
66cdf0e10cSrcweir    replace and remove images assocations to command URLs.
67cdf0e10cSrcweir
68cdf0e10cSrcweir    <p>
69cdf0e10cSrcweir    An image manager controls a number of image sets which are specified
70cdf0e10cSrcweir    by a <type>ImageType</type>.
71cdf0e10cSrcweir    </p>
72cdf0e10cSrcweir*/
73cdf0e10cSrcweir
74cdf0e10cSrcweirpublished interface XImageManager
75cdf0e10cSrcweir{
76cdf0e10cSrcweir    /** resets the image manager to default data.
77cdf0e10cSrcweir
78cdf0e10cSrcweir        <p>
79cdf0e10cSrcweir        This means that all user images of the instance will be removed.
80cdf0e10cSrcweir        </p>
81cdf0e10cSrcweir    */
82cdf0e10cSrcweir    void reset();
83cdf0e10cSrcweir
84cdf0e10cSrcweir    /** retrieves the list of command URLs which have images associated.
85cdf0e10cSrcweir
86cdf0e10cSrcweir        @param nImageType
87cdf0e10cSrcweir            specifies the image type for this operation.
88cdf0e10cSrcweir
89cdf0e10cSrcweir        @return
90cdf0e10cSrcweir            all command URLs within the images manager that have an image
91cdf0e10cSrcweir            associated.
92cdf0e10cSrcweir    */
93cdf0e10cSrcweir    sequence< string > getAllImageNames( [in] short nImageType );
94cdf0e10cSrcweir
95cdf0e10cSrcweir    /** determines if a command URL has an associated image.
96cdf0e10cSrcweir
97cdf0e10cSrcweir        @param nImageType
98cdf0e10cSrcweir            specifies the image type for this operation.
99cdf0e10cSrcweir
100cdf0e10cSrcweir        @param ResourceURL
101cdf0e10cSrcweir            a command URL that should be checked for an associated image.
102cdf0e10cSrcweir
103cdf0e10cSrcweir        @return
104cdf0e10cSrcweir            <TRUE/> if an image is associated, otherwise <FALSE/>.
105cdf0e10cSrcweir    */
106cdf0e10cSrcweir    boolean hasImage( [in] short nImageType, [in] string aCommandURL ) raises ( com::sun::star::lang::IllegalArgumentException );
107cdf0e10cSrcweir
108cdf0e10cSrcweir    /** retrieves the associated images of command URLs.
109cdf0e10cSrcweir
110cdf0e10cSrcweir        @param nImageType
111cdf0e10cSrcweir            specifies the image type for this association operation.
112cdf0e10cSrcweir
113cdf0e10cSrcweir        @param aCommandURLSequence
114cdf0e10cSrcweir            a sequence of command URLs for which the images are requested.
115cdf0e10cSrcweir
116cdf0e10cSrcweir        @return
117cdf0e10cSrcweir            a sequence of graphics object which are associated with the
118cdf0e10cSrcweir            provided command URLs. If an unknown command URL is provided or
119cdf0e10cSrcweir            a command URL has no associated image a graphics object with an
120cdf0e10cSrcweir            empty image is provided. If the sequence
121cdf0e10cSrcweir            <var>aCommandURLSequence</var> contains an invalid command
122cdf0e10cSrcweir            URL a <type scope="com::sun::star::lang">IllegalArgumentException</type>
123cdf0e10cSrcweir            is thrown.
124cdf0e10cSrcweir    */
125cdf0e10cSrcweir    sequence< ::com::sun::star::graphic::XGraphic > getImages( [in] short nImageType, [in] sequence< string > aCommandURLSequence ) raises ( com::sun::star::lang::IllegalArgumentException );
126cdf0e10cSrcweir
127cdf0e10cSrcweir    /** replaces the associated images of command URLs.
128cdf0e10cSrcweir
129cdf0e10cSrcweir        @param nImageType
130cdf0e10cSrcweir            specifies the image type for this association operation.
131cdf0e10cSrcweir
132cdf0e10cSrcweir        @param aCommandURLSequence
133cdf0e10cSrcweir            a sequence of command URLs for which images should be replaced.
134cdf0e10cSrcweir
135cdf0e10cSrcweir        @param aGraphicsSequence
136cdf0e10cSrcweir            a sequence of graphic objects which should replace the old images
137cdf0e10cSrcweir            of the provided command URLs.
138cdf0e10cSrcweir
139cdf0e10cSrcweir        <p>
140cdf0e10cSrcweir        If a command URL cannot be found the replace call will be omitted. If
141cdf0e10cSrcweir        <var>aCommandURLSequence</var> contains an invalid command URL a
142cdf0e10cSrcweir        <type scope="com::sun::star::lang">IllegalArgumentException</type>
143cdf0e10cSrcweir        is thrown. If the image manager is  associated with a read-only configuration
144cdf0e10cSrcweir        manager a <type scope="com::sun::star::lang">IllegalAccessException</type>
145cdf0e10cSrcweir        is thrown.
146cdf0e10cSrcweir        </p>
147cdf0e10cSrcweir    */
148cdf0e10cSrcweir    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 );
149cdf0e10cSrcweir
150cdf0e10cSrcweir    /** removes associated images to a command URL.
151cdf0e10cSrcweir
152cdf0e10cSrcweir        @param nImageType
153cdf0e10cSrcweir            specifies the image type for this association operation.
154cdf0e10cSrcweir
155cdf0e10cSrcweir        @param aCommandURLSequence
156cdf0e10cSrcweir            a sequence of command URLs for which the images should be removed.
157cdf0e10cSrcweir
158cdf0e10cSrcweir        <p>
159cdf0e10cSrcweir        If the <var>aCommandURLSequence</var> contains an invalid command URL a
160cdf0e10cSrcweir        <type scope="com::sun::star::lang">IllegalArgumentException</type> is
161cdf0e10cSrcweir        thrown. If  the image manager is associated with a read-only configuration
162cdf0e10cSrcweir        manager a <type scope="com::sun::star::lang">IllegalAccessException</type>
163cdf0e10cSrcweir        is thrown.
164cdf0e10cSrcweir        </p>
165cdf0e10cSrcweir    */
166cdf0e10cSrcweir    void removeImages( [in] short nImageType, [in] sequence< string > aResourceURLSequence ) raises ( com::sun::star::lang::IllegalArgumentException, com::sun::star::lang::IllegalAccessException );
167cdf0e10cSrcweir
168cdf0e10cSrcweir    /** inserts new image/command associations to a image manager.
169cdf0e10cSrcweir
170cdf0e10cSrcweir        @param nImageType
171cdf0e10cSrcweir            specifies the image type for this association operation.
172cdf0e10cSrcweir
173cdf0e10cSrcweir        @param aCommandURLSequence
174cdf0e10cSrcweir            a sequence of command URLs which specify which commands get an new image.
175cdf0e10cSrcweir
176cdf0e10cSrcweir        @param aGraphicSequence
177cdf0e10cSrcweir            a sequence of graphic objects which should be associated with the provided
178cdf0e10cSrcweir            command URLs.
179cdf0e10cSrcweir
180cdf0e10cSrcweir        <p>
181cdf0e10cSrcweir        If an association is already present it is replaced. If
182cdf0e10cSrcweir        <var>aCommandURLSequence</var> contains an invalid command URL a
183cdf0e10cSrcweir        <type scope="com::sun::star::lang">IllegalArgumentException</type>
184cdf0e10cSrcweir        is thrown. If the configuration manager is read-only a
185cdf0e10cSrcweir        <type scope="com::sun::star::lang">IllegalAccessException</type> is
186cdf0e10cSrcweir        thrown.
187cdf0e10cSrcweir        </p>
188cdf0e10cSrcweir    */
189cdf0e10cSrcweir    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 );
190cdf0e10cSrcweir
191cdf0e10cSrcweir    /** provides access to persistence functions to load/store images
192cdf0e10cSrcweir        data from a storage.
193cdf0e10cSrcweir    */
194cdf0e10cSrcweir    interface com::sun::star::ui::XUIConfigurationPersistence;
195cdf0e10cSrcweir
196cdf0e10cSrcweir    /** provides functions to add and remove listeners for changes within an
197cdf0e10cSrcweir        image manager.
198cdf0e10cSrcweir
199cdf0e10cSrcweir        <p>
200cdf0e10cSrcweir        An image manager implementation notifies its listener whenever an image
201cdf0e10cSrcweir        set has been changed, due to insert, remove or replace operations. To
202cdf0e10cSrcweir        minimize the overhead for notifications an image manager places all
203cdf0e10cSrcweir        inserted and/or replaced images into a single notify call. A container
204cdf0e10cSrcweir        which implements <type scope="com::sun::star::container">XNameAccess</type>
205cdf0e10cSrcweir        holds the information. The access key is a command URL and provides a
206cdf0e10cSrcweir        <type scope="::com::sun::star::graphic">XGraphic</type>. This container
207cdf0e10cSrcweir        is placed into  the
208cdf0e10cSrcweir        <member scope="com::sun::star::ui">ConfigurationEvent::Element</member>.
209cdf0e10cSrcweir        The image set which has been changed is put into the
210cdf0e10cSrcweir        <member scope="com::sun::star::ui">ConfigurationEvent::aInfo</member>.
211cdf0e10cSrcweir        </p>
212cdf0e10cSrcweir    */
213cdf0e10cSrcweir    interface com::sun::star::ui::XUIConfiguration;
214cdf0e10cSrcweir
215cdf0e10cSrcweir    /** allows controlling or observing the lifetime of an imahge manager
216cdf0e10cSrcweir        instance.
217cdf0e10cSrcweir
218cdf0e10cSrcweir    <p>The owner of the object may dispose of this object using
219cdf0e10cSrcweir    <member scope="com::sun::star::lang">XComponent::dispose()</member>.
220cdf0e10cSrcweir    </p>
221cdf0e10cSrcweir    */
222cdf0e10cSrcweir    interface ::com::sun::star::lang::XComponent;
223cdf0e10cSrcweir
224cdf0e10cSrcweir    /** initializes an image manager instance.
225cdf0e10cSrcweir
226cdf0e10cSrcweir        An image manager instance must be initialized using
227cdf0e10cSrcweir        <member scope=com::sun::star::lang>XInitialization::initialize</member>
228cdf0e10cSrcweir        before it can be used.<br>
229cdf0e10cSrcweir        The following property must be provided if the image manager is
230cdf0e10cSrcweir        related to a module:
231cdf0e10cSrcweir        <ul>
232cdf0e10cSrcweir            <li><b>ModuleIdentifier</b>specifies a string property which is the
233cdf0e10cSrcweir            unique identifier of module.
234cdf0e10cSrcweir            </li>
235cdf0e10cSrcweir            <li><b>UserConfigStorage</b>specifies a
236cdf0e10cSrcweir            <type scope="com::sun::star::embed">XStorage</type> property which
237cdf0e10cSrcweir            provides access to the configuration storage of the module.
238cdf0e10cSrcweir            </li>
239cdf0e10cSrcweir            <li><b>UserRootCommit</b>specifies an optional
240cdf0e10cSrcweir            <type scope="com::sun::star::embed">XTransactedObject</type>
241cdf0e10cSrcweir            property which makes it possible to commit a root storage.
242cdf0e10cSrcweir            </li>
243cdf0e10cSrcweir        </ul>
244cdf0e10cSrcweir    */
245cdf0e10cSrcweir    interface ::com::sun::star::lang::XInitialization;
246cdf0e10cSrcweir};
247cdf0e10cSrcweir
248cdf0e10cSrcweir//=============================================================================
249cdf0e10cSrcweir
250cdf0e10cSrcweir}; }; }; };
251cdf0e10cSrcweir
252cdf0e10cSrcweir#endif
253