1/*
2 * Copyright 2010, Haiku.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Clemens Zeidler <haiku@clemens-zeidler.de>
7 */
8#ifndef ANALYSER_DISPATCHER
9#define ANALYSER_DISPATCHER
10
11
12#include <Looper.h>
13#include <String.h>
14
15#include "IndexServerAddOn.h"
16
17
18class FileAnalyser;
19
20
21class AnalyserDispatcher : public BLooper {
22public:
23								AnalyserDispatcher(const char* name);
24								~AnalyserDispatcher();
25
26			void				Stop();
27			bool				Stopped();
28
29			bool				Busy();
30
31			void				AnalyseEntry(const entry_ref& ref);
32			void				DeleteEntry(const entry_ref& ref);
33			void				MoveEntry(const entry_ref& oldRef,
34									const entry_ref& newRef);
35			void				LastEntry();
36
37			//! thread safe
38			bool				AddAnalyser(FileAnalyser* analyser);
39			bool				RemoveAnalyser(const BString& name);
40
41			void				WriteAnalyserSettings();
42			void				SetSyncPosition(bigtime_t time);
43			void				SetWatchingStart(bigtime_t time);
44			void				SetWatchingPosition(bigtime_t time);
45
46protected:
47			FileAnalyserList	fFileAnalyserList;
48
49private:
50			FileAnalyser*		_FindAnalyser(const BString& name);
51
52			int32				fStopped;
53};
54
55#endif // ANALYSER_DISPATCHER
56