xref: /haiku/headers/private/app/LaunchRoster.h (revision 3282b758b0b9c0f46959b51efbc1f39f47138105)
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 // Flags for RegisterEvent()
13 enum {
14 	B_STICKY_EVENT	= 0x01
15 };
16 
17 
18 class BLaunchRoster {
19 public:
20 								BLaunchRoster();
21 								~BLaunchRoster();
22 
23 			status_t			InitCheck() const;
24 
25 			status_t			GetData(BMessage& data);
26 			status_t			GetData(const char* signature, BMessage& data);
27 			port_id				GetPort(const char* name = NULL);
28 			port_id				GetPort(const char* signature,
29 									const char* name);
30 
31 			status_t			Target(const char* name, const BMessage& data,
32 									const char* baseName = NULL);
33 			status_t			Target(const char* name,
34 									const BMessage* data = NULL,
35 									const char* baseName = NULL);
36 
37 			status_t			StartSession(const char* login);
38 
39 			status_t			RegisterEvent(const BMessenger& source,
40 									const char* name, uint32 flags);
41 			status_t			UnregisterEvent(const BMessenger& source,
42 									const char* name);
43 			status_t			NotifyEvent(const BMessenger& source,
44 									const char* name);
45 			status_t			ResetStickyEvent(const BMessenger& source,
46 									const char* name);
47 
48 			status_t			GetTargets(BStringList& targets);
49 			status_t			GetTargetInfo(const char* name, BMessage& info);
50 			status_t			GetJobs(const char* target, BStringList& jobs);
51 			status_t			GetJobInfo(const char* name, BMessage& info);
52 
53 	class Private;
54 
55 private:
56 	friend class Private;
57 
58 			void				_InitMessenger();
59 			status_t			_UpdateEvent(uint32 what,
60 									const BMessenger& source, const char* name,
61 									uint32 flags = 0);
62 			status_t			_GetInfo(uint32 what, const char* name,
63 									BMessage& info);
64 
65 private:
66 			BMessenger			fMessenger;
67 			uint32				_reserved[5];
68 };
69 
70 
71 #endif	// _LAUNCH_ROSTER_H
72