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_ui_dialogs_XFilePreview_idl__
25#define __com_sun_star_ui_dialogs_XFilePreview_idl__
26
27#ifndef __com_sun_star_uno_XInterface_idl__
28#include <com/sun/star/uno/XInterface.idl>
29#endif
30
31#ifndef __com_sun_star_util_Color_idl__
32#include <com/sun/star/util/Color.idl>
33#endif
34
35#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
36#include <com/sun/star/lang/IllegalArgumentException.idl>
37#endif
38
39//=============================================================================
40
41module com { module sun { module star { module ui { module dialogs {
42
43//=============================================================================
44/** FilePicker that support the preview of various file formats should implement
45	this interface.
46*/
47
48published interface XFilePreview: com::sun::star::uno::XInterface
49{
50	//-------------------------------------------------------------------------
51	/** The method returns all image formats that the preview supports.
52
53		@returns
54		A sequence of all supported preview formats
55
56		@see com::sun::star::ui::dialogs::FilePreviewImageFormats
57	*/
58	sequence< short > getSupportedImageFormats( );
59
60	//-------------------------------------------------------------------------
61	/** The method returns the supported color depth of the target device.
62
63		@returns
64		The color depth in bit, e.g. 8 bit, 16 bit, 32 bit.
65	*/
66	com::sun::star::util::Color getTargetColorDepth( );
67
68	//-------------------------------------------------------------------------
69	/** The method returns the available width of the preview window
70		even if the window is invisible or could not be created.
71		If a service implementation doesn't support a file preview
72		0 will be returned.
73
74		@returns
75		The width of the preview window in pixel.
76	*/
77	long getAvailableWidth( );
78
79	//-------------------------------------------------------------------------
80	/** The method returns the available height of the preview window
81		even if the window is invisible or could not be created.
82		If a service implementation doesn't support a file preview
83		0 will be returned.
84
85		@returns
86		The heigth of the preview window in pixel.
87	*/
88	long getAvailableHeight( );
89
90	//-------------------------------------------------------------------------
91	/** Sets a new image. If the preview is currently hidden the
92		image will be ignored. An empty any will clear the preview window.
93
94		@param aImageFormat
95		Specifies the format of the data that will be delivered
96
97		@param aImage
98		The image data, the image format defines how
99		the image data have to be delivered
100
101		@throws com::sun::star::lang::IllegalArgumentException
102		If the specified image format is invalid or not
103		supported by the preview implementation
104
105		@see com::sun::star::ui::dialogs::FilePreviewImageFormats
106	*/
107	void setImage( [in] short aImageFormat, [in] any aImage )
108		raises( ::com::sun::star::lang::IllegalArgumentException );
109
110	//-------------------------------------------------------------------------
111	/** Optionally sets the current show state of the preview. It is possible
112		that the preview implementation doesn't support hiding the preview.
113
114		@param bShowState
115		A value of <TRUE/> shows the preview window.
116		<p>A value of <FALSE/> hides the preview window.</p>
117
118		@returns
119		A value of <TRUE/> on success.
120		<p>A vaue of <FALSE/> if the operation fails for any reason or the preview
121		implementation doesn't support hiding the preview.</p>
122	*/
123	boolean setShowState( [in] boolean bShowState );
124
125	//-------------------------------------------------------------------------
126	/** Returns the current show state of the preview.
127
128		@returns
129		A value of <TRUE/> if the preview window is visible.
130		<p>A value of <FALSE/> if the preview window is invisible.</p>
131	*/
132	boolean getShowState( );
133};
134
135//=============================================================================
136
137}; }; }; }; };
138
139
140#endif
141