/*************************************************************************\
* "$RCSfile: CZoomFactor.hpp,v $"                                         *
***************************************************************************
* Information by CVS or VSS:                                              *
*     Last check in on: $Date: 2010/06/16 10:16:53 $                      *
*     by                $Author: schluckebier $
*     Revision        : $Revision: 1.6 $                                  *
\*************************************************************************/
/*! \file CZoomFactor.hpp
*	\brief Header CZoomFactor Class
**************************************************************************/

/*************************************************************************/
/*! @brief CZoomFactor class

	Handles a double linked list of zoom factor values and names.
**************************************************************************/
class CZoomFactor
{
public:
	CZoomFactor();
	~CZoomFactor();
	const char *GetName() const;
	double GetValue() const;
	int Set(double dVal);
	int Up();
	int Down();
	void Init(int PvWidth, int PvHeight, int CamWidth, int CamHeight);

protected:
	//! Contains one element of the list
	struct ZOOMFACTOR
	{
		double Value;
		char Name[20];
		ZOOMFACTOR *pNext;
		ZOOMFACTOR *pPrev;
	};

	int Sort();
	int ClearLower(double dVal);
	void ClearEquals();
	int Exchange(ZOOMFACTOR *pOne, ZOOMFACTOR *pTwo);
	void Add(double dValue, const char *pName);
	int Delete();
	int Delete(double dVal);

	//! Sets the current zoom factor to first list element.
	void SetFirst() { m_pCur = m_pFirst; }
	//! Sets the current zoom factor to last list element.
	void SetLast() { m_pCur = m_pLast; }

	int m_Count;
	ZOOMFACTOR *m_pCur;
	ZOOMFACTOR *m_pLast;
	ZOOMFACTOR *m_pFirst;
};

/*************************************************************************/
