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