Om  1.0.0
A universal framework for multimedia simulation
Classes | Public Member Functions | Static Public Member Functions | List of all members
om::gui::Application Class Reference

A class that serves as an interface to the main application state and event thread. More...

#include <omGUIApplication.h>

Classes

class  Delegate
 A class that contains function objects that recieve application events. More...
 

Public Member Functions

 Application ()
 Create an application. More...
 
 Application (const Delegate &newDelegate)
 Create an application which uses the specified event delegate. More...
 
virtual ~Application ()
 Destroy an application, stopping it if it is not already stopped. More...
 
void start ()
 Run the application and start the main thread on a new thread separate from the GUI thread. More...
 
void stop ()
 Signal to the application that it should terminate its event loop. More...
 
Bool isRunning () const
 Return whether or not this application is currently running. More...
 
UTF8String getName () const
 Return a string representing the name of this application. More...
 
const DelegategetDelegate () const
 Return a const reference to the object to which application events are being delegated. More...
 
void setDelegate (const Delegate &newDelegate)
 Set the object to which application events should be delegated. More...
 
objects::MenuBargetMenu () const
 Return a pointer to the application's menu for when there are no active windows. More...
 
Bool setMenu (objects::MenuBar *newMenu)
 set a pointer to the application's menu for when there are no active windows. More...
 
const input::KeyboardgetKeyboard () const
 Return a const reference to the keyboard state object for this application. More...
 
const input::MousegetMouse () const
 Return a const reference to the mouse state object for this application. More...
 
Bool moveToFront ()
 Move all windows in the application to the front of the window order. More...
 
Bool showFile (const UTF8String &filePath)
 Open an operating system window that shows the specified file path. More...
 
Bool openFile (const UTF8String &filePath)
 Open the specified file using the default application for the current system. More...
 
Bool openFileWithApp (const UTF8String &filePath, const UTF8String &appPath)
 Open the specified file using the application at the specified path. More...
 
Bool runApplication (const UTF8String &appPath)
 Open the application at the specified path. More...
 

Static Public Member Functions

static ApplicationgetCurrent ()
 Return a pointer to the currently running application, or NULL if there is none. More...
 
static void start (const Function< Bool(Application &)> &entryPoint)
 Run an application with the supplied entry point. More...
 
static void start (const Delegate &delegate)
 Run an application with the supplied event delegate. More...
 

Detailed Description

A class that serves as an interface to the main application state and event thread.

Constructor & Destructor Documentation

om::gui::Application::Application ( )

Create an application.

om::gui::Application::Application ( const Delegate newDelegate)

Create an application which uses the specified event delegate.

virtual om::gui::Application::~Application ( )
virtual

Destroy an application, stopping it if it is not already stopped.

Member Function Documentation

static Application* om::gui::Application::getCurrent ( )
static

Return a pointer to the currently running application, or NULL if there is none.

void om::gui::Application::start ( )

Run the application and start the main thread on a new thread separate from the GUI thread.

static void om::gui::Application::start ( const Function< Bool(Application &)> &  entryPoint)
static

Run an application with the supplied entry point.

static void om::gui::Application::start ( const Delegate delegate)
static

Run an application with the supplied event delegate.

void om::gui::Application::stop ( )

Signal to the application that it should terminate its event loop.

After terminating the event loop, the application waits for the main thread (called when starting an application) to complete, after which the application stops.

Bool om::gui::Application::isRunning ( ) const

Return whether or not this application is currently running.

UTF8String om::gui::Application::getName ( ) const

Return a string representing the name of this application.

const Delegate& om::gui::Application::getDelegate ( ) const

Return a const reference to the object to which application events are being delegated.

void om::gui::Application::setDelegate ( const Delegate newDelegate)

Set the object to which application events should be delegated.

objects::MenuBar* om::gui::Application::getMenu ( ) const

Return a pointer to the application's menu for when there are no active windows.

Bool om::gui::Application::setMenu ( objects::MenuBar newMenu)

set a pointer to the application's menu for when there are no active windows.

const input::Keyboard& om::gui::Application::getKeyboard ( ) const
inline

Return a const reference to the keyboard state object for this application.

const input::Mouse& om::gui::Application::getMouse ( ) const
inline

Return a const reference to the mouse state object for this application.

Bool om::gui::Application::moveToFront ( )

Move all windows in the application to the front of the window order.

Bool om::gui::Application::showFile ( const UTF8String &  filePath)

Open an operating system window that shows the specified file path.

Bool om::gui::Application::openFile ( const UTF8String &  filePath)

Open the specified file using the default application for the current system.

Bool om::gui::Application::openFileWithApp ( const UTF8String &  filePath,
const UTF8String &  appPath 
)

Open the specified file using the application at the specified path.

Bool om::gui::Application::runApplication ( const UTF8String &  appPath)

Open the application at the specified path.


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