#ifndef __RichText_h
#define __RichText_h

#include "2Env.h"

class MCARCHIVE;

/*----- CFDWndRichEdit::m_byVertAlign_xZkqqHx_iBeB_xHqqkZx_MC2RichText::m_dwVertAlign_xZkqqHx_iLkEjCmK_xHqqkZx_ -----*/
#define FDRC_AL_TOP			0x01
#define FDRC_AL_V_CENTER	0x02
#define FDRC_AL_BOTTOM		0x03

/*----- FDEditLine::m_byAlignment_xZkqqHx_iBeB_xHqqkZx_MC2StatLine::m_byAlignment_xZkqqHx_iLkEjCmK_xHqqkZx_ -----*/
#define FDRC_AL_NONE		0x00
#define FDRC_AL_LEFT		0x01
#define FDRC_AL_CENTER		0x02
#define FDRC_AL_RIGHT		0x03
// 01.02.19 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
#define FDRC_AL_JUSTIFY		0x04	// _xZkqqHx_iLmPjDjJiBeC_xHqqkZx_


/*----- FDEditLine::m_byLineType_xZkqqHx_iBeB_xHqqkZx_MC2StatLine::m_byLineType_xZkqqHx_iLkEjCmK_xHqqkZx_ -----*/
#define FDRC_LT_HEAD		0x00
#define FDRC_LT_CONTINUE	0x01

/*----- FDEditChar::m_wChar, MC2StatChar::m_wChar_xZkqqHx_iLkEjCmK_xHqqkZx_ -----*/
#define FDRCH_RETURN	0x00
#define FDRCH_CONTINUE	0x01
/*----- MC2StatChar::m_wChar_xZkqqHx_jAoKjHhA_xHqqkZx_ -----*/
#define FDRCH_V2_FONT		0x02
#define FDRCH_V2_OFFSET		0x03
#define FDRCH_V2_SCOLOR		0x04
#define FDRCH_V2_PRESPACE	0x05

#define FDRCH_FONT_AND_OFFSET		0x02
#define FDRCH_PRESPACE				0x03
#define FDRCH_COLORREF				0x04
#define FDRCH_AFTERSPACE			0x05
#define FDRCH_LINES_AND_CROSSSTAT	0x06


////////////////////////// _xZkqqHx_jFjEjFgJjHhAiCmMiDeOiDiJiDfI_xHqqkZx_ ////////////////////////////////
class MC2StatCharV2
{
public:
	MC2StatCharV2 ();
	void	InStreamV2 (MCARCHIVE& ar);

public:
	WORD	m_wChar;	// _xZkqqHx_jFlGiOjKiDfCiBfLiDgI_xHqqkZx_.
	union
	{
		DWORD		m_dwForStream;	// _xZkqqHx_jDpMiPgPjHmNjHhAiBeC_xHqqkZx_
		float		m_mmfWidth;		// _xZkqqHx_jFlGiOjKiCmMjFjN_xHqqkZx_.
		SFontID		m_foidFont;		// _xZkqqHx_jFlGiOjKiCmMiDhEiDeIiDjDiDgH_xHqqkZx_ID.
		float		m_fOffset;		// Baseline_xZkqqHx_iCkJiCoHiCmM_xHqqkZx_Offset.
		SColorID	m_scidSColor;	// _xZkqqHx_jFlGiOjKiCmMjAeG_xHqqkZx_.
		float		m_mmfPreSpace;	// _xZkqqHx_jFlGiOjKiCmMjBePiCmMjHfNjEjC_xHqqkZx_.
	};
	float	m_mmfAbcA;	// ABC_xZkqqHx_iNfMjBkCjBmMiCmM_xHqqkZx_abcA_xZkqqHx_iCmMjCgMiBeC_xHqqkZx_
	float	m_mmfAbcC;	// ABC_xZkqqHx_iNfMjBkCjBmMiCmM_xHqqkZx_abcC_xZkqqHx_iCmMjCgMiBeC_xHqqkZx_
}; // class MC2StatCharV2.

typedef vector<MC2StatCharV2> MC2StatCharV2Vector;

