Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::PrefBase< T > Class Template Reference

#include <preferences.h>

Inheritance diagram for Inkscape::PrefBase< T >:
Inkscape::Preferences::Observer

Public Member Functions

 operator const T & () const
 The current value.
 
void set_enabled (bool enabled)
 Disable switch. If disabled, the Pref will stick at its default value.
 
- Public Member Functions inherited from Inkscape::Preferences::Observer
 Observer (Glib::ustring path)
 Constructor.
 
virtual ~Observer ()
 

Public Attributes

def
 The default value.
 
std::function< void()> action
 The action to perform when the value changes, if any.
 
- Public Attributes inherited from Inkscape::Preferences::Observer
Glib::ustring const observed_path
 Path which the observer watches.
 

Protected Member Functions

 PrefBase (Glib::ustring path, T def)
 
 PrefBase (PrefBase const &)=delete
 
PrefBaseoperator= (PrefBase const &)=delete
 
void init ()
 
void act ()
 
void assign (T const &val2)
 
void enable ()
 
void disable ()
 
void notify (Preferences::Entry const &e) override
 Notification about a preference change.
 

Protected Attributes

val
 

Detailed Description

template<typename T>
class Inkscape::PrefBase< T >

Definition at line 806 of file preferences.h.

Constructor & Destructor Documentation

◆ PrefBase() [1/2]

template<typename T >
Inkscape::PrefBase< T >::PrefBase ( Glib::ustring  path,
def 
)
inlineprotected

Definition at line 824 of file preferences.h.

◆ PrefBase() [2/2]

template<typename T >
Inkscape::PrefBase< T >::PrefBase ( PrefBase< T > const &  )
protecteddelete

Member Function Documentation

◆ act()

template<typename T >
void Inkscape::PrefBase< T >::act ( )
inlineprotected

Definition at line 829 of file preferences.h.

References Inkscape::PrefBase< T >::action.

Referenced by Inkscape::PrefBase< T >::assign().

◆ assign()

template<typename T >
void Inkscape::PrefBase< T >::assign ( T const &  val2)
inlineprotected

◆ disable()

◆ enable()

template<typename T >
void Inkscape::PrefBase< T >::enable ( )
inlineprotected

◆ init()

template<typename T >
void Inkscape::PrefBase< T >::init ( )
inlineprotected

◆ notify()

template<typename T >
void Inkscape::PrefBase< T >::notify ( Preferences::Entry const &  new_val)
inlineoverrideprotectedvirtual

Notification about a preference change.

Parameters
new_valEntry object containing information about the modified preference.

Implements Inkscape::Preferences::Observer.

Definition at line 833 of file preferences.h.

References Inkscape::PrefBase< T >::assign().

◆ operator const T &()

template<typename T >
Inkscape::PrefBase< T >::operator const T & ( ) const
inline

The current value.

Definition at line 813 of file preferences.h.

◆ operator=()

template<typename T >
PrefBase & Inkscape::PrefBase< T >::operator= ( PrefBase< T > const &  )
protecteddelete

◆ set_enabled()

template<typename T >
void Inkscape::PrefBase< T >::set_enabled ( bool  enabled)
inline

Disable switch. If disabled, the Pref will stick at its default value.

Definition at line 819 of file preferences.h.

References Inkscape::PrefBase< T >::disable(), and Inkscape::PrefBase< T >::enable().

Referenced by Inkscape::UI::Widget::Prefs::set_devmode().

Member Data Documentation

◆ action

template<typename T >
std::function<void()> Inkscape::PrefBase< T >::action

◆ def

template<typename T >
T Inkscape::PrefBase< T >::def

The default value.

Definition at line 810 of file preferences.h.

Referenced by Inkscape::PrefBase< T >::disable().

◆ val

template<typename T >
T Inkscape::PrefBase< T >::val
protected

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