xref: /haiku/headers/private/app/LaunchRoster.h (revision d94e9c97d269f47313d5134d0d90a62dd9428dae)
1 /*
2  * Copyright 2015 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _LAUNCH_ROSTER_H
6 #define _LAUNCH_ROSTER_H
7 
8 
9 #include <Messenger.h>
10 
11 
12 class BLaunchRoster {
13 public:
14 								BLaunchRoster();
15 								~BLaunchRoster();
16 
17 			status_t			InitCheck() const;
18 
19 			status_t			GetData(BMessage& data);
20 			status_t			GetData(const char* signature, BMessage& data);
21 			port_id				GetPort(const char* name = NULL);
22 			port_id				GetPort(const char* signature,
23 									const char* name);
24 
25 			status_t			Target(const char* name, const BMessage& data,
26 									const char* baseName = NULL);
27 			status_t			Target(const char* name,
28 									const BMessage* data = NULL,
29 									const char* baseName = NULL);
30 
31 			status_t			StartSession(const char* login);
32 
33 			status_t			RegisterEvent(const BMessenger& source,
34 									const char* name);
35 			status_t			UnregisterEvent(const BMessenger& source,
36 									const char* name);
37 			status_t			NotifyEvent(const BMessenger& source,
38 									const char* name);
39 
40 	class Private;
41 
42 private:
43 	friend class Private;
44 
45 			void				_InitMessenger();
46 			status_t			_UpdateEvent(uint32 what,
47 									const BMessenger& source, const char* name);
48 
49 private:
50 			BMessenger			fMessenger;
51 			uint32				_reserved[5];
52 };
53 
54 // global BLaunchRoster instance
55 extern const BLaunchRoster* be_launch_roster;
56 
57 
58 #endif	// _LAUNCH_ROSTER_H
59