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

File picker state model with accept/reject events. More...

#include <RADWidgets.h>

+ Inheritance diagram for RADUi::FilePickerModel:
+ Collaboration diagram for RADUi::FilePickerModel:

Public Member Functions

void setMode (FilePickerMode mode)
 Sets picker mode. More...
 
FilePickerMode mode () const
 Returns picker mode. More...
 
void setDirectory (std::string directory)
 Sets current directory. More...
 
const std::string & directory () const
 Returns current directory. More...
 
void setSelectedPath (std::string path)
 Sets selected path. More...
 
const std::string & selectedPath () const
 Returns selected path. More...
 
const std::vector< std::string > & filters () const
 Returns active file filters. More...
 
void setFilters (std::vector< std::string > filters)
 Sets active file filters. More...
 
bool isOpen () const
 Returns true when picker should be visible. More...
 
void open ()
 Opens the picker. More...
 
void accept ()
 Accepts selectedPath and closes the picker. More...
 
void reject ()
 Rejects and closes the picker. 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 mode, directory, selection, filters, or open state changes. More...
 
RADCore::Event< void(std::string) > accepted
 Raised with selectedPath when accepted. More...
 
RADCore::Event< void() > rejected
 Raised when rejected/cancelled. More...
 

Detailed Description

File picker state model with accept/reject events.

Member Function Documentation

◆ accept()

void RADUi::FilePickerModel::accept ( )

Accepts selectedPath and closes the picker.

◆ directory()

const std::string& RADUi::FilePickerModel::directory ( ) const

Returns current directory.

◆ filters()

const std::vector<std::string>& RADUi::FilePickerModel::filters ( ) const

Returns active file filters.

◆ isOpen()

bool RADUi::FilePickerModel::isOpen ( ) const

Returns true when picker should be visible.

◆ mode()

FilePickerMode RADUi::FilePickerModel::mode ( ) const

Returns picker mode.

◆ open()

void RADUi::FilePickerModel::open ( )

Opens the picker.

◆ reject()

void RADUi::FilePickerModel::reject ( )

Rejects and closes the picker.

◆ selectedPath()

const std::string& RADUi::FilePickerModel::selectedPath ( ) const

Returns selected path.

◆ setDirectory()

void RADUi::FilePickerModel::setDirectory ( std::string  directory)

Sets current directory.

◆ setFilters()

void RADUi::FilePickerModel::setFilters ( std::vector< std::string >  filters)

Sets active file filters.

◆ setMode()

void RADUi::FilePickerModel::setMode ( FilePickerMode  mode)

Sets picker mode.

◆ setSelectedPath()

void RADUi::FilePickerModel::setSelectedPath ( std::string  path)

Sets selected path.

Member Data Documentation

◆ accepted

RADCore::Event<void (std::string) > RADUi::FilePickerModel::accepted

Raised with selectedPath when accepted.

◆ changed

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

Raised when mode, directory, selection, filters, or open state changes.

◆ rejected

RADCore::Event<void () > RADUi::FilePickerModel::rejected

Raised when rejected/cancelled.


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