Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::Preferences::PreferencesObserver Class Reference

Callback-based preferences observer. More...

#include <preferences.h>

Inheritance diagram for Inkscape::Preferences::PreferencesObserver:
Inkscape::Preferences::Observer

Public Member Functions

 ~PreferencesObserver () override=default
 
void call ()
 Manually call the observer with the original, unchanged value.
 

Static Public Member Functions

static std::unique_ptr< PreferencesObservercreate (Glib::ustring path, std::function< void(const Preferences::Entry &new_value)> callback)
 

Private Member Functions

 PreferencesObserver (Glib::ustring path, std::function< void(const Preferences::Entry &new_value)> callback)
 
void notify (Preferences::Entry const &new_val) override
 Notification about a preference change.
 
- Private Member Functions inherited from Inkscape::Preferences::Observer
 Observer (Glib::ustring path)
 Constructor.
 
virtual ~Observer ()
 

Private Attributes

std::function< void(const Preferences::Entry &)> _callback
 
- Private Attributes inherited from Inkscape::Preferences::Observer
Glib::ustring const observed_path
 Path which the observer watches.
 

Detailed Description

Callback-based preferences observer.

Definition at line 124 of file preferences.h.

Constructor & Destructor Documentation

◆ ~PreferencesObserver()

Inkscape::Preferences::PreferencesObserver::~PreferencesObserver ( )
overridedefault

◆ PreferencesObserver()

Inkscape::Preferences::PreferencesObserver::PreferencesObserver ( Glib::ustring  path,
std::function< void(const Preferences::Entry &new_value)>  callback 
)
private

Definition at line 1181 of file preferences.cpp.

References Inkscape::Preferences::get().

Member Function Documentation

◆ call()

void Inkscape::Preferences::PreferencesObserver::call ( )

Manually call the observer with the original, unchanged value.

This is useful for initialisation functions.

Definition at line 1192 of file preferences.cpp.

References Inkscape::Preferences::get().

◆ create()

PrefObserver Inkscape::Preferences::PreferencesObserver::create ( Glib::ustring  path,
std::function< void(const Preferences::Entry &new_value)>  callback 
)
static

◆ notify()

void Inkscape::Preferences::PreferencesObserver::notify ( Preferences::Entry const &  new_val)
overrideprivatevirtual

Notification about a preference change.

Parameters
new_valEntry object containing information about the modified preference.

Implements Inkscape::Preferences::Observer.

Definition at line 1188 of file preferences.cpp.

Member Data Documentation

◆ _callback

std::function<void (const Preferences::Entry&)> Inkscape::Preferences::PreferencesObserver::_callback
private

Definition at line 137 of file preferences.h.


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