AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
ADesktop Namespace Reference

Desktop-specific functions. More...

Detailed Description

Desktop-specific functions.

These functions are intended to work only on desktop platforms; on mobile platforms functions filled with stubs.

Classes

struct  FileExtension
 

Enumerations

enum class  SystemSound { QUESTION , ASTERISK }
 

Functions

API_AUI_VIEWS glm::ivec2 getMousePosition ()
 
API_AUI_VIEWS void setMousePos (const glm::ivec2 &pos)
 
API_AUI_VIEWS void playSystemSound (ADesktop::SystemSound s)
 Play system sound asynchronously.
 
API_AUI_VIEWS AFuture< APathbrowseForDir (AWindowBase *parent, const APath &startingLocation={})
 Opens native browse for directory dialog. More...
 
API_AUI_VIEWS AFuture< APathbrowseForFile (AWindowBase *parent, const APath &startingLocation={}, const AVector< FileExtension > &extensions={ {"All", "*"} })
 Opens native browse for file dialog. More...
 
API_AUI_VIEWS _< IDrawableiconOfFile (const APath &file)
 

Function Documentation

◆ browseForDir()

AFuture< APath > ADesktop::browseForDir ( AWindowBase parent,
const APath startingLocation = {} 
)

Opens native browse for directory dialog.

Parameters
parentparent window which is put in the AWindowBase::blockUserInput state while the dialog is active. Can be nullptr.
startingLocationpath where the file browser dialog opened initially. Can be empty.
Returns
AFuture returning selected path. If user cancelled the operation, the returned path is empty.
Note
The future is returned instead of the regular path due to platform limitations on Windows. Never try to call blocking getter since it would cause deadlock. Use AFuture::onSuccess callback instead.

◆ browseForFile()

AFuture< APath > ADesktop::browseForFile ( AWindowBase parent,
const APath startingLocation = {},
const AVector< FileExtension > &  extensions = { {"All", "*"} } 
)

Opens native browse for file dialog.

Parameters
parentparent window which is put in the AWindowBase::blockUserInput state while the dialog is active. Can be nullptr.
startingLocationpath where the file browser dialog opened initially. Can be empty.
extensionsextensions.
Returns
AFuture returning selected path. If user cancelled the operation, the returned path is empty.
Note
The future is returned instead of the regular path due to platform limitations on Windows. Never try to call blocking getter since it would cause deadlock. Use AFuture::onSuccess callback instead.