/*
 * 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 __PORTSCLEANENGINE_H
#define __PORTSCLEANENGINE_H

class QString;
class UnixProcess;

/**
  * @brief Clean ports/packages garbage.
  *
  * This class creates a QProcess that uses the
  * portsclean utility and it's options.
  *
  * The portupgrade suite must be installed for this.
  * Commands like [-PP] indicate the corresponding
  * portsclean(1) switch.
  */
class PortsCleanEngine {
public:
	enum CleanFlags {
		DistCleanNotReferenced = 0x02,
		DistCleanNotInstalled = 0x04,
		LibClean = 0x08,
		PkgCleanOutdated = 0x10,
		PkgCleanAll = 0x20,
		WorkClean = 0x40
	};

	static UnixProcess * getProcess(int);

	static UnixProcess * getRemoveAllPkgsProcess();
	static UnixProcess * getRemoveAllDistfilesProcess();

protected:
	static UnixProcess * getRemoveDirProcess(const QString &);
};

#endif /* __PORTSCLEANENGINE_H */
