1/*
2 * Copyright 2001-2014 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Axel D��rfler, axeld@pinc-software.de
7 *		John Scipione, jscipione@gmail.com
8 *		Ingo Weinhold, ingo_weinhold@gmx.de
9 *
10 * Corresponds to:
11 *		headers/os/app/Roster.h	hrev47355
12 *		src/kits/app/Roster.cpp	hrev47355
13 */
14
15
16/*!
17	\file Roster.h
18	\ingroup app
19	\ingroup libbe
20	\brief Provides the app_info struct, the BRoster class and the
21	       #be_roster global.
22*/
23
24
25/*!
26	\def B_SINGLE_LAUNCH
27	\brief Similar to B_EXCLUSIVE_LAUNCH, with the exception that it is per file location,
28	copying the file to a second location therefore allows the application to be started a second time.
29
30	Attempts to launch the same application from the same path again will result in a B_ARGV_RECEIVED or
31	B_REFS_RECEIVED message delivered to the existing instance. The application should take care of handling
32	these messages correctly. Applications which can't or don't want to handle this should use
33	B_MULTIPLE_LAUNCH instead.
34	
35	This flag only ensures exclusive launches when started via BRoster, launching an application in another
36	way, for example with fork+exec will allow the application to run a second time. This should not be
37	relied on for applications that need to run exclusively in all cases.
38	\since BeOS R3
39*/
40
41
42/*!
43	\def B_MULTIPLE_LAUNCH
44	\brief There are no restrictions on how many times this application can be opened.
45
46	\since BeOS R3
47*/
48
49
50/*!
51	\def B_EXCLUSIVE_LAUNCH
52	\brief This will make the registrar ensure only one application with this application signature is
53	running at any given time.
54
55	Attempts to launch the same application again will result in a B_ARGV_RECEIVED or B_REFS_RECEIVED message
56	delivered to the existing instance. The application should take care of handling these messages
57	correctly. Applications which can't or don't want to handle this should use B_MULTIPLE_LAUNCH instead.
58	
59	This flag only ensures exclusive launches when started via BRoster, launching an application in another
60	way, for example with fork+exec will allow the application to run a second time. This should not be
61	relied on for applications that need to run exclusively in all cases.
62	\since BeOS R3
63*/
64
65
66/*!
67	\def B_LAUNCH_MASK
68	\brief Bitwise and this with app_info::flags to get at the flags above.
69
70	\since BeOS R3
71*/
72
73
74/*!
75	\def B_BACKGROUND_APP
76	\brief This is intended for background executables, these are hidden from the Deskbar. They also receive
77	 less lenience when the system shuts down.
78
79	\since BeOS R3
80*/
81
82
83/*!
84	\def B_ARGV_ONLY
85	\brief The application can't receive messages, information must be
86	       passed at launch through argv, typically from the command line.
87
88	\warning B_ARGV_ONLY Is never intended for GUI Applications.
89	Executables marked with this flag will be killed on shutdown.
90	BMessages are absolutely required for correct operation of GUI applications on Haiku.
91	
92	Using this flag with B_EXCLUSIVE_LAUNCH and B_SINGLE_LAUNCH will prevent the application
93	from correctly getting the messages about subsequent launch requests!
94	\since BeOS R3
95*/
96
97
98/*!
99	\def _B_APP_INFO_RESERVED1_
100	\brief Reserved for future use, do not use.
101*/
102
103
104/*!
105	\var B_REQUEST_LAUNCHED
106	\brief \c B_SOME_APP_LAUNCHED
107
108	\since BeOS R3
109*/
110
111
112/*!
113	\var B_REQUEST_QUIT
114	\brief \c B_SOME_APP_QUIT
115
116	\since BeOS R3
117*/
118
119
120/*!
121	\var B_REQUEST_ACTIVATED
122	\brief \c B_SOME_APP_ACTIVATED
123
124	\since BeOS R3
125*/
126
127
128/*!
129	\struct app_info
130	\ingroup app
131	\ingroup libbe
132	\brief Provides info for a running app.
133
134	\since BeOS R3
135*/
136
137
138/*!
139	\fn app_info::app_info()
140	\brief Creates an uninitialized app_info.
141
142	\since BeOS R3
143*/
144
145
146/*!
147	\fn app_info::~app_info()
148	\brief Does nothing.
149
150	\since BeOS R3
151*/
152
153
154/*!
155	\var app_info::thread
156	\brief The main thread id or -1 if the application isn't running.
157
158	\since BeOS R3
159*/
160
161
162/*!
163	\var app_info::team
164	\brief The team id or -1 if the application isn't running.
165
166	\since BeOS R3
167*/
168
169
170/*!
171	\var app_info::port
172	\brief The main thread port, or -1 if the application isn't running.
173
174	\since BeOS R3
175*/
176
177
178/*!
179	\var app_info::flags
180	\brief Mask of flags that determine the behavior of the application.
181
182	\since BeOS R3
183*/
184
185
186/*!
187	\var app_info::ref
188	\brief A file ref that was executed to run the application.
189
190	\since BeOS R3
191*/
192
193
194/*!
195	\var app_info::signature[]
196	\brief The signature that uniquely identifies the application.
197*/
198
199
200/*!
201	\var be_roster
202	\brief Represents the default BRoster.
203*/
204
205
206/*!
207	\class BRoster
208	\ingroup app
209	\ingroup libbe
210	\brief The BRoster class lets you launch apps and keeps track of apps
211	       that are running.
212
213	The global #be_roster object represents the default BRoster, while the
214	app_info structure provides info for a running app.
215
216	\since BeOS R3
217*/
218
219
220/*!
221	\fn BRoster::BRoster()
222	\brief Creates a new BRoster and sets up the connection to the roster
223	       service.
224
225	You should not need to call this, use the #be_roster global instead.
226
227	\since BeOS R3
228*/
229
230
231/*!
232	\fn BRoster::~BRoster()
233	\brief Does nothing.
234
235	\since BeOS R3
236*/
237
238
239/*!
240	\name Querying
241*/
242
243
244//! @{
245
246
247/*!
248	\fn bool BRoster::IsRunning(const char* signature) const
249	\brief Returns whether or not an application with the supplied signature
250	       is currently running.
251
252	\param signature The app \a signature.
253
254	\return \c true, if the supplied \a signature is not \c NULL and an
255	        application with this \a signature is running, \c false otherwise.
256
257	\since BeOS R3
258*/
259
260
261/*!
262	\fn bool BRoster::IsRunning(entry_ref* ref) const
263	\brief Returns whether or not an application ran from an executable
264	       referred to by the supplied entry_ref is currently running.
265
266	\param ref The app's entry_ref
267	\return \c true, if the supplied entry_ref is not \c NULL and an
268	        application executing this file is running, \c false otherwise.
269
270	\since BeOS R3
271*/
272
273
274/*!
275	\fn team_id BRoster::TeamFor(const char* signature) const
276	\brief Returns the team ID of a currently running application with the
277	       supplied \a signature.
278
279	\param signature The app \a signature.
280
281	\return The team ID of a running application with the supplied \a signature.
282	\retval B_BAD_VALUE \a signature is \c NULL.
283	\retval B_ERROR No application with the supplied \a signature is currently
284	        running.
285
286	\since BeOS R3
287*/
288
289
290/*!
291	\fn team_id BRoster::TeamFor(entry_ref* ref) const
292	\brief Returns the team ID of a currently running application executing
293	       the executable referred to by the supplied entry_ref.
294
295	\param ref The app's entry_ref
296
297	\return The team ID of a running application executing the file referred
298	        to by \a ref.
299	\retval B_BAD_VALUE \a ref is \c NULL.
300	\retval B_ERROR No application executing the file referred to by \a ref is
301	        currently running.
302
303	\since BeOS R3
304*/
305
306
307/*!
308	\fn void BRoster::GetAppList(BList* teamIDList) const
309	\brief Returns a list of all currently running applications.
310
311	The supplied list is not emptied before adding the team IDs of the
312	running applications. The list elements are team_id's, not pointers.
313
314	\param teamIDList A pointer to a pre-allocated BList to be filled with
315		   the team IDs.
316
317	\since BeOS R3
318*/
319
320
321/*!
322	\fn void BRoster::GetAppList(const char* signature,
323		BList* teamIDList) const
324	\brief Returns a list of all currently running applications with the
325	       specified \a signature.
326
327	The supplied list is not emptied before adding the team IDs of the
328	running applications. The list elements are team_id's, not pointers.
329	If \a sig is \c NULL or invalid, no team IDs are added to the list.
330
331	\param signature The application \a signature.
332	\param teamIDList A pointer to a pre-allocated BList to be filled with
333	       the team IDs.
334
335	\since BeOS R3
336*/
337
338
339/*!
340	\fn status_t BRoster::GetAppInfo(const char* signature,
341		app_info* info) const
342	\brief Returns the app_info of a currently running application with the
343	       supplied \a signature.
344
345	\param signature The application \a signature.
346	\param info A pointer to a pre-allocated app_info structure to be filled
347		   by this method.
348
349	\return A status code.
350	\retval B_OK: Everything went fine.
351	\retval B_BAD_VALUE \a sig is \c NULL.
352	\retval B_ERROR No application with the supplied signature is currently
353	        running.
354
355	\since BeOS R3
356*/
357
358
359/*!
360	\fn status_t BRoster::GetAppInfo(entry_ref* ref, app_info* info) const
361	\brief Returns the app_info of a currently running application executing
362	       the executable referred to by the supplied entry_ref.
363
364	\param ref The app's entry_ref
365	\param info A pointer to a pre-allocated app_info structure to be filled
366		   in by this method.
367
368	\return A status code.
369	\retval B_OK Everything went fine.
370	\retval B_BAD_VALUE \a ref is \c NULL.
371	\retval B_ERROR No application executing the file referred to by \a ref was
372	        currently running.
373
374	\since BeOS R3
375*/
376
377
378/*!
379	\fn status_t BRoster::GetRunningAppInfo(team_id team, app_info* info) const
380	\brief Returns the app_info of a currently running application identified
381		   by the supplied team ID.
382
383	\param team The app's team ID.
384	\param info A pointer to a pre-allocated app_info structure to be filled
385		   in by this method.
386
387	\return A status code.
388	\retval B_OK Everything went fine.
389	\retval B_BAD_VALUE \a info was \c NULL.
390	\retval B_BAD_TEAM_ID \a team did not identify a running application.
391
392	\since BeOS R3
393*/
394
395
396/*!
397	\fn status_t BRoster::GetActiveAppInfo(app_info* info) const
398	\brief Returns the app_info of a currently active application.
399
400	\param info A pointer to a pre-allocated app_info structure to be filled
401	       in by this method.
402
403	\return A status code.
404	\retval B_OK Everything went fine.
405	\retval B_BAD_VALUE \a info was \c NULL.
406	\retval B_ERROR No application was currently active.
407
408	\since BeOS R3
409*/
410
411
412/*!
413	\fn status_t BRoster::GetActiveAppInfo(app_info* info) const
414	\brief Returns the app_info of a currently active application.
415
416	\param info A pointer to a pre-allocated app_info structure to be filled
417		   in by this method.
418
419	\return A status code.
420	\retval B_OK Everything went fine.
421	\retval B_BAD_VALUE \a info was \c NULL.
422	\retval B_ERROR No application was currently active.
423
424	\since BeOS R3
425*/
426
427
428/*!
429	\fn status_t BRoster::FindApp(const char* mimeType, entry_ref* app) const
430	\brief Finds an application associated with a MIME type.
431
432	The method gets the signature of the supplied type's preferred application
433	and the signature of the super type's preferred application. It will also
434	get all supporting applications for the type and super type and build a
435	list of candiate handlers. In the case that a preferred handler is
436	configured for the sub-type, other supporting apps will be inserted in the
437	candidate list before the super-type preferred and supporting handlers,
438	since it is assumed that the super type handlers are not well suited for
439	the sub-type. The following resolving algorithm is performed on each
440	signature of the resulting list:
441	The MIME database is asked which executable is associated with the
442	signature. If the database doesn't have a reference to an exectuable, the
443	boot volume is queried for a file with the signature. If more than one file
444	has been found, the one with the greatest version is picked, or if no file
445	has a version info, the one with the most recent modification date. The
446	first application from the signature list which can be successfully
447	resolved by this algorithm is returned. Contrary to BeOS behavior, this
448	means that if the preferred application of the provided MIME type cannot
449	be resolved, or if it does not have a preferred application associated,
450	the method will return other applications with direct support for the MIME
451	type before it resorts to the preferred application or supporting
452	applications of the super type.
453
454	\param mimeType The MIME type for which an application shall be found.
455	\param app A pointer to a pre-allocated entry_ref to be filled with
456	       a reference to the found application's executable.
457
458	\return A status code.
459	\retval B_OK Everything went fine.
460	\retval B_BAD_VALUE \c NULL \a mimeType or \a app.
461	\retval B_LAUNCH_FAILED_NO_PREFERRED_APP Neither with the supplied type nor
462	        with its supertype (if the supplied isn't a supertype itself) a
463	        preferred application is associated and no other supporting
464	        applications could be identified.
465	\retval B_LAUNCH_FAILED_APP_NOT_FOUND: The supplied type was not installed or
466	        its preferred application could not be found.
467	\retval B_LAUNCH_FAILED_APP_IN_TRASH: The supplied type's only supporting
468	        application was in the trash.
469
470	\since BeOS R3
471*/
472
473
474/*!
475	\fn status_t BRoster::FindApp(entry_ref* ref, entry_ref* app) const
476	\brief Finds an application associated with a file.
477
478	The method first checks, if the file has a preferred application
479	associated with it (see BNodeInfo::GetPreferredApp()) and if so,
480	tries to find the executable the same way FindApp(const char*, entry_ref*)
481	does. If not, it gets the MIME type of the file and searches an
482	application for it exactly like the first FindApp() method.
483
484	The type of the file is defined in a file attribute (BNodeInfo::GetType()),
485	but if it is not set yet, the method tries to guess it via
486	BMimeType::GuessMimeType().
487
488	As a special case the file may have execute permission. Then preferred
489	application and type are ignored and an entry_ref to the file itself is
490	returned.
491
492	\param ref An entry_ref referring to the file for which an application
493		   shall be found.
494	\param app A pointer to a pre-allocated entry_ref to be filled with
495		   a reference to the found application's executable.
496	\return
497	\retval B_OK Everything went fine.
498	\retval B_BAD_VALUE \c NULL \a mimeType or \a app.
499	\retval B_LAUNCH_FAILED_NO_PREFERRED_APP Neither with the supplied type nor
500	        with its supertype (if the supplied isn't a supertype itself) a
501	        preferred application is associated.
502	\retval B_LAUNCH_FAILED_APP_NOT_FOUND: The supplied type was not installed or
503	        its preferred application could not be found.
504	\retval B_LAUNCH_FAILED_APP_IN_TRASH: The supplied type's preferred
505	        application was in the trash.
506
507	\since BeOS R3
508*/
509
510
511//! @}
512
513
514/*!
515	\name Launching, Activating, and Broadcasting
516*/
517
518
519//! @{
520
521
522/*!
523	\fn status_t BRoster::Broadcast(BMessage* message) const
524	\brief Sends a message to all running applications.
525
526	The methods doesn't broadcast the message itself, but it asks the roster
527	to do so. It immediatly returns after sending the request. The return
528	value only tells about whether the request has successfully been sent.
529
530	The message is sent asynchronously. Replies to it go to the application.
531	(\c be_app_messenger).
532
533	\param message The message to be broadcast.
534
535	\return A status code.
536	\retval B_OK Everything went fine.
537	\retval B_BAD_VALUE \c NULL \a message.
538
539	\since BeOS R3
540*/
541
542
543/*!
544	\fn status_t BRoster::Broadcast(BMessage* message, BMessenger replyTo) const
545	\brief Sends a message to all running applications.
546
547	The methods doesn't broadcast the message itself, but it asks the roster
548	to do so. It immediatly returns after sending the request. The return
549	value only tells about whether the request has successfully been sent.
550
551	The message is sent asynchronously. Replies to it go to the specified
552	target (\a replyTo).
553
554	\param message The message to be broadcast.
555	\param replyTo Reply target for the message.
556
557	\return A status code.
558	\retval B_OK: Everything went fine.
559	\retval B_BAD_VALUE: \c NULL \a message.
560
561	\since BeOS R4
562*/
563
564
565/*!
566	\fn status_t BRoster::StartWatching(BMessenger target, uint32 eventMask) const
567	\brief Adds a new roster application monitor.
568
569	After StartWatching() event messages will be sent to the supplied target
570	according to the specified flags until a respective StopWatching() call.
571
572	\a eventMask must be a bitwise OR of one or more of the following flags:
573	- \c B_REQUEST_LAUNCHED: A \c B_SOME_APP_LAUNCHED is sent, whenever an
574	  application has been launched.
575	- \c B_REQUEST_QUIT: A \c B_SOME_APP_QUIT is sent, whenever an
576	  application has quit.
577	- \c B_REQUEST_ACTIVATED: A \c B_SOME_APP_ACTIVATED is sent, whenever an
578	  application has been activated.
579
580	All event messages contain the following fields supplying more information
581	about the concerned application:
582	- \c "be:signature", \c B_STRING_TYPE: The signature of the application.
583	- \c "be:team", \c B_INT32_TYPE: The team ID of the application
584	  (\c team_id).
585	- \c "be:thread", \c B_INT32_TYPE: The ID of the application's main thread
586	  (\c thread_id).
587	- \c "be:flags", \c B_INT32_TYPE: The application flags (\c uint32).
588	- \c "be:ref", \c B_REF_TYPE: An entry_ref referring to the application's
589	  executable.
590
591	A second call to StartWatching() with the same \a target simply sets
592	the new \a eventMask. The messages won't be sent twice to the target.
593
594	\param target The target the event messages shall be sent to.
595	\param eventMask Specifies the events the caller is interested in.
596
597	\return \c B_OK if everything went fine or an error code, if some error
598	        occurred.
599
600	\since BeOS R4
601*/
602
603
604/*!
605	\fn status_t BRoster::StopWatching(BMessenger target) const
606	\brief Removes a roster application monitor added with StartWatching().
607
608	\param target The target that shall not longer receive any event messages.
609
610	\return A status code.
611	\retval B_OK Everything went fine.
612	\retval B_BAD_VALUE No application monitor has been associated with the
613	        specified \a target before.
614
615	\since BeOS R4
616*/
617
618
619/*!
620	\fn status_t BRoster::ActivateApp(team_id team) const
621	\brief Activates the application identified by the supplied team ID.
622
623	\param team The app's team ID
624
625	\return A status code.
626	\retval B_OK Everything went fine.
627	\retval B_BAD_TEAM_ID \a team does not identify a running application.
628
629	\since BeOS R3
630*/
631
632
633/*!
634	\fn status_t BRoster::Launch(const char* mimeType,
635		BMessage* initialMessage, team_id* appTeam) const
636	\brief Launches the application associated with the supplied MIME type.
637
638	The application to be started is searched the same way FindApp() does it.
639
640	\a initialMessage is a message to be sent to the application "on launch",
641	i.e. before ReadyToRun() is invoked on the BApplication object. The
642	caller retains ownership of the supplied BMessage. In case the method
643	fails with \c B_ALREADY_RUNNING the message is delivered to the already
644	running instance.
645
646	\param mimeType MIME type for which the application shall be launched.
647	\param initialMessage Optional message to be sent to the application
648	       "on launch". May be \c NULL.
649	\param appTeam Pointer to a pre-allocated team_id variable to be set to
650	       the team ID of the launched application.
651
652	\return A status code.
653	\retval B_OK Everything went fine.
654	\retval B_BAD_VALUE \c NULL \a mimeType
655	\retval B_LAUNCH_FAILED_NO_PREFERRED_APP Neither with the supplied type
656	        nor with its supertype (if the supplied isn't a supertype itself)
657	        a preferred application is associated.
658	\retval B_LAUNCH_FAILED_APP_NOT_FOUND The supplied type is not installed
659	        or its preferred application could not be found.
660	\retval B_LAUNCH_FAILED_APP_IN_TRASH The supplied type's preferred
661	        application was in the trash.
662	\retval B_LAUNCH_FAILED_EXECUTABLE The found application was not
663	        executable.
664	\retval B_ALREADY_RUNNING The application's app flags specify
665	\retval B_SINGLE_LAUNCH or \c B_EXCLUSIVE_LAUNCH and the application (the very
666	        same (single) or at least one with the same signature (exclusive)) is
667	        already running.
668
669	\since BeOS R3
670*/
671
672
673/*!
674	\fn status_t BRoster::Launch(const char* mimeType, BList* messageList,
675		team_id* appTeam) const
676	\brief Launches the application associated with the supplied MIME type.
677
678	The application to be started is searched the same way FindApp() does it.
679
680	\a messageList contains messages to be sent to the application
681	"on launch", i.e. before ReadyToRun() is invoked on the BApplication
682	object. The caller retains ownership of the supplied BList and the
683	contained BMessages. In case the method fails with \c B_ALREADY_RUNNING
684	the messages are delivered to the already running instance.
685
686	\param mimeType MIME type for which the application shall be launched.
687	\param messageList Optional list of messages to be sent to the application
688	       "on launch". May be \c NULL.
689	\param appTeam Pointer to a pre-allocated team_id variable to be set to
690	       the team ID of the launched application.
691
692	\return A status code.
693	\retval B_OK Everything went fine.
694	\retval B_BAD_VALUE \c NULL \a mimeType
695	\retval B_LAUNCH_FAILED_NO_PREFERRED_APP Neither with the supplied type
696	        nor with its supertype (if the supplied isn't a supertype itself)
697	        a preferred application is associated.
698	\retval B_LAUNCH_FAILED_APP_NOT_FOUND The supplied type is not installed
699	        or its preferred application could not be found.
700	\retval B_LAUNCH_FAILED_APP_IN_TRASH The supplied type's preferred
701	        application was in the trash.
702	\retval B_LAUNCH_FAILED_EXECUTABLE The found application was not
703	        executable.
704
705	\since BeOS R3
706*/
707
708
709/*!
710	\fn status_t BRoster::Launch(const char* mimeType, int argc,
711		const char* const* args, team_id* appTeam) const
712	\brief Launches the application associated with the supplied MIME type.
713
714	The application to be started is searched the same way FindApp() does it.
715
716	The supplied \a argc and \a args are (if containing at least one argument)
717	put into a \c B_ARGV_RECEIVED message and sent to the launched application
718	"on launch". The caller retains ownership of the supplied \a args.
719	In case the method fails with \c B_ALREADY_RUNNING the message is
720	delivered to the already running instance.
721
722	\param mimeType MIME type for which the application shall be launched.
723	\param argc Specifies the number of elements in \a args.
724	\param args An array of C-strings to be sent as B_ARGV_RECEIVED messaged
725		   to the launched application.
726	\param appTeam Pointer to a pre-allocated team_id variable to be set to
727		   the team ID of the launched application.
728
729	\return A status code.
730	\retval B_OK Everything went fine.
731	\retval B_BAD_VALUE \c NULL \a mimeType
732	\retval B_LAUNCH_FAILED_NO_PREFERRED_APP Neither with the supplied type
733	        nor with its supertype (if the supplied isn't a supertype itself)
734	        a preferred application is associated.
735	\retval B_LAUNCH_FAILED_APP_NOT_FOUND The supplied type is not installed
736	        or its preferred application could not be found.
737	\retval B_LAUNCH_FAILED_APP_IN_TRASH The supplied type's preferred
738	        application was in the trash.
739	\retval B_LAUNCH_FAILED_EXECUTABLE The found application was not
740	        executable.
741
742	\since BeOS R3
743*/
744
745
746/*!
747	\fn status_t BRoster::Launch(const entry_ref* ref,
748		const BMessage* initialMessage, team_id* appTeam) const
749	\brief Launches the application associated with the entry referred to by
750		   the supplied entry_ref.
751
752	The application to be started is searched the same way FindApp() does it.
753
754	If \a ref does refer to an application executable, that application is
755	launched. Otherwise the respective application is searched and launched,
756	and \a ref is sent to it in a \c B_REFS_RECEIVED message.
757
758	\a initialMessage is a message to be sent to the application "on launch",
759	i.e. before ReadyToRun() is invoked on the BApplication object. The
760	caller retains ownership of the supplied BMessage. In case the method
761	fails with \c B_ALREADY_RUNNING the message is delivered to the already
762	running instance. The same applies to the \c B_REFS_RECEIVED message.
763
764	\param ref entry_ref referring to the file for which an application shall
765		   be launched.
766	\param initialMessage Optional message to be sent to the application
767		   "on launch". May be \c NULL.
768	\param appTeam Pointer to a pre-allocated team_id variable to be set to
769		   the team ID of the launched application.
770
771	\return A status code.
772	\retval B_OK Everything went fine.
773	\retval B_BAD_VALUE \c NULL \a mimeType
774	\retval B_LAUNCH_FAILED_NO_PREFERRED_APP Neither with the supplied type
775	        nor with its supertype (if the supplied isn't a supertype itself)
776	        a preferred application is associated.
777	\retval B_LAUNCH_FAILED_APP_NOT_FOUND The supplied type is not installed
778	        or its preferred application could not be found.
779	\retval B_LAUNCH_FAILED_APP_IN_TRASH The supplied type's preferred
780	        application was in the trash.
781	\retval B_LAUNCH_FAILED_EXECUTABLE The found application was not
782	        executable.
783	\retval B_ALREADY_RUNNING: The application's app flags specify
784	        \c B_SINGLE_LAUNCH or \c B_EXCLUSIVE_LAUNCH and the application
785	        (the very same (single) or at least one with the same signature
786	        (exclusive)) was already running.
787
788	\since BeOS R3
789*/
790
791
792/*!
793	\fn status_t BRoster::Launch(const entry_ref* ref, const BList* messageList,
794		team_id* appTeam) const
795	\brief Launches the application associated with the entry referred to by
796		   the supplied entry_ref.
797
798	The application to be started is searched the same way FindApp() does it.
799
800	If \a ref does refer to an application executable, that application is
801	launched. Otherwise the respective application is searched and launched,
802	and \a ref is sent to it in a \c B_REFS_RECEIVED message.
803
804	\a messageList contains messages to be sent to the application
805	"on launch", i.e. before ReadyToRun() is invoked on the BApplication
806	object. The caller retains ownership of the supplied BList and the
807	contained BMessages. In case the method fails with \c B_ALREADY_RUNNING
808	the messages are delivered to the already running instance. The same
809	applies to the \c B_REFS_RECEIVED message.
810
811	\param ref entry_ref referring to the file for which an application shall
812		   be launched.
813	\param messageList Optional list of messages to be sent to the application
814		   "on launch". May be \c NULL.
815	\param appTeam Pointer to a pre-allocated team_id variable to be set to
816		   the team ID of the launched application.
817
818	\return A status code.
819	\retval B_OK Everything went fine.
820	\retval B_BAD_VALUE \c NULL \a mimeType
821	\retval B_LAUNCH_FAILED_NO_PREFERRED_APP Neither with the supplied type
822	        nor with its supertype (if the supplied isn't a supertype itself)
823	        a preferred application is associated.
824	\retval B_LAUNCH_FAILED_APP_NOT_FOUND The supplied type is not installed
825	        or its preferred application could not be found.
826	\retval B_LAUNCH_FAILED_APP_IN_TRASH The supplied type's preferred
827	        application was in the trash.
828	\retval B_LAUNCH_FAILED_EXECUTABLE The found application was not
829	        executable.
830
831	\since BeOS R3
832*/
833
834
835/*!
836	\fn status_t BRoster::Launch(const entry_ref* ref, int argc,
837		const char* const* args, team_id* appTeam) const
838	\brief Launches the application associated with the entry referred to by
839		   the supplied entry_ref.
840
841	The application to be started is searched the same way FindApp() does it.
842
843	If \a ref does refer to an application executable, that application is
844	launched. Otherwise the respective application is searched and launched,
845	and \a ref is sent to it in a \c B_REFS_RECEIVED message, unless other
846	arguments are passed via \a argc and \a args -- then the entry_ref is
847	converted into a path (C-string) and added to the argument vector.
848
849	The supplied \a argc and \a args are (if containing at least one argument)
850	put into a \c B_ARGV_RECEIVED message and sent to the launched application
851	"on launch". The caller retains ownership of the supplied \a args.
852	In case the method fails with \c B_ALREADY_RUNNING the message is
853	delivered to the already running instance. The same applies to the
854	\c B_REFS_RECEIVED message, if no arguments are supplied via \a argc and
855	\a args.
856
857	\param ref entry_ref referring to the file for which an application shall
858		   be launched.
859	\param argc Specifies the number of elements in \a args.
860	\param args An array of C-strings to be sent as B_ARGV_RECEIVED messaged
861		   to the launched application.
862	\param appTeam Pointer to a pre-allocated team_id variable to be set to
863		   the team ID of the launched application.
864
865	\return A status code.
866	\retval B_OK Everything went fine.
867	\retval B_BAD_VALUE \c NULL \a mimeType
868	\retval B_LAUNCH_FAILED_NO_PREFERRED_APP Neither with the supplied type
869	        nor with its supertype (if the supplied isn't a supertype itself)
870	        a preferred application is associated.
871	\retval B_LAUNCH_FAILED_APP_NOT_FOUND The supplied type is not installed
872	        or its preferred application could not be found.
873	\retval B_LAUNCH_FAILED_APP_IN_TRASH The supplied type's preferred
874	        application was in the trash.
875	\retval B_LAUNCH_FAILED_EXECUTABLE The found application was not
876	        executable.
877
878	\since BeOS R3
879*/
880
881
882//! @}
883
884
885/*!
886	\name Recent Information
887*/
888
889
890//! @{
891
892
893/*!
894	\fn void BRoster::GetRecentDocuments(BMessage* refList, int32 maxCount,
895		const char* fileType, const char* signature) const
896	\brief Returns a list of the most recently used documents.
897
898	\param refList Filled out with information about recently used documents.
899	\param maxCount The maximum number of documents to get information on.
900	\param fileType Filter documents by MIME-type string.
901	\param signature Get info only on documents that were used by a
902	       specific application.
903
904	\since BeOS R5
905*/
906
907
908/*!
909	\fn void BRoster::GetRecentDocuments(BMessage* refList, int32 maxCount,
910		const char* fileTypes[], int32 fileTypesCount,
911		const char* signature) const
912	\brief Returns a list of the most recently used documents.
913
914	\param refList Filled out with information about recently used documents.
915	\param maxCount The maximum number of documents to get information on.
916	\param fileTypes Filter documents by and array of MIME-type string.
917	\param fileTypesCount The number of MIME-types in \a fileType.
918	\param signature Get info only on documents that were used by a
919	       specific application.
920
921	\since BeOS R5
922*/
923
924
925/*!
926	\fn void BRoster::GetRecentFolders(BMessage* refList, int32 maxCount,
927		const char* signature) const
928	\brief Returns a list of recently accessed folders.
929
930	\param refList Filled out with information about recently used folders.
931	\param maxCount The maximum number of folders to get information on.
932	\param signature Get info only on folders that were used by a
933	       specific application.
934
935	\since BeOS R5
936*/
937
938
939/*!
940	\fn void BRoster::GetRecentApps(BMessage* refList, int32 maxCount) const
941	\brief Returns a list of the most recently launched applications.
942
943	\param refList Filled out with information about recently used apps.
944	\param maxCount The maximum number of apps to get information on.
945
946	\since BeOS R5
947*/
948
949
950/*!
951	\fn void BRoster::AddToRecentDocuments(const entry_ref* document,
952		const char* signature) const
953	\brief Adds the \a document to the list of recent documents.
954
955	\param document The \a document to add.
956	\param signature To record that a specific application
957	       used the document.
958
959	\since BeOS R5
960*/
961
962
963/*!
964	\fn void BRoster::AddToRecentFolders(const entry_ref* folder,
965		const char* signature) const
966	\brief Adds \a folder to the list of recent folders.
967
968	\param folder The \a folder to add.
969	\param signature To record that a specific application
970	       used the folder.
971
972	\since BeOS R5
973*/
974
975
976//! @}
977