/*
 * See the files COPYING and README for copyright information and how to reach
 * the author.
 *
 *  $Id: menuitems.h,v 1.5 2006/04/24 19:43:37 lordjaxom Exp $
 */

#ifndef VDR_BURN_MENUITEMS_H
#define VDR_BURN_MENUITEMS_H

#include "common.h"
#include "jobs.h"
#include <string>
#include <vdr/menuitems.h>

namespace vdr_burn
{

	namespace menu
	{

		// --- track_item -----------------------------------------------------

		class bool_item: public cMenuEditBoolItem
		{
		public:
			bool_item(const std::string& text, int& data):
				cMenuEditBoolItem(text.c_str(), &data) {}
		};

		// --- text_item ------------------------------------------------------

			//XXX dirty hack
		class text_item: public std::string, public cOsdItem
		{
		public:
			text_item(const std::string& text = "", bool selectable = false);
		};

		// --- job ------------------------------------------------------------

		class job_item: public cOsdItem
		{
		public:
			job_item(job* job_, int number, bool done = false);
			
			job* get_job(void) const { return m_job; }

		private:
			job* m_job;
		};

		// --- recording_item -------------------------------------------------

		class recording_item: public cOsdItem
		{
		private:
			const cRecording* m_recording;
			std::string       m_name;
			int               m_total;
			int               m_new;

		public:
			recording_item(const cRecording *recording_, int level);

			void add_entry(bool isNew);

			const std::string& get_name(void) const { return m_name; }
			const cRecording* get_recording(void) const { return m_recording; }
			bool is_directory(void) const { return !m_name.empty(); }
		};


		// --- recording_edit_item --------------------------------------------

		class recording_edit_item: public cMenuEditStrItem
		{
		public:
			recording_edit_item(recording_list::iterator rec);

			recording_list::iterator get_recording(void) const;

		private:
			recording_list::iterator m_recording;
		};

		inline
		recording_list::iterator recording_edit_item::get_recording(void) const
		{
			return m_recording;
		}
	
		// --- speed_edit_item ------------------------------------------------

		class speed_edit_item: public cMenuEditIntItem 
		{
		public:
			speed_edit_item(const std::string& name, int& value);

		protected:
			virtual void Set(void);
		};

	}
}

#endif // VDR_BURN_MENUITEMS_H