class MC2StatChar
{
public:
	MC2StatChar ();
	void	OutStreamV3 (MCARCHIVE& ar) const;

public:
	WORD	m_wChar;	// _xZkqqHx_jFlGiOjKiDfCiBfLiDgI_xHqqkZx_.
	union
	{
		DWORD			m_dwForStream;	// _xZkqqHx_jDpMiPgPjHmNjHhAiBeC_xHqqkZx_
		fmmetol			m_mmfWidth;		// _xZkqqHx_jFlGiOjKiCmMjFjN_xHqqkZx_.
		struct {
			SFontID		m_foidFont;		// _xZkqqHx_jFlGiOjKiCmMiDhEiDeIiDjDiDgH_xHqqkZx_ID.
			WORD		m_wOffset;		// Baseline_xZkqqHx_iCkJiCoHiCmM_xHqqkZx_Offset_xZkqqHx_iBeC_xHqqkZx_0,MAXSHORT,MINSHORT_xZkqqHx_iCmM_xHqqkZx_3_xZkqqHx_jCgMiBeC_xHqqkZx_
		};
		fmmetol			m_mmfPreSpace;	// _xZkqqHx_jFlGiOjKiCmMjBePiCmMjHfNjEjC_xHqqkZx_.
		COLORREF		m_crColor;		// _xZkqqHx_jFlGiOjKiCmMjAeG_xHqqkZx_.
		short			m_nAfterSpace;	// _xZkqqHx_jFlGiOjKiCmMiMoDiCoLiCmMiLpDjEjCiBeC_xHqqkZx_TWIPS_xZkqqHx_iBeC_xHqqkZx_
		struct {
			BYTE		m_byUnderline;	// _xZkqqHx_iJlKjApMiBeC_xHqqkZx_
			BYTE		m_byStrikeOut;	// _xZkqqHx_iOoGiPmBiClFjApMiBeC_xHqqkZx_
			BYTE		m_byCrossStat;	// _xZkqqHx_jFlGiOjKiIoMiCoKiPpDjBnEiBeC_xHqqkZx_
			BYTE		m_byDummy;
		};
	};
	fmmetol	m_mmfAbcA;	// ABC_xZkqqHx_iNfMjBkCjBmMiCmM_xHqqkZx_abcA_xZkqqHx_iCmMjCgMiBeC_xHqqkZx_
	fmmetol	m_mmfAbcC;	// ABC_xZkqqHx_iNfMjBkCjBmMiCmM_xHqqkZx_abcC_xZkqqHx_iCmMjCgMiBeC_xHqqkZx_
}; // class MC2StatChar.

typedef vector<MC2StatChar> MC2StatCharVector;

class MC2StatLine
{
public:
	MC2StatLine ();
	void	operator = (const MC2StatLine& sl);
	void	OutStreamV3 (MCARCHIVE& ar) const;
	void	InStreamV1V2 (MCARCHIVE& ar, CDC* pDC, CFont* pFont);

public:
	//----- _xZkqqHx_jAoGjDkKiNhDiBeBiMhAjBlBiNhDiCmFjDkPiClGjCgMiCpAiOjNiCmCiDiBiDjDiDgPjFmPjAjE_xHqqkZx_ -----
	double			m_mmStartIndent;	// _xZkqqHx_jAoGjDkKiNhDiCmMiNlGiDeDiDjDiDgGiDjDiDgH_xHqqkZx_.
	double			m_mmRightIndent;	// _xZkqqHx_jAoGjDkKiBeFiMhAjBlBiNhDiCmMiJeFiDeDiDjDiDgGiDjDiDgH_xHqqkZx_.
	double			m_mmOffset;			// _xZkqqHx_iMhAjBlBiNhDiCmMiDeDiDjDiDgGiDjDiDgHiBgJjAoGjDkKiNhDiCmJ_xHqqkZx_
										// _xZkqqHx_jBmOiClHiCoJiDeJiDhEiDfKiDgCiDgHjCgMiBgK_xHqqkZx_.
	doubleVector	m_mmvTabs;			// _xZkqqHx_iDfOiDhFiCmMiImKjChFiCmMjHpB_xHqqkZx_.
	BYTE			m_byAlignment;		// _xZkqqHx_iDeBiDiJiDeDiDjDiDiBiDjDiDgH_xHqqkZx_.
	//----- _xZkqqHx_jAoGjDkKiNhDiBeBiMhAjBlBiNhDiCmFiInJiCmIiCoJjCgMiCpAiOjNiCmCiDiBiDjDiDgPjFmPjAjE_xHqqkZx_ -----
	BYTE			m_byLineType;		// _xZkqqHx_iNhDiCmMiDfOiDeDiDhG_xHqqkZx_(_xZkqqHx_jAoGjDkK_xHqqkZx_/_xZkqqHx_iMhAjBlB_xHqqkZx_)
	//----- _xZkqqHx_iNhDiKnEiKhFiCpAiOhHjCoIiClHiCoJiDiBiDjDiDgPjFmPjAjE_xHqqkZx_ -----
	short			m_nTwipLineAfter;	// _xZkqqHx_iNhDiKnEiBgJiNhDiCmMiJlKiBgKiCmM_xHqqkZx_TWIPS_xZkqqHx_jAjEiBeC_xHqqkZx_
	//----- _xZkqqHx_iNhDiCmMjFlGiOjKiPoOjFpBiCpAiOpLiCnPiCoJiDiBiDjDiDgPjFmPjAjE_xHqqkZx_ -----
	MC2StatCharVector	m_vStatChar;	// _xZkqqHx_jFlGiOjKjHpBiBeC_xHqqkZx_
	//----- _xZkqqHx_iNhDiCmMiNmEiMhGiOfKiCmFjCgMiCkKiOfKiPgPiJmCjEfMiCmIiDiBiDjDiDgPjFmPjAjE_xHqqkZx_ -----
	double			m_mmY;				// _xZkqqHx_iNhDiCmMiPoDiCmMiNmAjFfH_xHqqkZx_.
	float			m_mmfTMHeight;		// _xZkqqHx_jFlGiOjKiCmMiNiCiClD_xHqqkZx_.
	float			m_mmfTMAscent;		// _xZkqqHx_iDhIiBfLiDfIiDiJiDeDiDjDiCkJiCoHiNhDiCmMiPoDiCnMiCmFiCmMiNiCiClD_xHqqkZx_.
	float			m_mmfTMExternalLeading;	// _xZkqqHx_jFlGiOjKiCmMiJlKiCmMiMiEiKnE_xHqqkZx_.
}; // class MC2StatLine.

