UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
WidgetUi Class Referenceabstract

#include <widget_ui.hpp>

Inheritance diagram for WidgetUi:
Inheritance graph
Collaboration diagram for WidgetUi:
Collaboration graph

Signals

void changed ()
 

Public Member Functions

 WidgetUi (const WidgetUi &)=delete
 
 WidgetUi (Settings *settings, const std::string &opt)
 
 WidgetUi (WidgetUi &&)=delete
 
virtual ~WidgetUi ()
 
WidgetUi & operator= (const WidgetUi &)=delete
 
WidgetUi & operator= (WidgetUi &&)=delete
 
virtual void refresh ()
 
void registerCallback (const std::string &option)
 
void registerCustomCallback (const std::string &option, Option::Callback callback, std::unique_ptr< ExtraCallbackData > &&extraDataPtr=nullptr)
 
void setOpt (const std::string &opt)
 

Protected Member Functions

virtual void connectSignals ()=0
 
virtual void optChangeCallback (Option &opt, bool suboption)=0
 
void registerCallback ()
 
virtual void updateUiState ()=0
 

Static Protected Member Functions

static void optChangeCallbackStatic (Option &, bool, void *)
 

Protected Attributes

std::vector< std::unique_ptr< ExtraCallbackData > > extraData
 
std::string opt
 
std::vector< std::pair< std::string, Option::Callback > > registeredCallbacks
 
Settings * settings
 

Detailed Description

Definition at line 10 of file widget_ui.hpp.

Constructor & Destructor Documentation

◆ WidgetUi() [1/3]

WidgetUi::WidgetUi ( Settings * settings,
const std::string & opt )

Definition at line 3 of file widget_ui.cpp.

3 :
5 opt(opt)
6{
7}
std::string opt
Definition widget_ui.hpp:34
Settings * settings
Definition widget_ui.hpp:33

◆ WidgetUi() [2/3]

WidgetUi::WidgetUi ( const WidgetUi & )
delete

◆ WidgetUi() [3/3]

WidgetUi::WidgetUi ( WidgetUi && )
delete

◆ ~WidgetUi()

WidgetUi::~WidgetUi ( )
virtual

Definition at line 9 of file widget_ui.cpp.

9 {
10 for(auto& i : registeredCallbacks){
11 settings->getOption(i.first).removeOnChangeCallback(i.second);
12 }
13}
void removeOnChangeCallback(const Callback &callback)
Definition settings.cpp:111
const Option & getOption(const std::string &opt) const
Definition settings.cpp:384
std::vector< std::pair< std::string, Option::Callback > > registeredCallbacks
Definition widget_ui.hpp:35

References Settings::getOption(), registeredCallbacks, Option::removeOnChangeCallback(), and settings.

Here is the call graph for this function:

Member Function Documentation

◆ changed

◆ connectSignals()

virtual void WidgetUi::connectSignals ( )
protectedpure virtual

◆ operator=() [1/2]

WidgetUi & WidgetUi::operator= ( const WidgetUi & )
delete

◆ operator=() [2/2]

WidgetUi & WidgetUi::operator= ( WidgetUi && )
delete

◆ optChangeCallback()

virtual void WidgetUi::optChangeCallback ( Option & opt,
bool suboption )
protectedpure virtual

◆ optChangeCallbackStatic()

void WidgetUi::optChangeCallbackStatic ( Option & opt,
bool subopt,
void * opaque )
staticprotected

Definition at line 21 of file widget_ui.cpp.

21 {
22 static_cast<WidgetUi *>(opaque)->optChangeCallback(opt, subopt);
23}
virtual void optChangeCallback(Option &opt, bool suboption)=0

References opt, and optChangeCallback().

Referenced by registerCallback().

Here is the call graph for this function:

◆ refresh()

virtual void WidgetUi::refresh ( )
inlinevirtual

Reimplemented in ComboBoxUi.

Definition at line 25 of file widget_ui.hpp.

25{ }

◆ registerCallback() [1/2]

void WidgetUi::registerCallback ( )
protected

Definition at line 57 of file widget_ui.cpp.

57 {
59}
void registerCallback()
Definition widget_ui.cpp:57

References opt, and registerCallback().

Referenced by CheckableUi::CheckableUi(), ComboBoxUi::ComboBoxUi(), RadioButtonUi::RadioButtonUi(), TextOptUi::TextOptUi(), ComboBoxUi::refresh(), registerCallback(), and setOpt().

Here is the call graph for this function:

◆ registerCallback() [2/2]

void WidgetUi::registerCallback ( const std::string & option)

Definition at line 49 of file widget_ui.cpp.

49 {
50 if(option == "")
51 return;
52
55}
void registerCustomCallback(const std::string &option, Option::Callback callback, std::unique_ptr< ExtraCallbackData > &&extraDataPtr=nullptr)
Definition widget_ui.cpp:25
static void optChangeCallbackStatic(Option &, bool, void *)
Definition widget_ui.cpp:21
Option::Callback::fcn_type callback
Definition settings.cpp:251

References callback, optChangeCallbackStatic(), and registerCustomCallback().

Referenced by SettingsUi::initMainWin().

Here is the call graph for this function:

◆ registerCustomCallback()

void WidgetUi::registerCustomCallback ( const std::string & option,
Option::Callback callback,
std::unique_ptr< ExtraCallbackData > && extraDataPtr = nullptr )

Definition at line 25 of file widget_ui.cpp.

28{
29 if(option == "")
30 return;
31
32 std::pair<std::string, Option::Callback> elToInsert(option, callback);
33
34 auto it = std::find(registeredCallbacks.begin(),
35 registeredCallbacks.end(), elToInsert);
36 if(it != registeredCallbacks.end()){
37 return;
38 }
39
40
42 registeredCallbacks.push_back(elToInsert);
43
44 if(extraDataPtr)
45 extraData.emplace_back(std::move(extraDataPtr));
46
47}
void addOnChangeCallback(Callback callback)
Definition settings.cpp:107
std::vector< std::unique_ptr< ExtraCallbackData > > extraData
Definition widget_ui.hpp:36

References Option::addOnChangeCallback(), callback, extraData, Settings::getOption(), registeredCallbacks, and settings.

Referenced by SettingsUi::initMainWin(), and registerCallback().

Here is the call graph for this function:

◆ setOpt()

void WidgetUi::setOpt ( const std::string & opt)

Definition at line 15 of file widget_ui.cpp.

15 {
16 this->opt = opt;
19}
virtual void updateUiState()=0

References opt, registerCallback(), and updateUiState().

Referenced by videoCompressBitrateCallback().

Here is the call graph for this function:

◆ updateUiState()

virtual void WidgetUi::updateUiState ( )
protectedpure virtual

Member Data Documentation

◆ extraData

std::vector<std::unique_ptr<ExtraCallbackData> > WidgetUi::extraData
protected

Definition at line 36 of file widget_ui.hpp.

Referenced by registerCustomCallback().

◆ opt

◆ registeredCallbacks

std::vector<std::pair<std::string, Option::Callback> > WidgetUi::registeredCallbacks
protected

Definition at line 35 of file widget_ui.hpp.

Referenced by ~WidgetUi(), and registerCustomCallback().

◆ settings


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