tbx
0.7.6
|
Class to take a URI and dispatch it to the Wimp for processing. More...
#include <uri.h>
Public Types | |
enum | State { NotDispatched, Dispatched, DispatchError, WaitingForResult, Claimed, NotClaimed } |
Public Member Functions | |
URI (const std::string &uri) | |
Create a URI object to dispatch a URI. More... | |
virtual | ~URI () |
When the object is destroyed the result handler is cancelled. | |
void | uri (const std::string &new_uri) |
Reset the URI. More... | |
bool | dispatch () |
Dispatch the URI. More... | |
bool | check () |
Check if an application is open that can process the URI. More... | |
void | set_result_handler (URIResultHandler *handler) |
Set the object to handle the result status of a dispatch or check call. More... | |
State | state () const |
Static Public Member Functions | |
static int | version () |
Get the URI version. More... | |
static bool | dispatch (const std::string &uri) |
static method to give a simple method of launching a uri More... | |
static bool | ensure_uri_handler () |
Ensure the URI handler is started. More... | |
static bool | uri_handler_started () |
Check if the uri_handler has been started. More... | |
Class to take a URI and dispatch it to the Wimp for processing.
To use successfully the AcornURI module must be loaded and started. Either add the correct field to the !Run file or use the method ensure_uri_handler in this class.
tbx::URI::URI | ( | const std::string & | uri | ) |
bool tbx::URI::check | ( | ) |
Check if an application is open that can process the URI.
The result of this call only fails on the initial dispatch use set_result_handler to check if it would be claimed.
returns true if check can start, false otherwise
bool tbx::URI::dispatch | ( | ) |
Dispatch the URI.
The result of this call only fails on the initial dispatch use set_result_handler to check if it was claimed.
|
static |
static method to give a simple method of launching a uri
|
static |
Ensure the URI handler is started.
Checks if the URI handler (AcornURI) has been started and attempts to start it if it has not.
This can only be called from a Wimp task after the application has been initialised.
Caches the result so does nothing after the first successful call.
void tbx::URI::set_result_handler | ( | URIResultHandler * | handler | ) |
Set the object to handle the result status of a dispatch or check call.
The handler must be set before the dispatch or check call to be actioned.
handler | interface to handle the result or nullptr to clear the handler. |
void tbx::URI::uri | ( | const std::string & | new_uri | ) |
|
static |
Check if the uri_handler has been started.
If not started from this task, will use version() to check if it exists and caches the result.
|
static |