1/*
2 * Copyright 2013, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Ingo Weinhold <ingo_weinhold@gmx.de>
7 */
8#ifndef _REMOVE_ENGINE_H
9#define _REMOVE_ENGINE_H
10
11
12#include <stdarg.h>
13
14#include <EntryOperationEngineBase.h>
15
16
17namespace BPrivate {
18
19
20class BRemoveEngine : public BEntryOperationEngineBase {
21public:
22			class BController;
23
24public:
25								BRemoveEngine();
26								~BRemoveEngine();
27
28			BController*		Controller() const;
29			void				SetController(BController* controller);
30
31			status_t			RemoveEntry(const Entry& entry);
32
33private:
34			status_t			_RemoveEntry(const char* path);
35
36			void				_NotifyErrorVarArgs(status_t error,
37									const char* format, va_list args);
38			status_t			_HandleEntryError(const char* path,
39									status_t error, const char* format, ...);
40
41private:
42			BController*		fController;
43};
44
45
46class BRemoveEngine::BController {
47public:
48								BController();
49	virtual						~BController();
50
51	virtual	bool				EntryStarted(const char* path);
52	virtual	bool				EntryFinished(const char* path, status_t error);
53
54	virtual	void				ErrorOccurred(const char* message,
55									status_t error);
56};
57
58
59} // namespace BPrivate
60
61
62using ::BPrivate::BRemoveEngine;
63
64
65#endif	// _REMOVE_ENGINE_H
66