/** * @file XTPMsgPreview.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPMSGPREVIEW_H__) # define __XTPMSGPREVIEW_H__ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPMsgPreviewDialog; class CXTPMsgPreviewProvider; class _XTP_EXT_CLASS CXTPMsgPreview : public IXTPPreview { public: CXTPMsgPreview(); ~CXTPMsgPreview(); private: virtual BOOL IsReady() const; virtual BOOL IsAvailable() const; virtual BOOL HasOwnNavigator() const; virtual UINT GetNumberOfPages() const; virtual SIZE GetPreferredPageSize() const; virtual void GoToPage(UINT page); virtual void Draw(HDC dc, SIZE clientSize, RECT updateRect); virtual BOOL OnHostWndMsg(LPMSG msg, LRESULT* result); virtual BOOL SupportsCompositedParent() const; virtual void Activate(); private: BOOL m_bCreated; BOOL m_bLoadFinished; BOOL m_bLoadSuccess; CXTPMsgPreviewDialog* m_MsgDialog; private: typedef struct _TEXTFIEDS { CString m_To; CString m_Date; CString m_Subject; CString m_CC; CString m_BCC; CString m_Attachments; CString m_Body; CString m_ReceiverName; CString m_SenderName; CString m_SenderMail; CString m_ReceiverMail; } TextFields; class CStatStg { public: STATSTG m_statStg; ~CStatStg() { CoTaskMemFree(m_statStg.pwcsName); } }; friend class CXTPMsgPreviewProvider; BOOL CreateMsgDialog(HWND parent); BOOL LoadMsg(LPCTSTR pFilePath); BOOL LoadMsg(IStream* pStream, LPCTSTR pImpliedFileName); static BOOL MustRead(CString& tag); static BOOL ReadStream(CStatStg& stg, CString& val, CString type, IStorage* pStorage); static void PlaceValue(TextFields& fields, CString val, CString tag); static BOOL ReadAttachmentStorage(TextFields& fields, LPOLESTR storageName, IStorage* pStorage); void FillFields(TextFields fields); }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // #if !defined(__XTPMSGPREVIEW_H__) /** @endcond */