Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
mitk::IPreferencesService Class Referenceabstract

A service for persistent application preferences. More...

#include <mitkIPreferencesService.h>

Inheritance diagram for mitk::IPreferencesService:

Public Member Functions

virtual ~IPreferencesService ()
 If initialized, ask the preferences backend to flush preferences, i.e. write them to disk. More...
 
virtual void InitializeStorage (const fs::path &filename)=0
 Initialize the preferences backend. More...
 
virtual void UninitializeStorage (bool removeFile=true)=0
 For internal use only. More...
 
virtual IPreferencesGetSystemPreferences ()=0
 Access preferences. More...
 

Detailed Description

A service for persistent application preferences.

See also
CoreServices::GetPreferencesService()
IPreferences

Definition at line 33 of file mitkIPreferencesService.h.

Constructor & Destructor Documentation

◆ ~IPreferencesService()

virtual mitk::IPreferencesService::~IPreferencesService ( )
virtual

If initialized, ask the preferences backend to flush preferences, i.e. write them to disk.

Member Function Documentation

◆ GetSystemPreferences()

virtual IPreferences* mitk::IPreferencesService::GetSystemPreferences ( )
pure virtual

Access preferences.

The system preferences should be considered as resource and as such their lifetime is coupled to this service. It is recommended to access the preferences always through this method as needed instead of keeping a pointer permanently.

Note
The term "system preferences" is kept for historical reasons to stay as API-compatible as possible to the previous preferences service. A more precise term would be "application preferences".
Returns
The root node of the preferences tree.

Implemented in mitk::PreferencesService.

◆ InitializeStorage()

virtual void mitk::IPreferencesService::InitializeStorage ( const fs::path &  filename)
pure virtual

Initialize the preferences backend.

Load preferences from the specified file. If the file does not yet exist, create an empty preferences storage.

This method must be called once at the start of an application before accessing any preferences via GetSystemPreferences().

Exceptions
ExceptionThe method is called more than once.
See also
IPreferencesStorage

Implemented in mitk::PreferencesService.

◆ UninitializeStorage()

virtual void mitk::IPreferencesService::UninitializeStorage ( bool  removeFile = true)
pure virtual

For internal use only.

This method is only used for testing purposes. Do not use in production code.

Implemented in mitk::PreferencesService.


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