merged tag ooo/DEV300_m102
[LibreOffice.git] / fpicker / source / win32 / filepicker / previewbase.cxx
blob4e778e4fc0118e3dfc0b53385b9aa606ad719480
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_fpicker.hxx"
30 #include "previewbase.hxx"
32 #ifndef _COM_SUN_STAR_UI_DIALOG_FILEPREVIEWIMAGEFORMATS_HPP_
33 #include <com/sun/star/ui/dialogs/FilePreviewImageFormats.hpp>
34 #endif
36 using namespace com::sun::star::uno;
37 using namespace com::sun::star::lang;
38 using namespace rtl;
40 //-------------------------------
42 //-------------------------------
44 PreviewBase::PreviewBase() :
45 m_ImageFormat(::com::sun::star::ui::dialogs::FilePreviewImageFormats::BITMAP),
46 m_bShowState(sal_False)
50 //-------------------------------
52 //-------------------------------
54 PreviewBase::~PreviewBase()
58 //-------------------------------
60 //-------------------------------
62 sal_Int32 SAL_CALL PreviewBase::getTargetColorDepth() throw (RuntimeException)
64 return 0;
67 //-------------------------------
69 //-------------------------------
71 sal_Int32 SAL_CALL PreviewBase::getAvailableWidth() throw (RuntimeException)
73 return 0;
76 //-------------------------------
78 //-------------------------------
80 sal_Int32 SAL_CALL PreviewBase::getAvailableHeight() throw (RuntimeException)
82 return 0;
85 //-------------------------------
87 //-------------------------------
89 void SAL_CALL PreviewBase::setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage )
90 throw (IllegalArgumentException, RuntimeException)
92 if (aImageFormat != ::com::sun::star::ui::dialogs::FilePreviewImageFormats::BITMAP)
93 throw IllegalArgumentException(
94 OUString::createFromAscii("unsupported image format"), 0, 1);
96 if (aImage.hasValue() && (aImage.getValueType() != getCppuType((Sequence<sal_Int8>*)0)))
97 throw IllegalArgumentException(
98 OUString::createFromAscii("invalid image data"), 0, 2);
100 // save the new image data and force a redraw
101 m_ImageData = aImage;
102 m_ImageFormat = aImageFormat;
105 //-------------------------------
107 //-------------------------------
109 void SAL_CALL PreviewBase::getImage(sal_Int16& aImageFormat,com::sun::star::uno::Any& aImage)
111 aImageFormat = m_ImageFormat;
112 aImage = m_ImageData;
115 //-------------------------------
117 //-------------------------------
119 sal_Bool SAL_CALL PreviewBase::setShowState( sal_Bool bShowState ) throw (RuntimeException)
121 m_bShowState = bShowState;
122 return sal_True;
125 //-------------------------------
127 //-------------------------------
129 sal_Bool SAL_CALL PreviewBase::getShowState() throw (RuntimeException)
131 return sal_False;
134 //-------------------------------
136 //-------------------------------
138 sal_Bool SAL_CALL PreviewBase::getImaginaryShowState() const
140 return m_bShowState;
143 //-------------------------------
145 //-------------------------------
147 HWND SAL_CALL PreviewBase::getWindowHandle() const
149 return 0;