#if !defined(AFX_MAILRTFVIEW_H__78D5E582_387C_4566_873B_D47BF5FEED30__INCLUDED_)
#define AFX_MAILRTFVIEW_H__78D5E582_387C_4566_873B_D47BF5FEED30__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MailRTFView.h : header file
//
#include <afxrich.h>

class CPSMDoc;
class CaplMessageTreeItem;
/////////////////////////////////////////////////////////////////////////////
// CMailRTFView view

class CMailRTFView : public CRichEditView 
{
protected:
	CMailRTFView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CMailRTFView)

// Attributes
public:

// Operations
public:
	CPSMDoc* GetDocument();
	
	void UpdateBody(CaplInstance *message);
	void EndRead();
	void OnPrintBody();
	
	CaplInstance* m_cur_mes;
	CaplMessageTreeItem* m_cur_item;
	
	long m_iStartViewTick;
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMailRTFView)
	public:
	virtual void OnInitialUpdate();
	protected:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
protected:
	virtual ~CMailRTFView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
protected:
	//{{AFX_MSG(CMailRTFView)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
	static DWORD CALLBACK CBStreamIn(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
	static DWORD CALLBACK CBStreamOut(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG* pcb);
};

#ifndef _DEBUG  // debug version in ILSView.cpp
inline CPSMDoc* CMailRTFView::GetDocument()
   { return (CPSMDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MAILRTFVIEW_H__78D5E582_387C_4566_873B_D47BF5FEED30__INCLUDED_)
