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