SupportingApps.h revision b6f76ebe
1//----------------------------------------------------------------------
2//  This software is part of the OpenBeOS distribution and is covered
3//  by the MIT License.
4//---------------------------------------------------------------------
5/*!
6	\file SupportingApps.h
7	SupportingApps class declarations
8*/
9
10#ifndef _MIME_SUPPORTING_APPS_H
11#define _MIME_SUPPORTING_APPS_H
12
13#include <SupportDefs.h>
14
15#include <map>
16#include <set>
17#include <string>
18
19class BMessage;
20
21namespace BPrivate {
22namespace Storage {
23namespace Mime {
24
25
26class DatabaseLocation;
27
28
29class SupportingApps {
30public:
31	SupportingApps(DatabaseLocation* databaseLocation);
32	~SupportingApps();
33
34	status_t GetSupportingApps(const char *type, BMessage *apps);
35
36	status_t SetSupportedTypes(const char *app, const BMessage *types, bool fullSync);
37	status_t DeleteSupportedTypes(const char *app, bool fullSync);
38private:
39	status_t AddSupportingApp(const char *type, const char *app);
40	status_t RemoveSupportingApp(const char *type, const char *app);
41
42	status_t BuildSupportingAppsTable();
43
44	std::map<std::string, std::set<std::string> > fSupportedTypes;	// app sig => set of supported types
45	std::map<std::string, std::set<std::string> > fSupportingApps;	// mime type => set of supporting apps
46	std::map<std::string, std::set<std::string> > fStrandedTypes;	// app sig => set of no longer supported types for whom the
47																	//            given app is still listed as a supporting app
48
49private:
50	DatabaseLocation* fDatabaseLocation;
51	bool fHaveDoneFullBuild;
52};
53
54} // namespace Mime
55} // namespace Storage
56} // namespace BPrivate
57
58#endif	// _MIME_SUPPORTING_APPS_H
59