Update ooo320-m1
[ooovba.git] / fpicker / source / win32 / filepicker / previewadapter.hxx
blob43eb6555d39549d4807fa832418044fba68c3a5f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: previewadapter.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _PREVIEWADAPTER_HXX_
32 #define _PREVIEWADAPTER_HXX_
34 #include <sal/types.h>
35 #include <com/sun/star/uno/Sequence.hxx>
36 #include <com/sun/star/uno/RuntimeException.hpp>
37 #include <com/sun/star/lang/IllegalArgumentException.hpp>
38 #include <com/sun/star/uno/Any.hxx>
40 #if defined _MSC_VER
41 #pragma warning(push, 1)
42 #endif
43 #include <windows.h>
44 #if defined _MSC_VER
45 #pragma warning(pop)
46 #endif
47 #include <memory>
49 // forward declaration
50 class CPreviewAdapterImpl;
52 //---------------------------------------------
53 // A kind of a facade for the preview class.
54 // We want to hide the fact that the preview
55 // window may only become visible if there is
56 // a valid parent window (means, the FilePicker)
57 // is in execution mode. So unless someone sets
58 // the preview active with a valid parent
59 // window the preview may not be visible
60 //---------------------------------------------
62 class CPreviewAdapter
64 public:
66 // ctor
67 CPreviewAdapter(HINSTANCE instance);
69 ~CPreviewAdapter();
71 ::com::sun::star::uno::Sequence<sal_Int16> SAL_CALL getSupportedImageFormats();
73 sal_Int32 SAL_CALL getTargetColorDepth();
75 sal_Int32 SAL_CALL getAvailableWidth();
77 sal_Int32 SAL_CALL getAvailableHeight();
79 void SAL_CALL setImage(sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage)
80 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
82 sal_Bool SAL_CALL setShowState(sal_Bool bShowState);
84 sal_Bool SAL_CALL getShowState();
86 void SAL_CALL setParent(HWND parent);
88 //--------------------------------------
89 // notification from parent
90 //--------------------------------------
92 void SAL_CALL notifyParentShow(bool bShow);
94 void SAL_CALL notifyParentSizeChanged();
96 void SAL_CALL notifyParentWindowPosChanged();
98 private:
99 // hide implementation details using the
100 // bridge pattern
101 std::auto_ptr<CPreviewAdapterImpl> m_pImpl;
103 // prevent copy and assignment
104 private:
105 CPreviewAdapter(const CPreviewAdapter&);
106 CPreviewAdapter& operator=(const CPreviewAdapter&);
110 #endif