xref: /haiku/headers/private/storage/mime/SupportingApps.h (revision 51978af14a173e7fae0563b562be5603bc652aeb)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS 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 
19 class BMessage;
20 
21 namespace BPrivate {
22 namespace Storage {
23 namespace Mime {
24 
25 class SupportingApps {
26 public:
27 	SupportingApps();
28 	~SupportingApps();
29 
30 	status_t GetSupportingApps(const char *type, BMessage *apps);
31 
32 	status_t SetSupportedTypes(const char *app, const BMessage *types, bool fullSync);
33 	status_t DeleteSupportedTypes(const char *app, bool fullSync);
34 private:
35 	status_t AddSupportingApp(const char *type, const char *app);
36 	status_t RemoveSupportingApp(const char *type, const char *app);
37 
38 	status_t BuildSupportingAppsTable();
39 
40 	std::map<std::string, std::set<std::string> > fSupportedTypes;	// app sig => set of supported types
41 	std::map<std::string, std::set<std::string> > fSupportingApps;	// mime type => set of supporting apps
42 	std::map<std::string, std::set<std::string> > fStrandedTypes;	// app sig => set of no longer supported types for whom the
43 																	//            given app is still listed as a supporting app
44 	bool fHaveDoneFullBuild;
45 };
46 
47 } // namespace Mime
48 } // namespace Storage
49 } // namespace BPrivate
50 
51 #endif	// _MIME_SUPPORTING_APPS_H
52