xref: /trunk/main/offapi/com/sun/star/gallery/XGalleryTheme.idl (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
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.
14 *
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).
20 *
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.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_gallery_XGalleryTheme_idl__
29#define __com_sun_star_gallery_XGalleryTheme_idl__
30
31#ifndef __com_sun_star_container_XIndexAccess_idl__
32#include <com/sun/star/container/XIndexAccess.idl>
33#endif
34#ifndef __com_sun_star_lang_XComponent_idl__
35#include <com/sun/star/lang/XComponent.idl>
36#endif
37#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
38#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
39#endif
40#ifndef __com_sun_star_lang_WrappedTargetException_idl__
41#include <com/sun/star/lang/WrappedTargetException.idl>
42#endif
43#ifndef __com_sun_star_graphic_XGraphic_idl__
44#include <com/sun/star/graphic/XGraphic.idl>
45#endif
46#ifndef __com_sun_star_gallery_XGalleryItem_idl__
47#include <com/sun/star/gallery/XGalleryItem.idl>
48#endif
49
50//=============================================================================
51
52module com {  module sun {  module star {  module gallery {
53
54//=============================================================================
55
56/** provides access to the items of a Gallery themes. It also allows
57    inserting and removing of single items.
58
59    <p>This interface extends the interface
60    <type scope="com::sun::star::container">XIndexAccess</type> which provides
61    access to existing Gallery items collection.</p>
62
63    @see com::sun::star::container::XIndexAccess
64    @see com::sun::star::sheet::DataPilotTable
65 */
66interface XGalleryTheme : com::sun::star::container::XIndexAccess
67{
68    /** retrieves the name of the Gallery theme
69
70        @returns
71            The name of the Gallery theme
72     */
73    string getName();
74
75    /** updates the theme
76
77        <p>This method iterates over each item of the Gallery theme
78        and updates it accordingly. Main purpose is to automatically
79        regenerate the thumbnails and to remove invalid items, that is items
80        who have got an URL that has become invalid. This method also
81        optimizes underlying data structures.</p>
82     */
83    void update();
84
85    /** inserts an item
86
87        @param URL
88            The URL of a graphic or media object, that should
89            be added to the collection
90
91        @param Index
92            The zero based index of the position where to insert
93            the new object inside the collection. If the index is larger than
94            or equal to the number of already inserted items, the
95            item is inserted at the end of the collection. If the index
96            is smaller than 0, the item is inserted at the beginning of
97            the collection.
98
99        @returns
100            The zero based position at which the object was inserted.
101            If the object could not be inserted, -1 is returned.
102
103        @see XGalleryItem
104        @see com::sun::star::lang::WrappedTargetException
105    */
106    long insertURLByIndex( [in] string URL, [in] long Index )
107        raises ( com::sun::star::lang::WrappedTargetException );
108    /** inserts an item
109
110        @param Graphic
111            The <type scope="com::sun::star::graphic">XGraphic</type> object
112            that should be added to the collection
113
114        @param Index
115            The zero based index of the position where to insert
116            the new object inside the collection. If the index is larger than
117            or equal to the number of already inserted items, the
118            item is inserted at the end of the collection. If the index
119            is smaller than 0, the item is inserted at the beginning of
120            the collection.
121
122        @returns
123            The zero based position at which the object was inserted.
124            If the object could not be inserted, -1 is returned.
125
126        @see com::sun::star::graphic::XGraphic
127        @see XGalleryItem
128        @see com::sun::star::lang::WrappedTargetException
129    */
130    long insertGraphicByIndex( [in] com::sun::star::graphic::XGraphic Graphic, [in] long Index )
131        raises ( com::sun::star::lang::WrappedTargetException );
132
133    /** inserts an item
134
135        @param Drawing
136            A drawing model that should be added to the collection
137
138        @param Index
139            The zero based index of the position where to insert
140            the new object inside the collection. If the index is larger than
141            or equal to the number of already inserted items, the
142            item is inserted at the end of the collection. If the index
143            is smaller than 0, the item is inserted at the beginning of
144            the collection.
145
146        @returns
147            The zero based position at which the object was inserted.
148            If the object could not be inserted, -1 is returned.
149
150        @see XGalleryItem
151        @see com::sun::star::lang::WrappedTargetException
152    */
153    long insertDrawingByIndex( [in] com::sun::star::lang::XComponent Drawing, [in] long Index )
154        raises ( com::sun::star::lang::WrappedTargetException );
155
156    /** deletes an item from the collection
157
158        @param Index
159            The position of the item to be removed. The
160            position is zero based.
161
162        @see com::sun::star::container::NoSuchElementException
163    */
164    void removeByIndex( [in] long Index )
165        raises ( com::sun::star::lang::IndexOutOfBoundsException );
166};
167
168//=============================================================================
169
170}; }; }; };
171
172#endif
173