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