1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: thumbviewer.hxx,v $
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 THUMBVIEWER_HXX_INCLUDED
32 #define THUMBVIEWER_HXX_INCLUDED
35 #pragma warning(push, 1)
36 #pragma warning(disable:4917)
51 class CThumbviewer
: public IPersistFile
, public IExtractImage
54 CThumbviewer(long RefCnt
= 1);
55 virtual ~CThumbviewer();
57 //-----------------------------
59 //-----------------------------
61 virtual HRESULT STDMETHODCALLTYPE
QueryInterface(
63 void __RPC_FAR
*__RPC_FAR
*ppvObject
);
65 virtual ULONG STDMETHODCALLTYPE
AddRef( void);
67 virtual ULONG STDMETHODCALLTYPE
Release( void);
69 //----------------------------
70 // IExtractImage methods
71 //----------------------------
73 virtual HRESULT STDMETHODCALLTYPE
Extract(HBITMAP
*phBmpImage
);
75 virtual HRESULT STDMETHODCALLTYPE
GetLocation(
83 //----------------------------
85 //----------------------------
87 virtual HRESULT STDMETHODCALLTYPE
GetClassID(CLSID
* pClassID
);
89 //----------------------------
90 // IPersistFile methods
91 //----------------------------
93 virtual HRESULT STDMETHODCALLTYPE
IsDirty();
95 virtual HRESULT STDMETHODCALLTYPE
Load(
96 /* [in] */ LPCOLESTR pszFileName
,
97 /* [in] */ DWORD dwMode
);
99 virtual HRESULT STDMETHODCALLTYPE
Save(
100 /* [unique][in] */ LPCOLESTR pszFileName
,
101 /* [in] */ BOOL fRemember
);
103 virtual HRESULT STDMETHODCALLTYPE
SaveCompleted(
104 /* [unique][in] */ LPCOLESTR pszFileName
);
106 virtual HRESULT STDMETHODCALLTYPE
GetCurFile(
107 /* [out] */ LPOLESTR __RPC_FAR
*ppszFileName
);
110 Gdiplus::Rect
CalcScaledAspectRatio(Gdiplus::Rect src
, Gdiplus::Rect dest
);
114 std::wstring filename_
;
115 SIZE thumbnail_size_
;
117 ULONG_PTR gdiplus_token_
;
118 Gdiplus::Bitmap
* signet_
;