xref: /haiku/src/servers/registrar/mime/MimeUpdateThread.h (revision 893988af824e65e49e55f517b157db8386e8002b)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //---------------------------------------------------------------------
5 /*!
6 	\file MimeUpdateThread.h
7 	MimeUpdateThread interface declaration
8 */
9 
10 #ifndef _MIME_UPDATE_THREAD_H
11 #define _MIME_UPDATE_THREAD_H
12 
13 #include <Entry.h>
14 #include <SupportDefs.h>
15 
16 #include <list>
17 #include <utility>
18 
19 #include "RegistrarThread.h"
20 
21 struct entry_ref;
22 class BMessage;
23 
24 namespace BPrivate {
25 namespace Storage {
26 namespace Mime {
27 
28 class Database;
29 
30 class MimeUpdateThread : public RegistrarThread {
31 public:
32 	MimeUpdateThread(const char *name, int32 priority, Database *database,
33 		BMessenger managerMessenger, const entry_ref *root, bool recursive,
34 		int32 force, BMessage *replyee);
35 	virtual ~MimeUpdateThread();
36 
37 	virtual status_t InitCheck();
38 
39 protected:
40 	virtual status_t ThreadFunction();
41 	virtual status_t DoMimeUpdate(const entry_ref *entry, bool *entryIsDir) = 0;
42 
43 	Database* fDatabase;
44 	const entry_ref fRoot;
45 	const bool fRecursive;
46 	const int32 fForce;
47 	BMessage *fReplyee;
48 
49 	bool DeviceSupportsAttributes(dev_t device);
50 
51 private:
52 	std::list< std::pair<dev_t, bool> > fAttributeSupportList;
53 
54 	status_t UpdateEntry(const entry_ref *ref);
55 
56 	status_t fStatus;
57 };
58 
59 }	// namespace Mime
60 }	// namespace Storage
61 }	// namespace BPrivate
62 
63 #endif	// _MIME_UPDATE_THREAD_H
64