CoreComponents 3.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
Application Class Reference

Global application state. More...

#include <cc/Application>

Inheritance diagram for Application:

Public Member Functions

 Application ()
 Get global application state (initializes on first call)
 
 Application (int argc, char *argv[])
 Initialize global application state.
 
String orgName () const
 Get organization name.
 
ApplicationorgName (const String &newValue)
 Set organization name
 
String appName () const
 Get application name.
 
ApplicationappName (const String &newValue)
 Set application name
 
String userDataPath ()
 Get platform specific path for application specfic user data.
 
int run ()
 Run the application's event loop.
 
void quit ()
 Exit the application's event loop.
 
Control hoverControl () const
 The control the pointer is currently hovering over.
 
Control pressedControl () const
 The control which is currently pressed by the user.
 
Control focusControl () const
 The control which currently holds the input focus.
 
Window focusWindow () const
 The window which currently holds the input focus.
 
Window appWindow () const
 Get the applications primary window.
 
double textZoom () const
 Get the text zoom factor.
 
ApplicationtextZoom (Definition< double > &&f)
 Define the text zoom factor.
 
ApplicationtextZoom (double newValue)
 Set the text zoom factor
 
FontSmoothing fontSmoothing () const
 Get the application default font smoothing.
 
ApplicationfontSmoothing (FontSmoothing newValue)
 Set the application default font smoothing
 
String clipboardText () const
 Get the current clipboard text.
 
ApplicationclipboardText (const String &text)
 Set the current clipboard text
 
double minMouseDragDistance () const
 Get the minimal mouse drag distance.
 
ApplicationminMouseDragDistance (double newValue)
 Set the minimal mouse drag distance
 
double minFingerDragDistance () const
 Get the minimal touch input drag distance.
 
ApplicationminFingerDragDistance (double newValue)
 Set the minimal touch input drag distance
 
bool pointerIsDragged (const PointerEvent &event, Point dragStart) const
 Check if this is a drag operation
 
void postEvent (Function< void()> &&doNext)
 Push a custom event to the application's event loop.
 
- Public Member Functions inherited from Object
 Object ()=default
 Create a null object.
 
 operator bool () const
 Check if this is a non-null object.
 
bool isNull () const
 Check if this is a null object.
 
template<class T >
bool is () const
 Check if this object is of type T.
 
template<class T >
as () const
 Cast this object to type T.
 
bool isWeak () const
 Check if the underlying object reference is weak.
 
bool operator== (const Object &other) const
 Equality operator.
 
std::strong_ordering operator<=> (const Object &other) const
 Ordering operator.
 
long useCount () const
 Reference count.
 

Protected Member Functions

 Application (State *state)
 
void hoverControl (const Control &control)
 
void pressedControl (const Control &control)
 
void focusControl (const Control &control)
 
void disengage (const View &view)
 
State & me ()
 
const State & me () const
 
- Protected Member Functions inherited from Singleton
 Singleton ()=default
 Create a null singleton.
 
 Singleton (State *state)
 Initialize singleton object with instance state.
 
- Protected Member Functions inherited from Object
template<class T >
weak () const
 
template<class T >
void initOnce ()
 Create the object state when called the first time.
 
template<class T >
void initOncePerThread ()
 Create a distinct object state for each thread when called the first time in that thread.
 
 Object (State *newState)
 Initialize object with newState.
 
 Object (State *state, Alias)
 
 Object (State *state, Weak)
 
Objectoperator= (std::nullptr_t)
 

Additional Inherited Members

- Static Protected Member Functions inherited from Singleton
template<class T >
static Handle< T > & handle ()
 
template<class T >
static void destroy ()
 
template<class T >
static T * instance ()
 Get access to the singleton instance.
 
- Static Protected Member Functions inherited from Object
template<class T >
static T alias (const State *state)
 Create an alias object for the given state.
 
template<class T >
static T weak (const State *state)
 
- Protected Attributes inherited from Object
Handle< Stateme
 Internal object state
 

Detailed Description

Global application state.

Constructor & Destructor Documentation

◆ Application() [1/2]

Get global application state (initializes on first call)

◆ Application() [2/2]

Application ( int argc,
char * argv[] )

Initialize global application state.

Member Function Documentation

◆ orgName() [1/2]

String orgName ( ) const

Get organization name.

◆ orgName() [2/2]

Application & orgName ( const String & newValue)

Set organization name

◆ appName() [1/2]

String appName ( ) const

Get application name.

◆ appName() [2/2]

Application & appName ( const String & newValue)

Set application name

◆ userDataPath()

String userDataPath ( )

Get platform specific path for application specfic user data.

◆ run()

int run ( )

Run the application's event loop.

◆ quit()

void quit ( )

Exit the application's event loop.

◆ hoverControl()

Control hoverControl ( ) const

The control the pointer is currently hovering over.

◆ pressedControl()

Control pressedControl ( ) const

The control which is currently pressed by the user.

◆ focusControl()

Control focusControl ( ) const

The control which currently holds the input focus.

◆ focusWindow()

Window focusWindow ( ) const

The window which currently holds the input focus.

◆ appWindow()

Window appWindow ( ) const

Get the applications primary window.

◆ textZoom() [1/3]

double textZoom ( ) const

Get the text zoom factor.

◆ textZoom() [2/3]

Application & textZoom ( Definition< double > && f)

Define the text zoom factor.

◆ textZoom() [3/3]

Application & textZoom ( double newValue)

Set the text zoom factor

◆ fontSmoothing() [1/2]

FontSmoothing fontSmoothing ( ) const

Get the application default font smoothing.

◆ fontSmoothing() [2/2]

Application & fontSmoothing ( FontSmoothing newValue)

Set the application default font smoothing

◆ clipboardText() [1/2]

String clipboardText ( ) const

Get the current clipboard text.

◆ clipboardText() [2/2]

Application & clipboardText ( const String & text)

Set the current clipboard text

◆ minMouseDragDistance() [1/2]

double minMouseDragDistance ( ) const

Get the minimal mouse drag distance.

◆ minMouseDragDistance() [2/2]

Application & minMouseDragDistance ( double newValue)

Set the minimal mouse drag distance

◆ minFingerDragDistance() [1/2]

double minFingerDragDistance ( ) const

Get the minimal touch input drag distance.

◆ minFingerDragDistance() [2/2]

Application & minFingerDragDistance ( double newValue)

Set the minimal touch input drag distance

◆ pointerIsDragged()

bool pointerIsDragged ( const PointerEvent & event,
Point dragStart ) const

Check if this is a drag operation

◆ postEvent()

void postEvent ( Function< void()> && doNext)

Push a custom event to the application's event loop.

Parameters
doNextFunction which will be evaluated in the application's foreground thread
Note
This function is thread-safe.