
#define aplDaySpanSplitter APL_T("дн.")

class CSortClass
{
public:
	CSortClass(CListCtrl * _pWnd, const int _iCol, const int _bIsNumeric);
	//CSortClass(CListCtrl * _pWnd, const int _iCol, const bool _bIsNumeric, int iStartingItem, int iEndingItem );
	virtual ~CSortClass();		
	
	int iCol;	
	int m_iStartingItem;
	int m_iEndingItem;

	CListCtrl * pWnd;	
	int bIsNumeric;
	
	void Sort(const bool bAsc);	
	
	static int CALLBACK CompareAsc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
	static int CALLBACK CompareDes(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);

	static int CALLBACK CompareAscR(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
	static int CALLBACK CompareDesR(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);

	static int CALLBACK CompareAscD(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
	static int CALLBACK CompareDesD(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);

	static int CALLBACK CompareAscDT(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
	static int CALLBACK CompareDesDT(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
	
	static int CALLBACK CompareAscT(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
	static int CALLBACK CompareDesT(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);

	static int CALLBACK CompareAscDTS(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
	static int CALLBACK CompareDesDTS(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);

public:	
	class CSortItem	
	{	
		public:		
			virtual  ~CSortItem();
			CSortItem(const DWORD _dw, const CString &_txt);		
			CString txt;		
			DWORD dw;	
	};
	class CSortItemReal	
	{	
		public:
			CSortItemReal(const DWORD _dw, const CString &_txt);		
			double dVal ;		
			DWORD dw;	
	};
	class CSortItemDate	
	{	
		public:
			CSortItemDate(const DWORD _dw, const CString &_txt);		
			int iInt ;		
			COleDateTime dt;	
			DWORD dw;	
	};
	class CSortItemDateTime	
	{	
		public:
			CSortItemDateTime(const DWORD _dw, const CString &_txt);		
			int iInt ;		
			COleDateTime dt;	
			DWORD dw;	
	};
	class CSortItemTime	
	{	
	public:
		CSortItemTime(const DWORD _dw, const CString &_txt);
		int iH ;
		int iM ;
		DWORD dw;	
	};
	class CSortItemDateTimeSpan
	{
	public:
		CSortItemDateTimeSpan(const DWORD _dw, const CString &_txt);
		COleDateTimeSpan dt;
		DWORD dw;
	};
};