MeVisLab Toolbox Reference
macos::LaunchServices Class Reference

Finder / Launch services encapsulation. More...

#include <macLaunchServices.h>

Public Types

enum  LSRoles { LSRoleViewer = kLSRolesViewer , LSRoleEditor = kLSRolesEditor , LSRoleShell = kLSRolesShell , LSRoleAll = LSRoleViewer | LSRoleEditor | LSRoleShell }
 Specify the desired role or roles for an application to claim with respect to an item. More...
 
enum  LSLaunchFlags { LSLaunchNewInstance = 1 << 0 }
 Specify how to launch the application. More...
 

Static Public Member Functions

static std::string getApplicationWithName (const std::string &appName)
 Return bundle location for bundle with given name, e.g. "iCal.app" (UTF8) More...
 
static std::string getApplicationWithId (const std::string &id)
 Return bundle location for bundle with given id, e.g. "de.mevis.MeVisLab" (UTF8) More...
 
static bool registerApplication (const std::string &app, bool forceUpdate=true)
 Add the bundle's document and URL claims to the Launch Services database (UTF8) More...
 
static bool openDocument (const std::string &doc, LSRoles role=LSRoleAll, const std::string &app=std::string())
 Open given document in given application (or the default application) using the given role (UTF8) More...
 
static bool openDocument (const std::string &doc, const std::string &app)
 This is an overloaded member function, provided for convenience. More...
 
static bool isApplicationOpen (const std::string &id)
 Return 'true' if application is already open (UTF8) More...
 
static bool openApplication (const std::string &app, const std::list< std::string > &docs, const std::list< std::string > &argv, const std::map< std::string, std::string > &environment, LSLaunchFlags flags=static_cast< LSLaunchFlags >(0))
 Launches the specified application (UTF8) More...
 
static bool openApplication (const std::string &app, const std::list< std::string > &docs, const std::list< std::string > &argv, LSLaunchFlags flags=static_cast< LSLaunchFlags >(0))
 This is an overloaded member function, provided for convenience. More...
 
static bool openApplication (const std::string &app, const std::list< std::string > &docs, const std::map< std::string, std::string > &environment, LSLaunchFlags flags=static_cast< LSLaunchFlags >(0))
 This is an overloaded member function, provided for convenience. More...
 
static bool openApplication (const std::string &app, const std::map< std::string, std::string > &environment, LSLaunchFlags flags=static_cast< LSLaunchFlags >(0))
 This is an overloaded member function, provided for convenience. More...
 
static bool openApplication (const std::string &app, const std::list< std::string > &docs, LSLaunchFlags flags=static_cast< LSLaunchFlags >(0))
 This is an overloaded member function, provided for convenience. More...
 
static bool openApplication (const std::string &app, const std::string &doc, LSLaunchFlags flags=static_cast< LSLaunchFlags >(0))
 This is an overloaded member function, provided for convenience. More...
 
static bool openApplication (const std::string &app, LSLaunchFlags flags=static_cast< LSLaunchFlags >(0))
 This is an overloaded member function, provided for convenience. More...
 

Detailed Description

Finder / Launch services encapsulation.

Definition at line 29 of file macLaunchServices.h.

Member Enumeration Documentation

◆ LSLaunchFlags

Specify how to launch the application.

Enumerator
LSLaunchNewInstance 

Definition at line 42 of file macLaunchServices.h.

◆ LSRoles

Specify the desired role or roles for an application to claim with respect to an item.

Enumerator
LSRoleViewer 
LSRoleEditor 
LSRoleShell 
LSRoleAll 

Definition at line 34 of file macLaunchServices.h.

Member Function Documentation

◆ getApplicationWithId()

static std::string macos::LaunchServices::getApplicationWithId ( const std::string &  id)
static

Return bundle location for bundle with given id, e.g. "de.mevis.MeVisLab" (UTF8)

◆ getApplicationWithName()

static std::string macos::LaunchServices::getApplicationWithName ( const std::string &  appName)
static

Return bundle location for bundle with given name, e.g. "iCal.app" (UTF8)

◆ isApplicationOpen()

static bool macos::LaunchServices::isApplicationOpen ( const std::string &  id)
static

Return 'true' if application is already open (UTF8)

◆ openApplication() [1/7]

static bool macos::LaunchServices::openApplication ( const std::string &  app,
const std::list< std::string > &  docs,
const std::list< std::string > &  argv,
const std::map< std::string, std::string > &  environment,
LSLaunchFlags  flags = static_cast< LSLaunchFlags >(0) 
)
static

Launches the specified application (UTF8)

If the application is already running in the current session, it is made the front process (unless the LSLaunchNewInstance flag is used, which always causes a new process to be created)

◆ openApplication() [2/7]

static bool macos::LaunchServices::openApplication ( const std::string &  app,
const std::list< std::string > &  docs,
const std::list< std::string > &  argv,
LSLaunchFlags  flags = static_cast<LSLaunchFlags>(0) 
)
inlinestatic

This is an overloaded member function, provided for convenience.

Definition at line 74 of file macLaunchServices.h.

◆ openApplication() [3/7]

static bool macos::LaunchServices::openApplication ( const std::string &  app,
const std::list< std::string > &  docs,
const std::map< std::string, std::string > &  environment,
LSLaunchFlags  flags = static_cast<LSLaunchFlags>(0) 
)
inlinestatic

This is an overloaded member function, provided for convenience.

Definition at line 78 of file macLaunchServices.h.

◆ openApplication() [4/7]

static bool macos::LaunchServices::openApplication ( const std::string &  app,
const std::list< std::string > &  docs,
LSLaunchFlags  flags = static_cast<LSLaunchFlags>(0) 
)
inlinestatic

This is an overloaded member function, provided for convenience.

Definition at line 86 of file macLaunchServices.h.

◆ openApplication() [5/7]

static bool macos::LaunchServices::openApplication ( const std::string &  app,
const std::map< std::string, std::string > &  environment,
LSLaunchFlags  flags = static_cast<LSLaunchFlags>(0) 
)
inlinestatic

This is an overloaded member function, provided for convenience.

Definition at line 82 of file macLaunchServices.h.

◆ openApplication() [6/7]

static bool macos::LaunchServices::openApplication ( const std::string &  app,
const std::string &  doc,
LSLaunchFlags  flags = static_cast< LSLaunchFlags >(0) 
)
static

This is an overloaded member function, provided for convenience.

◆ openApplication() [7/7]

static bool macos::LaunchServices::openApplication ( const std::string &  app,
LSLaunchFlags  flags = static_cast<LSLaunchFlags>(0) 
)
inlinestatic

This is an overloaded member function, provided for convenience.

Definition at line 92 of file macLaunchServices.h.

◆ openDocument() [1/2]

static bool macos::LaunchServices::openDocument ( const std::string &  doc,
const std::string &  app 
)
inlinestatic

This is an overloaded member function, provided for convenience.

Definition at line 61 of file macLaunchServices.h.

◆ openDocument() [2/2]

static bool macos::LaunchServices::openDocument ( const std::string &  doc,
LSRoles  role = LSRoleAll,
const std::string &  app = std::string() 
)
static

Open given document in given application (or the default application) using the given role (UTF8)

The document may be referenced using an URL or an absolute file path. The function first tries to interpret 'doc' as an URL before referencing the document as posix file path. 'doc' may also reference a directory.

◆ registerApplication()

static bool macos::LaunchServices::registerApplication ( const std::string &  app,
bool  forceUpdate = true 
)
static

Add the bundle's document and URL claims to the Launch Services database (UTF8)


The documentation for this class was generated from the following file: