/*
 * This file is part of DesktopBSD, see the README file.
 *
 * Author: Peter Hofer <ph@desktopbsd.net>
 *         (C) 2004, 2005
 *
 * Copyright: BSD, see the COPYING file included in this distribution
 *
 */

#ifndef __PKGDBUPDATEENGINE_H
#define __PKGDBUPDATEENGINE_H

class UnixProcess;

/** @brief Updates the package database (default: /var/db/pkg)
  *
  * In detail, this creates a QProcess that updates the
  * package registry database (pkgdb from the portupgrade suite).
  *
  * The default is to only update the pkgdb.
  *
  * Comments like [-F] show the options passed
  * to pkgdb(1).
  */
class PkgDBUpdateEngine{
public:
	enum FixMethod {
		None,			/**< [default] */
		AutoFix,		/**< [-aF]		*/
		Interactive	/**< [-F]		*/
	};

	PkgDBUpdateEngine();

	UnixProcess *getProcess();


	/** Sets whether the pkgdb should be upgraded or not. */
	void	setUpdate(bool b) { update = b; }


	/** Sets how the pkgdb should be fixed.
	  * @see FixMethod
	  */
	void	setFixMethod(FixMethod m) { fixMethod = m; }

private:
	bool update;
	FixMethod fixMethod;
};

#endif /* __PKGDBUPDATEENGINE_H */
