Loading...
Searching...
No Matches
Public Member Functions | List of all members
BRoster Class Reference

The BRoster class lets you launch apps and keeps track of apps that are running. More...

Public Member Functions

 BRoster ()
 Creates a new BRoster and sets up the connection to the roster service.
 
 ~BRoster ()
 Does nothing.
 
Querying
bool IsRunning (const char *signature) const
 Returns whether or not an application with the supplied signature is currently running.
 
bool IsRunning (entry_ref *ref) const
 Returns whether or not an application ran from an executable referred to by the supplied entry_ref is currently running.
 
team_id TeamFor (const char *signature) const
 Returns the team ID of a currently running application with the supplied signature.
 
team_id TeamFor (entry_ref *ref) const
 Returns the team ID of a currently running application executing the executable referred to by the supplied entry_ref.
 
void GetAppList (BList *teamIDList) const
 Returns a list of all currently running applications.
 
void GetAppList (const char *signature, BList *teamIDList) const
 Returns a list of all currently running applications with the specified signature.
 
status_t GetAppInfo (const char *signature, app_info *info) const
 Returns the app_info of a currently running application with the supplied signature.
 
status_t GetAppInfo (entry_ref *ref, app_info *info) const
 Returns the app_info of a currently running application executing the executable referred to by the supplied entry_ref.
 
status_t GetRunningAppInfo (team_id team, app_info *info) const
 Returns the app_info of a currently running application identified by the supplied team ID.
 
status_t GetActiveAppInfo (app_info *info) const
 Returns the app_info of a currently active application.
 
status_t FindApp (const char *mimeType, entry_ref *app) const
 Finds an application associated with a MIME type.
 
status_t FindApp (entry_ref *ref, entry_ref *app) const
 Finds an application associated with a file.
 
Launching, Activating, and Broadcasting
status_t Broadcast (BMessage *message) const
 Sends a message to all running applications.
 
status_t Broadcast (BMessage *message, BMessenger replyTo) const
 Sends a message to all running applications.
 
status_t StartWatching (BMessenger target, uint32 eventMask=B_REQUEST_LAUNCHED|B_REQUEST_QUIT) const
 Adds a new roster application monitor.
 
status_t StopWatching (BMessenger target) const
 Removes a roster application monitor added with StartWatching().
 
status_t ActivateApp (team_id team) const
 Activates the application identified by the supplied team ID.
 
status_t Launch (const char *mimeType, BMessage *initialMessage=NULL, team_id *_appTeam=NULL) const
 Launches the application associated with the supplied MIME type.
 
status_t Launch (const char *mimeType, BList *messageList, team_id *_appTeam=NULL) const
 Launches the application associated with the supplied MIME type.
 
status_t Launch (const char *mimeType, int argc, const char *const *args, team_id *_appTeam=NULL) const
 Launches the application associated with the supplied MIME type.
 
status_t Launch (const entry_ref *ref, const BMessage *initialMessage=NULL, team_id *_appTeam=NULL) const
 Launches the application associated with the entry referred to by the supplied entry_ref.
 
status_t Launch (const entry_ref *ref, const BList *messageList, team_id *_appTeam=NULL) const
 Launches the application associated with the entry referred to by the supplied entry_ref.
 
status_t Launch (const entry_ref *ref, int argc, const char *const *args, team_id *_appTeam=NULL) const
 Launches the application associated with the entry referred to by the supplied entry_ref.
 
Recent Information
void GetRecentDocuments (BMessage *refList, int32 maxCount, const char *fileType=NULL, const char *signature=NULL) const
 Returns a list of the most recently used documents.
 
void GetRecentDocuments (BMessage *refList, int32 maxCount, const char *fileTypes[], int32 fileTypesCount, const char *signature=NULL) const
 Returns a list of the most recently used documents.
 
void GetRecentFolders (BMessage *refList, int32 maxCount, const char *signature=NULL) const
 Returns a list of recently accessed folders.
 
void GetRecentApps (BMessage *refList, int32 maxCount) const
 Returns a list of the most recently launched applications.
 
void AddToRecentDocuments (const entry_ref *document, const char *signature=NULL) const
 Adds the document to the list of recent documents.
 
void AddToRecentFolders (const entry_ref *folder, const char *signature=NULL) const
 Adds folder to the list of recent folders.
 

Detailed Description

The BRoster class lets you launch apps and keeps track of apps that are running.

The global be_roster object represents the default BRoster, while the app_info structure provides info for a running app.

Since
BeOS R3

Constructor & Destructor Documentation

◆ BRoster()

BRoster::BRoster ( )

Creates a new BRoster and sets up the connection to the roster service.

You should not need to call this, use the be_roster global instead.

Since
BeOS R3

◆ ~BRoster()

BRoster::~BRoster ( )

Does nothing.

Since
BeOS R3

Member Function Documentation

◆ ActivateApp()

status_t BRoster::ActivateApp ( team_id  team) const

Activates the application identified by the supplied team ID.

Parameters
teamThe app's team ID
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_TEAM_IDteam does not identify a running application.
Since
BeOS R3

◆ AddToRecentDocuments()

void BRoster::AddToRecentDocuments ( const entry_ref document,
const char *  signature = NULL 
) const

Adds the document to the list of recent documents.

Parameters
documentThe document to add.
signatureTo record that a specific application used the document.
Since
BeOS R5

◆ AddToRecentFolders()

void BRoster::AddToRecentFolders ( const entry_ref folder,
const char *  signature = NULL 
) const

Adds folder to the list of recent folders.

Parameters
folderThe folder to add.
signatureTo record that a specific application used the folder.
Since
BeOS R5

◆ Broadcast() [1/2]

status_t BRoster::Broadcast ( BMessage message) const

Sends a message to all running applications.

The methods doesn't broadcast the message itself, but it asks the roster to do so. It immediatly returns after sending the request. The return value only tells about whether the request has successfully been sent.

The message is sent asynchronously. Replies to it go to the application. (be_app_messenger).

Parameters
messageThe message to be broadcast.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL message.
Since
BeOS R3

◆ Broadcast() [2/2]

status_t BRoster::Broadcast ( BMessage message,
BMessenger  replyTo 
) const

Sends a message to all running applications.

The methods doesn't broadcast the message itself, but it asks the roster to do so. It immediatly returns after sending the request. The return value only tells about whether the request has successfully been sent.

The message is sent asynchronously. Replies to it go to the specified target (replyTo).

Parameters
messageThe message to be broadcast.
replyToReply target for the message.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL message.
Since
BeOS R4

◆ FindApp() [1/2]

status_t BRoster::FindApp ( const char *  mimeType,
entry_ref app 
) const

Finds an application associated with a MIME type.

The method gets the signature of the supplied type's preferred application and the signature of the super type's preferred application. It will also get all supporting applications for the type and super type and build a list of candiate handlers. In the case that a preferred handler is configured for the sub-type, other supporting apps will be inserted in the candidate list before the super-type preferred and supporting handlers, since it is assumed that the super type handlers are not well suited for the sub-type. The following resolving algorithm is performed on each signature of the resulting list: The MIME database is asked which executable is associated with the signature. If the database doesn't have a reference to an exectuable, the boot volume is queried for a file with the signature. If more than one file has been found, the one with the greatest version is picked, or if no file has a version info, the one with the most recent modification date. The first application from the signature list which can be successfully resolved by this algorithm is returned. Contrary to BeOS behavior, this means that if the preferred application of the provided MIME type cannot be resolved, or if it does not have a preferred application associated, the method will return other applications with direct support for the MIME type before it resorts to the preferred application or supporting applications of the super type.

