MeVisLabToolboxReference
|
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 = kLSLaunchNewInstance } |
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) | |
static std::string | getApplicationWithId (const std::string &id) |
Return bundle location for bundle with given id, e.g. "de.mevis.MeVisLab" (UTF8) | |
static std::string | getApplicationWithMIMEType (const std::string &MIMEType, LSRoles role=LSRoleAll) |
Return bundle location for default application handling given MIME type, e.g. "application/pdf" (UTF8) | |
static bool | registerApplication (const std::string &app, bool forceUpdate=true) |
Add the bundle's document and URL claims to the Launch Services database (UTF8) | |
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) | |
static bool | openDocument (const std::string &doc, const std::string &app) |
This is an overloaded member function, provided for convenience. | |
static bool | isApplicationOpen (const std::string &id) |
Return 'true' if application is already open (UTF8) | |
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) | |
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. | |
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. | |
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. | |
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. | |
static bool | openApplication (const std::string &app, LSLaunchFlags flags=static_cast< LSLaunchFlags >(0)) |
This is an overloaded member function, provided for convenience. |
Finder / Launch services encapsulation.
Definition at line 19 of file macLaunchServices.h.
Specify how to launch the application.
Definition at line 32 of file macLaunchServices.h.
Specify the desired role or roles for an application to claim with respect to an item.
Definition at line 24 of file macLaunchServices.h.
static std::string macx::LaunchServices::getApplicationWithId | ( | const std::string & | id | ) | [static] |
Return bundle location for bundle with given id, e.g. "de.mevis.MeVisLab" (UTF8)
static std::string macx::LaunchServices::getApplicationWithMIMEType | ( | const std::string & | MIMEType, |
LSRoles | role = LSRoleAll |
||
) | [static] |
Return bundle location for default application handling given MIME type, e.g. "application/pdf" (UTF8)
static std::string macx::LaunchServices::getApplicationWithName | ( | const std::string & | appName | ) | [static] |
Return bundle location for bundle with given name, e.g. "iCal.app" (UTF8)
static bool macx::LaunchServices::isApplicationOpen | ( | const std::string & | id | ) | [static] |
Return 'true' if application is already open (UTF8)
static bool macx::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 launchNewInstance flag is used, which always causes a new process to be created)
Referenced by openApplication().
static bool macx::LaunchServices::openApplication | ( | const std::string & | app, |
const std::list< std::string > & | docs, | ||
const std::list< std::string > & | argv, | ||
LSLaunchFlags | flags = static_cast<LSLaunchFlags>(0) |
||
) | [inline, static] |
This is an overloaded member function, provided for convenience.
Definition at line 67 of file macLaunchServices.h.
References openApplication().
static bool macx::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) |
||
) | [inline, static] |
This is an overloaded member function, provided for convenience.
Definition at line 71 of file macLaunchServices.h.
References openApplication().
static bool macx::LaunchServices::openApplication | ( | const std::string & | app, |
LSLaunchFlags | flags = static_cast<LSLaunchFlags>(0) |
||
) | [inline, static] |
This is an overloaded member function, provided for convenience.
Definition at line 83 of file macLaunchServices.h.
References openApplication().
static bool macx::LaunchServices::openApplication | ( | const std::string & | app, |
const std::list< std::string > & | docs, | ||
LSLaunchFlags | flags = static_cast<LSLaunchFlags>(0) |
||
) | [inline, static] |
This is an overloaded member function, provided for convenience.
Definition at line 79 of file macLaunchServices.h.
References openApplication().
static bool macx::LaunchServices::openApplication | ( | const std::string & | app, |
const std::map< std::string, std::string > & | environment, | ||
LSLaunchFlags | flags = static_cast<LSLaunchFlags>(0) |
||
) | [inline, static] |
This is an overloaded member function, provided for convenience.
Definition at line 75 of file macLaunchServices.h.
References openApplication().
static bool macx::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 a URL or an absolute file path. The function first tries to interpret 'doc' as a URL before referencing the document as posix file path. 'doc' may also reference a directory.
Referenced by openDocument().
static bool macx::LaunchServices::openDocument | ( | const std::string & | doc, |
const std::string & | app | ||
) | [inline, static] |
This is an overloaded member function, provided for convenience.
Definition at line 54 of file macLaunchServices.h.
References LSRoleAll, and openDocument().
static bool macx::LaunchServices::registerApplication | ( | const std::string & | app, |
bool | forceUpdate = true |
||
) | [static] |
Add the bundle's document and URL claims to the Launch Services database (UTF8)