RADLib
RADical C++ application framework
RADUi::DialogModel Class Reference

Generic dialog state model. More...

#include <RADWidgets.h>

+ Inheritance diagram for RADUi::DialogModel:
+ Collaboration diagram for RADUi::DialogModel:

Public Member Functions

const std::string & title () const
 Returns dialog title. More...
 
void setTitle (std::string title)
 Sets dialog title. More...
 
bool isOpen () const
 Returns true when dialog should be visible. More...
 
DialogResult result () const
 Returns current dialog result. More...
 
void open ()
 Opens the dialog and resets result to None. More...
 
void accept ()
 Accepts and closes the dialog. More...
 
void reject ()
 Rejects and closes the dialog. More...
 
- Public Member Functions inherited from RADCore::RADObject
 RADObject ()
 Creates a RADObject bound to the current thread. More...
 
virtual ~RADObject ()
 Disconnects tracked event links and releases lifetime token. More...
 
void registerLink (const ConnectionRecord &record)
 Registers a connection for cleanup when this object is destroyed. More...
 
std::thread::id threadId () const
 Returns the thread id this object is currently associated with. More...
 
EventLoopassociatedEventLoop () const
 Returns the associated event loop, if any. More...
 
ThreadAffinity threadAffinity () const
 Returns both thread id and associated loop atomically. More...
 
std::weak_ptr< void > lifetimeToken () const
 Returns a weak token used to drop queued callbacks after destruction. More...
 
void moveToThread (std::thread::id tId, EventLoop *loop=nullptr)
 Moves the object's affinity to tId and optional loop. More...
 

Public Attributes

RADCore::Event< void() > changed
 Raised when title/open/result changes. More...
 
RADCore::Event< void(RADUi::DialogResult) > finished
 Raised when the dialog accepts or rejects. More...
 

Detailed Description

Generic dialog state model.

Member Function Documentation

◆ accept()

void RADUi::DialogModel::accept ( )

Accepts and closes the dialog.

◆ isOpen()

bool RADUi::DialogModel::isOpen ( ) const

Returns true when dialog should be visible.

◆ open()

void RADUi::DialogModel::open ( )

Opens the dialog and resets result to None.

◆ reject()

void RADUi::DialogModel::reject ( )

Rejects and closes the dialog.

◆ result()

DialogResult RADUi::DialogModel::result ( ) const

Returns current dialog result.

◆ setTitle()

void RADUi::DialogModel::setTitle ( std::string  title)

Sets dialog title.

◆ title()

const std::string& RADUi::DialogModel::title ( ) const

Returns dialog title.

Member Data Documentation

◆ changed

RADCore::Event<void () > RADUi::DialogModel::changed

Raised when title/open/result changes.

◆ finished

RADCore::Event<void (RADUi::DialogResult) > RADUi::DialogModel::finished

Raised when the dialog accepts or rejects.


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