Parameters
mimeTypeThe MIME type for which an application shall be found.
appA pointer to a pre-allocated entry_ref to be filled with a reference to the found application's executable.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL mimeType or app.
B_LAUNCH_FAILED_NO_PREFERRED_APPNeither with the supplied type nor with its supertype (if the supplied isn't a supertype itself) a preferred application is associated and no other supporting applications could be identified.
B_LAUNCH_FAILED_APP_NOT_FOUNDThe supplied type was not installed or its preferred application could not be found.
B_LAUNCH_FAILED_APP_IN_TRASHThe supplied type's only supporting application was in the trash.
Since
BeOS R3

◆ FindApp() [2/2]

status_t BRoster::FindApp ( entry_ref ref,
entry_ref app 
) const

Finds an application associated with a file.

The method first checks, if the file has a preferred application associated with it (see BNodeInfo::GetPreferredApp()) and if so, tries to find the executable the same way FindApp(const char*, entry_ref*) does. If not, it gets the MIME type of the file and searches an application for it exactly like the first FindApp() method.

The type of the file is defined in a file attribute (BNodeInfo::GetType()), but if it is not set yet, the method tries to guess it via BMimeType::GuessMimeType().

As a special case the file may have execute permission. Then preferred application and type are ignored and an entry_ref to the file itself is returned.

Parameters
refAn entry_ref referring to the file for which an application shall be found.
appA pointer to a pre-allocated entry_ref to be filled with a reference to the found application's executable.
Returns
Return values
B_OKEverything went fine.
B_BAD_VALUENULL mimeType or app.
B_LAUNCH_FAILED_NO_PREFERRED_APPNeither with the supplied type nor with its supertype (if the supplied isn't a supertype itself) a preferred application is associated.
B_LAUNCH_FAILED_APP_NOT_FOUNDThe supplied type was not installed or its preferred application could not be found.
B_LAUNCH_FAILED_APP_IN_TRASHThe supplied type's preferred application was in the trash.
Since
BeOS R3

◆ GetActiveAppInfo()

status_t BRoster::GetActiveAppInfo ( app_info info) const

Returns the app_info of a currently active application.

Parameters
infoA pointer to a pre-allocated app_info structure to be filled in by this method.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUEinfo was NULL.
B_ERRORNo application was currently active.
Since
BeOS R3
Parameters
infoA pointer to a pre-allocated app_info structure to be filled in by this method.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUEinfo was NULL.
B_ERRORNo application was currently active.
Since
BeOS R3

◆ GetAppInfo() [1/2]

status_t BRoster::GetAppInfo ( const char *  signature,
app_info info 
) const

Returns the app_info of a currently running application with the supplied signature.

Parameters
signatureThe application signature.
infoA pointer to a pre-allocated app_info structure to be filled by this method.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUEsig is NULL.
B_ERRORNo application with the supplied signature is currently running.
Since
BeOS R3

◆ GetAppInfo() [2/2]

status_t BRoster::GetAppInfo ( entry_ref ref,
app_info info 
) const

Returns the app_info of a currently running application executing the executable referred to by the supplied entry_ref.

Parameters
refThe app's entry_ref
infoA pointer to a pre-allocated app_info structure to be filled in by this method.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUEref is NULL.
B_ERRORNo application executing the file referred to by ref was currently running.
Since
BeOS R3

◆ GetAppList() [1/2]

void BRoster::GetAppList ( BList teamIDList) const

Returns a list of all currently running applications.

The supplied list is not emptied before adding the team IDs of the running applications. The list elements are team_id's, not pointers.

Parameters
teamIDListA pointer to a pre-allocated BList to be filled with the team IDs.
Since
BeOS R3

◆ GetAppList() [2/2]

void BRoster::GetAppList ( const char *  signature,
BList teamIDList 
) const

Returns a list of all currently running applications with the specified signature.

The supplied list is not emptied before adding the team IDs of the running applications. The list elements are team_id's, not pointers. If sig is NULL or invalid, no team IDs are added to the list.

Parameters
signatureThe application signature.
teamIDListA pointer to a pre-allocated BList to be filled with the team IDs.
Since
BeOS R3

◆ GetRecentApps()

void BRoster::GetRecentApps ( BMessage refList,
int32  maxCount 
) const

Returns a list of the most recently launched applications.

Parameters
refListFilled out with information about recently used apps.
maxCountThe maximum number of apps to get information on.
Since
BeOS R5

◆ GetRecentDocuments() [1/2]

void BRoster::GetRecentDocuments ( BMessage refList,
int32  maxCount,
const char *  fileType = NULL,
const char *  signature = NULL 
) const

Returns a list of the most recently used documents.

Parameters
refListFilled out with information about recently used documents.
maxCountThe maximum number of documents to get information on.
fileTypeFilter documents by MIME-type string.
signatureGet info only on documents that were used by a specific application.
Since
BeOS R5

◆ GetRecentDocuments() [2/2]

void BRoster::GetRecentDocuments ( BMessage refList,
int32  maxCount,
const char *  fileTypes[],
int32  fileTypesCount,
const char *  signature = NULL 
) const

Returns a list of the most recently used documents.

Parameters
refListFilled out with information about recently used documents.
maxCountThe maximum number of documents to get information on.
fileTypesFilter documents by and array of MIME-type string.
fileTypesCountThe number of MIME-types in fileType.
signatureGet info only on documents that were used by a specific application.
Since
BeOS R5

◆ GetRecentFolders()

void BRoster::GetRecentFolders ( BMessage refList,
int32  maxCount,
const char *  signature = NULL 
) const

Returns a list of recently accessed folders.

Parameters
refListFilled out with information about recently used folders.
maxCountThe maximum number of folders to get information on.
signatureGet info only on folders that were used by a specific application.
Since
BeOS R5

◆ GetRunningAppInfo()

status_t BRoster::GetRunningAppInfo ( team_id  team,
app_info info 
) const

Returns the app_info of a currently running application identified by the supplied team ID.

Parameters
teamThe app's team ID.
infoA pointer to a pre-allocated app_info structure to be filled in by this method.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUEinfo was NULL.
B_BAD_TEAM_IDteam did not identify a running application.
Since
BeOS R3

◆ IsRunning() [1/2]

bool BRoster::IsRunning ( const char *  signature) const

Returns whether or not an application with the supplied signature is currently running.

Parameters
signatureThe app signature.
Returns
true, if the supplied signature is not NULL and an application with this signature is running, false otherwise.
Since
BeOS R3

◆ IsRunning() [2/2]

bool BRoster::IsRunning ( entry_ref ref) const

Returns whether or not an application ran from an executable referred to by the supplied entry_ref is currently running.

Parameters
refThe app's entry_ref
Returns
true, if the supplied entry_ref is not NULL and an application executing this file is running, false otherwise.
Since
BeOS R3

◆ Launch() [1/6]

status_t BRoster::Launch ( const char *  mimeType,
BList messageList,
team_id *  appTeam = NULL 
) const

Launches the application associated with the supplied MIME type.

The application to be started is searched the same way FindApp() does it.

messageList contains messages to be sent to the application "on launch", i.e. before ReadyToRun() is invoked on the BApplication object. The caller retains ownership of the supplied BList and the contained BMessages. In case the method fails with B_ALREADY_RUNNING the messages are delivered to the already running instance.

Parameters
mimeTypeMIME type for which the application shall be launched.
messageListOptional list of messages to be sent to the application "on launch". May be NULL.
appTeamPointer to a pre-allocated team_id variable to be set to the team ID of the launched application.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL mimeType
B_LAUNCH_FAILED_NO_PREFERRED_APPNeither with the supplied type nor with its supertype (if the supplied isn't a supertype itself) a preferred application is associated.
B_LAUNCH_FAILED_APP_NOT_FOUNDThe supplied type is not installed or its preferred application could not be found.
B_LAUNCH_FAILED_APP_IN_TRASHThe supplied type's preferred application was in the trash.
B_LAUNCH_FAILED_EXECUTABLEThe found application was not executable.
Since
BeOS R3

◆ Launch() [2/6]

status_t BRoster::Launch ( const char *  mimeType,
BMessage initialMessage = NULL,
team_id *  appTeam = NULL 
) const

Launches the application associated with the supplied MIME type.

The application to be started is searched the same way FindApp() does it.

initialMessage is a message to be sent to the application "on launch", i.e. before ReadyToRun() is invoked on the BApplication object. The caller retains ownership of the supplied BMessage. In case the method fails with B_ALREADY_RUNNING the message is delivered to the already running instance.

Parameters
mimeTypeMIME type for which the application shall be launched.
initialMessageOptional message to be sent to the application "on launch". May be NULL.
appTeamPointer to a pre-allocated team_id variable to be set to the team ID of the launched application.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL mimeType
B_LAUNCH_FAILED_NO_PREFERRED_APPNeither with the supplied type nor with its supertype (if the supplied isn't a supertype itself) a preferred application is associated.
B_LAUNCH_FAILED_APP_NOT_FOUNDThe supplied type is not installed or its preferred application could not be found.
B_LAUNCH_FAILED_APP_IN_TRASHThe supplied type's preferred application was in the trash.
B_LAUNCH_FAILED_EXECUTABLEThe found application was not executable.
B_ALREADY_RUNNINGThe application's app flags specify
B_SINGLE_LAUNCHor B_EXCLUSIVE_LAUNCH and the application (the very same (single) or at least one with the same signature (exclusive)) is already running.
Since
BeOS R3

◆ Launch() [3/6]

status_t BRoster::Launch ( const char *  mimeType,
int  argc,
const char *const *  args,
team_id *  appTeam = NULL 
) const

Launches the application associated with the supplied MIME type.

The application to be started is searched the same way FindApp() does it.

The supplied argc and args are (if containing at least one argument) put into a B_ARGV_RECEIVED message and sent to the launched application "on launch". The caller retains ownership of the supplied args. In case the method fails with B_ALREADY_RUNNING the message is delivered to the already running instance.

Parameters
mimeTypeMIME type for which the application shall be launched.
argcSpecifies the number of elements in args.
argsAn array of C-strings to be sent as B_ARGV_RECEIVED messaged to the launched application.
appTeamPointer to a pre-allocated team_id variable to be set to the team ID of the launched application.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL mimeType
B_LAUNCH_FAILED_NO_PREFERRED_APPNeither with the supplied type nor with its supertype (if the supplied isn't a supertype itself) a preferred application is associated.
B_LAUNCH_FAILED_APP_NOT_FOUNDThe supplied type is not installed or its preferred application could not be found.
B_LAUNCH_FAILED_APP_IN_TRASHThe supplied type's preferred application was in the trash.
B_LAUNCH_FAILED_EXECUTABLEThe found application was not executable.
Since
BeOS R3

◆ Launch() [4/6]

status_t BRoster::Launch ( const entry_ref ref,
const BList messageList,
team_id *  appTeam = NULL 
) const

Launches the application associated with the entry referred to by the supplied entry_ref.

The application to be started is searched the same way FindApp() does it.

If ref does refer to an application executable, that application is launched. Otherwise the respective application is searched and launched, and ref is sent to it in a B_REFS_RECEIVED message.

messageList contains messages to be sent to the application "on launch", i.e. before ReadyToRun() is invoked on the BApplication object. The caller retains ownership of the supplied BList and the contained BMessages. In case the method fails with B_ALREADY_RUNNING the messages are delivered to the already running instance. The same applies to the B_REFS_RECEIVED message.

Parameters
refentry_ref referring to the file for which an application shall be launched.
messageListOptional list of messages to be sent to the application "on launch". May be NULL.
appTeamPointer to a pre-allocated team_id variable to be set to the team ID of the launched application.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL mimeType
B_LAUNCH_FAILED_NO_PREFERRED_APPNeither with the supplied type nor with its supertype (if the supplied isn't a supertype itself) a preferred application is associated.
B_LAUNCH_FAILED_APP_NOT_FOUNDThe supplied type is not installed or its preferred application could not be found.
B_LAUNCH_FAILED_APP_IN_TRASHThe supplied type's preferred application was in the trash.
B_LAUNCH_FAILED_EXECUTABLEThe found application was not executable.
Since
BeOS R3

◆ Launch() [5/6]

status_t BRoster::Launch ( const entry_ref ref,
const BMessage initialMessage = NULL,
team_id *  appTeam = NULL 
) const

Launches the application associated with the entry referred to by the supplied entry_ref.

The application to be started is searched the same way FindApp() does it.

If ref does refer to an application executable, that application is launched. Otherwise the respective application is searched and launched, and ref is sent to it in a B_REFS_RECEIVED message.

initialMessage is a message to be sent to the application "on launch", i.e. before ReadyToRun() is invoked on the BApplication object. The caller retains ownership of the supplied BMessage. In case the method fails with B_ALREADY_RUNNING the message is delivered to the already running instance. The same applies to the B_REFS_RECEIVED message.

Parameters
refentry_ref referring to the file for which an application shall be launched.
initialMessageOptional message to be sent to the application "on launch". May be NULL.
appTeamPointer to a pre-allocated team_id variable to be set to the team ID of the launched application.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL mimeType
B_LAUNCH_FAILED_NO_PREFERRED_APPNeither with the supplied type nor with its supertype (if the supplied isn't a supertype itself) a preferred application is associated.
B_LAUNCH_FAILED_APP_NOT_FOUNDThe supplied type is not installed or its preferred application could not be found.
B_LAUNCH_FAILED_APP_IN_TRASHThe supplied type's preferred application was in the trash.
B_LAUNCH_FAILED_EXECUTABLEThe found application was not executable.
B_ALREADY_RUNNINGThe application's app flags specify B_SINGLE_LAUNCH or B_EXCLUSIVE_LAUNCH and the application (the very same (single) or at least one with the same signature (exclusive)) was already running.
Since
BeOS R3

◆ Launch() [6/6]

status_t BRoster::Launch ( const entry_ref ref,
int  argc,
const char *const *  args,
team_id *  appTeam = NULL 
) const

Launches the application associated with the entry referred to by the supplied entry_ref.

The application to be started is searched the same way FindApp() does it.

If ref does refer to an application executable, that application is launched. Otherwise the respective application is searched and launched, and ref is sent to it in a B_REFS_RECEIVED message, unless other arguments are passed via argc and args – then the entry_ref is converted into a path (C-string) and added to the argument vector.

The supplied argc and args are (if containing at least one argument) put into a B_ARGV_RECEIVED message and sent to the launched application "on launch". The caller retains ownership of the supplied args. In case the method fails with B_ALREADY_RUNNING the message is delivered to the already running instance. The same applies to the B_REFS_RECEIVED message, if no arguments are supplied via argc and args.

Parameters
refentry_ref referring to the file for which an application shall be launched.
argcSpecifies the number of elements in args.
argsAn array of C-strings to be sent as B_ARGV_RECEIVED messaged to the launched application.
appTeamPointer to a pre-allocated team_id variable to be set to the team ID of the launched application.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL mimeType
B_LAUNCH_FAILED_NO_PREFERRED_APPNeither with the supplied type nor with its supertype (if the supplied isn't a supertype itself) a preferred application is associated.
B_LAUNCH_FAILED_APP_NOT_FOUNDThe supplied type is not installed or its preferred application could not be found.
B_LAUNCH_FAILED_APP_IN_TRASHThe supplied type's preferred application was in the trash.
B_LAUNCH_FAILED_EXECUTABLEThe found application was not executable.
Since
BeOS R3

◆ StartWatching()

status_t BRoster::StartWatching ( BMessenger  target,
uint32  eventMask = B_REQUEST_LAUNCHED | B_REQUEST_QUIT 
) const

Adds a new roster application monitor.

After StartWatching() event messages will be sent to the supplied target according to the specified flags until a respective StopWatching() call.

eventMask must be a bitwise OR of one or more of the following flags:

  • B_REQUEST_LAUNCHED: A B_SOME_APP_LAUNCHED is sent, whenever an application has been launched.
  • B_REQUEST_QUIT: A B_SOME_APP_QUIT is sent, whenever an application has quit.
  • B_REQUEST_ACTIVATED: A B_SOME_APP_ACTIVATED is sent, whenever an application has been activated.

All event messages contain the following fields supplying more information about the concerned application:

  • "be:signature", B_STRING_TYPE: The signature of the application.
  • "be:team", B_INT32_TYPE: The team ID of the application (team_id).
  • "be:thread", B_INT32_TYPE: The ID of the application's main thread (thread_id).
  • "be:flags", B_INT32_TYPE: The application flags (uint32).
  • "be:ref", B_REF_TYPE: An entry_ref referring to the application's executable.

A second call to StartWatching() with the same target simply sets the new eventMask. The messages won't be sent twice to the target.

Parameters
targetThe target the event messages shall be sent to.
eventMaskSpecifies the events the caller is interested in.
Returns
B_OK if everything went fine or an error code, if some error occurred.
Since
BeOS R4

◆ StopWatching()

status_t BRoster::StopWatching ( BMessenger  target) const

Removes a roster application monitor added with StartWatching().

Parameters
targetThe target that shall not longer receive any event messages.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENo application monitor has been associated with the specified target before.
Since
BeOS R4

◆ TeamFor() [1/2]

team_id BRoster::TeamFor ( const char *  signature) const

Returns the team ID of a currently running application with the supplied signature.

Parameters
signatureThe app signature.
Returns
The team ID of a running application with the supplied signature.
Return values
B_BAD_VALUEsignature is NULL.
B_ERRORNo application with the supplied signature is currently running.
Since
BeOS R3

◆ TeamFor() [2/2]

team_id BRoster::TeamFor ( entry_ref ref) const

Returns the team ID of a currently running application executing the executable referred to by the supplied entry_ref.

Parameters
refThe app's entry_ref
Returns
The team ID of a running application executing the file referred to by ref.
Return values
B_BAD_VALUEref is NULL.
B_ERRORNo application executing the file referred to by ref is currently running.
Since
BeOS R3