/*
 * This file is part of DesktopBSD, see the README file.
 *
 * Author: Pieringer Johannes <jpieringer@desktopbsd.net>
 *         (C) 2006
 *
 * Copyright: BSD, see the COPYING file included in this distribution
 *
 */

#ifndef __GRUBBOOTENTRY_H
#define __GRUBBOOTENTRY_H

#include <qstring.h>
#include <qptrlist.h>

#include "grubcommand.h"

/** @brief One Entry in the GRUB Bootmenu.
  */
class GrubBootentry : public GrubCommand<QString>
{
public:
	/** @brief the operating system
	 */
	enum Ostypes {BSD = 0, Linux = 1, Windows = 2, Mac = 3, Other = 4};

	static const char *OstypesNames[5];

	GrubBootentry(QString value, const QString& comment, const QString& commentAfterCommand);
	QString toString();

	QString* getRoot();
	QString* getKernel();
	QString* getSavedefault();
	QString* getMakeactive();
	QString* getChainloader();
	QString* getInitrd();
	Ostypes getOsType();
	QString getLines();

	void setRoot(QString* root);
	void setKernel(QString* kernel);
	void setSavedefault(QString* savedefault);
	void setMakeactive(QString* makeactive);
	void setChainloader(QString* chainloader);
	void setInitrd(QString* initrd);
	void appendUnknownCommand(const GrubCommand< QString > * command);
	void setOsType(Ostypes type);
	void setLines(QString lines);

	friend class GrubConfiguration;

private:
	GrubCommand<QString> *root;
	GrubCommand<QString> *kernel;
	GrubCommand<QString> *savedefault;
	GrubCommand<QString> *chainloader;
	GrubCommand<QString> *makeactive;
	GrubCommand<QString> *initrd;
	QPtrList<GrubCommand<QString> > unknownCommands;

	Ostypes type;
	QString lines;
};

#endif /* __GRUBBOOTENTRY_H */
