Ring Daemon 16.0.0
Loading...
Searching...
No Matches
preferenceservicesmanager.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include "preferencehandler.h"
20
21#include "noncopyable.h"
22
23#include <list>
24#include <map>
25#include <tuple>
26#include <memory>
27#include <vector>
28
29namespace jami {
30
31class PluginManager;
32
33using PreferenceHandlerPtr = std::unique_ptr<PreferenceHandler>;
34
40{
41public:
49
51
53
58 std::vector<std::string> getHandlers() const;
59
65 std::map<std::string, std::string> getHandlerDetails(
66 const std::string& preferenceHandlerIdStr) const;
67
76 bool setPreference(const std::string& key,
77 const std::string& value,
78 const std::string& rootPath,
79 const std::string& accountId);
80
86 void resetPreferences(const std::string& rootPath, const std::string& accountId);
87
88private:
93 void registerComponentsLifeCycleManagers(PluginManager& pluginManager);
94
95 // Components that a plugin can register through registerPreferenceHandler service.
96 std::list<PreferenceHandlerPtr> handlers_;
97};
98} // namespace jami
This class manages plugin (un)loading.
This class provides the interface between PreferenceHandlers and per account preferences.
void resetPreferences(const std::string &rootPath, const std::string &accountId)
Resets acc preferences to default values.
bool setPreference(const std::string &key, const std::string &value, const std::string &rootPath, const std::string &accountId)
Sets a preference.
std::vector< std::string > getHandlers() const
List all PreferenceHandlers available.
NON_COPYABLE(PreferenceServicesManager)
std::map< std::string, std::string > getHandlerDetails(const std::string &preferenceHandlerIdStr) const
Returns details Map from s implementation.
void emitSignal(Args... args)
Definition ring_signal.h:64
std::unique_ptr< PreferenceHandler > PreferenceHandlerPtr
Simple macro to hide class' copy constructor and assignment operator.