2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2020 Felix Ernst <felixernst@kde.org>
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
8 #ifndef DOLPHINURLNAVIGATORSCONTROLLER_H
9 #define DOLPHINURLNAVIGATORSCONTROLLER_H
11 #include <KCompletion>
15 #include <forward_list>
17 class DolphinUrlNavigator
;
20 * @brief A controller managing all DolphinUrlNavigators.
22 * This class is used to apply settings changes to all constructed DolphinUrlNavigators.
24 * @see DolphinUrlNavigator
26 class DolphinUrlNavigatorsController
: public QObject
31 DolphinUrlNavigatorsController() = delete;
35 * Refreshes all DolphinUrlNavigators to get synchronized with the
36 * Dolphin settings if they were changed.
38 static void slotReadSettings();
40 static void slotPlacesPanelVisibilityChanged(bool visible
);
44 * @return whether the places selector of DolphinUrlNavigators should be visible.
46 static bool placesSelectorVisible();
49 * Adds \p dolphinUrlNavigator to the list of DolphinUrlNavigators
50 * controlled by this class.
52 static void registerDolphinUrlNavigator(DolphinUrlNavigator
*dolphinUrlNavigator
);
55 * Removes \p dolphinUrlNavigator from the list of DolphinUrlNavigators
56 * controlled by this class.
58 static void unregisterDolphinUrlNavigator(DolphinUrlNavigator
*dolphinUrlNavigator
);
62 * Sets the completion mode for all DolphinUrlNavigators and saves it in settings.
64 static void setCompletionMode(const KCompletion::CompletionMode completionMode
);
67 /** Contains all currently constructed DolphinUrlNavigators */
68 static std::forward_list
<DolphinUrlNavigator
*> s_instances
;
70 /** Caches the (negated) places panel visibility */
71 static bool s_placesSelectorVisible
;
73 friend class DolphinUrlNavigator
;
76 #endif // DOLPHINURLNAVIGATORSCONTROLLER_H