/*
 * functhread.h: Functions Thread
 *
 */

#ifndef _FUNCTHREAD__H
#define _FUNCTHREAD__H

#include <vdr/plugin.h>
#include "global.h"

class cFuncThread : public cThread
{
private:
    char *m_sFromFile;
    char *m_sToFile;
    int  m_iProgressBarVal;
    int  m_iFunction;
    int  *m_piReturn;
 cOsd *pOSD; // OSD Object

protected:
    virtual void Action(void);
    bool Copy_File_File(char *sSrc, char *sDest);
 bool Copy_Dir_Dir(char *sSrc, char *sDest);
    char *MakeFileWithPath(char *sPath, char *sFile);
    bool Erase_Recursive(char* sPath);
    void ProgressBar(int Current, int Total);
    void SetReturn(int iValue = -1);

public:
    enum
    {
	func_copy_file,
	func_delete_file,
	func_copy_dir,
	func_delete_dir
 };

 cFuncThread(cOsd *pStatusOSD, const char *sFromFile, const char *sToFile, int iFunction, int *piReturn = NULL);
    virtual ~cFuncThread();
};

#endif //_FUNCTHREAD__H