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 INFOTIPS_HXX_INCLUDED 29 #define INFOTIPS_HXX_INCLUDED 30 31 #if defined _MSC_VER 32 #pragma warning(push, 1) 33 #pragma warning(disable:4917) 34 #endif 35 #include <objidl.h> 36 #include <shlobj.h> 37 #if defined _MSC_VER 38 #pragma warning(pop) 39 #endif 40 #include <string> 41 42 class CInfoTip : public IQueryInfo, public IPersistFile 43 { 44 public: 45 CInfoTip(long RefCnt = 1); 46 virtual ~CInfoTip(); 47 48 //----------------------------- 49 // IUnknown methods 50 //----------------------------- 51 52 virtual HRESULT STDMETHODCALLTYPE QueryInterface( 53 REFIID riid, 54 void __RPC_FAR *__RPC_FAR *ppvObject); 55 56 virtual ULONG STDMETHODCALLTYPE AddRef( void); 57 58 virtual ULONG STDMETHODCALLTYPE Release( void); 59 60 //---------------------------- 61 // IQueryInfo methods 62 //---------------------------- 63 64 virtual HRESULT STDMETHODCALLTYPE GetInfoTip(DWORD dwFlags, wchar_t** ppwszTip); 65 66 virtual HRESULT STDMETHODCALLTYPE GetInfoFlags(DWORD *pdwFlags); 67 68 //---------------------------- 69 // IPersist methods 70 //---------------------------- 71 72 virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID* pClassID); 73 74 //---------------------------- 75 // IPersistFile methods 76 //---------------------------- 77 78 virtual HRESULT STDMETHODCALLTYPE IsDirty(void); 79 80 virtual HRESULT STDMETHODCALLTYPE Load( 81 /* [in] */ LPCOLESTR pszFileName, 82 /* [in] */ DWORD dwMode); 83 84 virtual HRESULT STDMETHODCALLTYPE Save( 85 /* [unique][in] */ LPCOLESTR pszFileName, 86 /* [in] */ BOOL fRemember); 87 88 virtual HRESULT STDMETHODCALLTYPE SaveCompleted( 89 /* [unique][in] */ LPCOLESTR pszFileName); 90 91 virtual HRESULT STDMETHODCALLTYPE GetCurFile( 92 /* [out] */ LPOLESTR __RPC_FAR *ppszFileName); 93 94 private: 95 long m_RefCnt; 96 char m_szFileName[MAX_PATH]; 97 std::wstring m_FileNameOnly; 98 }; 99 100 #endif 101