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

Searchable command palette model. More...

#include <RADAppKit.h>

+ Inheritance diagram for RADUi::CommandPaletteModel:
+ Collaboration diagram for RADUi::CommandPaletteModel:

Public Member Functions

const std::vector< Command > & commands () const
 Returns all commands. More...
 
void setCommands (std::vector< Command > commands)
 Replaces commands. More...
 
void setFilter (std::string filter)
 Sets filter text. More...
 
const std::string & filter () const
 Returns filter text. More...
 
std::vector< CommandfilteredCommands () const
 Returns filtered commands. More...
 
bool trigger (const std::string &id)
 Triggers an enabled command by id. 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 commands or filter text changes. More...
 
RADCore::Event< void(std::string) > triggered
 Raised when a command is triggered. More...
 

Detailed Description

Searchable command palette model.

Member Function Documentation

◆ commands()

const std::vector<Command>& RADUi::CommandPaletteModel::commands ( ) const

Returns all commands.

◆ filter()

const std::string& RADUi::CommandPaletteModel::filter ( ) const

Returns filter text.

◆ filteredCommands()

std::vector<Command> RADUi::CommandPaletteModel::filteredCommands ( ) const

Returns filtered commands.

◆ setCommands()

void RADUi::CommandPaletteModel::setCommands ( std::vector< Command commands)

Replaces commands.

◆ setFilter()

void RADUi::CommandPaletteModel::setFilter ( std::string  filter)

Sets filter text.

◆ trigger()

bool RADUi::CommandPaletteModel::trigger ( const std::string &  id)

Triggers an enabled command by id.

Member Data Documentation

◆ changed

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

Raised when commands or filter text changes.

◆ triggered

RADCore::Event<void (std::string) > RADUi::CommandPaletteModel::triggered

Raised when a command is triggered.


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