class MC2StatLineVector : public vector<MC2StatLine>
{
public:
	void	OutStreamV3 (MCARCHIVE& ar) const;
	void	InStreamV2 (MCARCHIVE& ar);
}; // class MC2StatLineVector.

class MC2RichText
{
public:
	/*----- _xZkqqHx_jBfDiCmEiCmM_xHqqkZx_Subclass_xZkqqHx_iCkKiDeDiDjDiDhGiDiKiDiBiDjDiDgHiClFiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkC_xHqqkZx_ -----*/
	MC2RichText ();

	virtual void	OutStreamV3 (MCARCHIVE& ar);
	virtual void	InStreamV2 (MCARCHIVE& ar);
	virtual	~MC2RichText ();

protected:	// _xZkqqHx_iDiBiDjDiDgPjFmPjAjE_xHqqkZx_.
	double	m_mmMarginL;	// _xZkqqHx_iDgFiDeMiDfIiDgHjHmMiIoGiCmMiNlGiDhNiBfLiDfHiDjD_xHqqkZx_.
	double	m_mmMarginT;	// _xZkqqHx_iDgFiDeMiDfIiDgHjHmMiIoGiCmMiPoDiDhNiBfLiDfHiDjD_xHqqkZx_.
	double	m_mmMarginR;	// _xZkqqHx_iDgFiDeMiDfIiDgHjHmMiIoGiCmMiJeFiDhNiBfLiDfHiDjD_xHqqkZx_.
	double	m_mmMarginB;	// _xZkqqHx_iDgFiDeMiDfIiDgHjHmMiIoGiCmMiJlKiDhNiBfLiDfHiDjD_xHqqkZx_.
	DBLRect	m_mmrtText;		// _xZkqqHx_iDgFiDeMiDfIiDgHiCmMiDhEiDiMiBfLiDiAiBeC_xHqqkZx_
	double	m_dAngle;		// _xZkqqHx_iDgFiDeMiDfIiDgHiCmMiKhAjDhIiBeC_xHqqkZx_
	DWORD	m_dwVertAlign;	// _xZkqqHx_jAiCjClMjFpLiMpMiCmMiDeBiDiJiDeDiDjDiDiBiDjDiDgHiBeC_xHqqkZx_
	MC2StatLineVector*	m_vpLine;	// _xZkqqHx_jFlGiOjKjHpBiPoOjFpBiBeC_xHqqkZx_
}; // class MC2RichText.

#endif//__RichText_h
