//	Zinc Application Framework - Z_CHART.HPP
//	COPYRIGHT (C) 1990-1999.  All Rights Reserved.
//	Zinc Software Incorporated.  Pleasant Grove, Utah  USA

#ifndef Z_CHART_HPP
#define Z_CHART_HPP

#include <z_win.hpp>

#define ZAF_RANGE_NATURAL   2001 // CF_ID_YVALS_ON_NAT_NS
#define ZAF_RANGE_INTEGER   2002 // CF_ID_YVALS_ON_INT_IS
        
//--------------------------
// Specific Chart Type IDs:
//--------------------------

// Polar Chart IDs:
#define ZAF_PIE_2D            2110	// CF_ID_PIE_2D
                                
// Cartesian Coordinate Chart IDs:
#define ZAF_BAR_2D            3110	// CF_ID_BAR_2D
#define ZAF_COL_2D            3210	// CF_ID_COL_2D
#define ZAF_STACK_2D          3310	// CF_ID_STACK_2D
#define ZAF_POINTS_2D         3410	// CF_ID_POINTS_2D
        // Note that this is a (regular) "point series",
        // NOT a "scatter-plot"!  (Scatter plots will be
        // available via "CF_ID_SCAT" IDs.)
#define ZAF_LINE_2D           3510	// CF_ID_LINE_2D
#define ZAF_AREA_2D           3610	// CF_ID_AREA_2D
#define ZAF_RIBBON_2D         3710	// CF_ID_RIBBON_2D

class ZAF_EXPORT ZafChartStub : public ZafWindowObject
{
public:
	// --- General members ---
	ZafChartStub(int left, int top, int width, int height,
		int iChartTypeID = ZAF_POINTS_2D,
		int iIndexMethodID = ZAF_RANGE_NATURAL);
	ZafChartStub(const ZafChartStub &copy);
	virtual ~ZafChartStub(void);

	// --- Persistence ---
	virtual ZafWindowObject *Duplicate(void);
#if defined(USE_ZAF_PERSISTENCE)
	ZafChartStub(const ZafIChar *name, ZafObjectPersistence &persist);
	static ZafElement *Read(const ZafIChar *name, ZafObjectPersistence &persist);
	virtual void Write(ZafObjectPersistence &persist);
#endif

	// --- Attributes ---
	// get
	ZafLogicalColor AxisColor(ZafLogicalColor *mono = ZAF_NULLP(ZafLogicalColor));
	int ChartType(void) const;
	int IndexMethod(void) const;
	bool MarksXAxis(void) const;
	bool MarksYAxis(void) const;
	const ZafIChar *TextTitle(void);
	const ZafIChar *TextXAxis(void);
	const ZafIChar *TextYAxis(void);
	// set
	virtual ZafLogicalColor SetAxisColor(ZafLogicalColor color, ZafLogicalColor mono = ZAF_MONO_NULL);
	virtual int SetChartType(int chartTypeID);
	virtual int SetIndexMethod(int indexMethodID);
	virtual bool SetMarksXAxis(bool xAxisMarks);
	virtual bool SetMarksYAxis(bool yAxisMarks);
	virtual const ZafIChar *SetTextTitle(const ZafIChar *text);
	virtual const ZafIChar *SetTextXAxis(const ZafIChar *text);
	virtual const ZafIChar *SetTextYAxis(const ZafIChar *text);

	// --- Blocking Functions ---
	virtual bool SetAcceptDrop(bool acceptDrop);
	virtual bool SetChanged(bool changed);
	virtual bool SetCopyDraggable(bool copyDraggable);
	virtual bool SetDisabled(bool disabled);
	virtual bool SetFocus(bool currentFocus);
	virtual const ZafIChar *SetHelpContext(const ZafIChar *helpContext);
	virtual bool SetLinkDraggable(bool linkDraggable);
	virtual bool SetMoveDraggable(bool moveDraggable);
	virtual bool SetNoncurrent(bool noncurrent);

	// --- Window object members ---
	ZafEventType Draw(const ZafEventStruct&, ZafEventType);

	// --- Class identification ---
	static ZafClassID classID;
	static ZafClassNameChar ZAF_FARDATA className[];
	virtual ZafClassID ClassID(void) const { return (classID); }
	virtual ZafClassName ClassName(void) const { return (className); }
	virtual bool IsA(ZafClassID compareID) const;
	virtual bool IsA(ZafClassName compareName) const;

protected:
	ZafLogicalColor axisColor, monoAxisColor;
	int chartType, indexMethod;
	bool marksXAxis, marksYAxis;
	const ZafIChar *textTitle, *textXAxis, *textYAxis;

#if defined(USE_ZAF_PERSISTENCE)
	// --- Persistence ---
	void ReadData(ZafObjectPersistence &persist);
	virtual ZafObjectConstructor ReadFunction(void) { return (ZafChartStub::Read); }
	void WriteData(ZafObjectPersistence &persist);
#endif
};

#endif // Z_CHART_HPP

