// AsBinaryWildCardsCell.h: interface for the CAsBinaryWildCardsCell class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(_ASBINARYWILDCARDSCELL_H_)
#define _ASBINARYWILDCARDSCELL_H_

#include <vector>
#include "AsBaseCell.h"
#include "cmcmString.h"

using namespace std;

class CAsBinaryWildCardsCell: public CAsBaseCell 
{
public:
	CAsBinaryWildCardsCell();
	virtual ~CAsBinaryWildCardsCell();

	enum enBitStatus {
		enBitStatus_None = 0,
		enBitStatus_Checked,
		enBitStatus_Unchecked,
		enBitStatus_Unknown
	};

	virtual void SetDrawArea(const CRect& drawArea);

	virtual CSize GetMinSize();

	virtual void Draw(CDC* pDC);

	virtual bool HitTest(const CPoint& pt);

	virtual void SetBinarycmString(const cmString& checkedText, bool redraw = true);
	virtual cmString GetBinarycmString() const;

	virtual void SetValue(long value, bool redraw = true);
	virtual long GetValue() const;

	virtual bool ProcessMessage(DWORD msg, DWORD lParam, DWORD wParam, const CPoint& pt, const CRect& parentRect, bool& needRedraw);

	virtual void KillFocus(bool storeData = true, bool redraw = true);
	virtual void SetFocus(bool redraw = true);

	virtual void SetBitCount(long bitCount);
	virtual long GetBitCount() const;

	virtual void SetReadOnly(bool readOnly);
	virtual bool IsReadOnly() const;

	virtual void SetBitStatus(long bitIndex, enBitStatus status, bool redraw = true);
	virtual enBitStatus GetBitStatus(long bitIndex) const;

protected:

	cmString binarycmString_;
	long value_;

	vector<CRect> bitRect_;
	vector<enBitStatus> bitStatus_;
	bool readOnly_;
	long bitCount_;

};

#endif // !defined(_ASBINARYWILDCARDSCELL_H_)