]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinurlnavigatorscontroller.h
dolphinmainwindow: zoom action is now a KToolBarPopupAction
[dolphin.git] / src / dolphinurlnavigatorscontroller.h
1 /*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2020 Felix Ernst <felixernst@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 */
7
8 #ifndef DOLPHINURLNAVIGATORSCONTROLLER_H
9 #define DOLPHINURLNAVIGATORSCONTROLLER_H
10
11 #include <KCompletion>
12
13 #include <QObject>
14
15 #include <forward_list>
16
17 class DolphinUrlNavigator;
18
19 /**
20 * @brief A controller managing all DolphinUrlNavigators.
21 *
22 * This class is used to apply settings changes to all constructed DolphinUrlNavigators.
23 *
24 * @see DolphinUrlNavigator
25 */
26 class DolphinUrlNavigatorsController : public QObject
27 {
28 Q_OBJECT
29
30 public:
31 DolphinUrlNavigatorsController() = delete;
32
33 public Q_SLOTS:
34 /**
35 * Refreshes all DolphinUrlNavigators to get synchronized with the
36 * Dolphin settings if they were changed.
37 */
38 static void slotReadSettings();
39
40 static void slotPlacesPanelVisibilityChanged(bool visible);
41
42 private:
43 /**
44 * @return whether the places selector of DolphinUrlNavigators should be visible.
45 */
46 static bool placesSelectorVisible();
47
48 /**
49 * Adds \p dolphinUrlNavigator to the list of DolphinUrlNavigators
50 * controlled by this class.
51 */
52 static void registerDolphinUrlNavigator(DolphinUrlNavigator *dolphinUrlNavigator);
53
54 /**
55 * Removes \p dolphinUrlNavigator from the list of DolphinUrlNavigators
56 * controlled by this class.
57 */
58 static void unregisterDolphinUrlNavigator(DolphinUrlNavigator *dolphinUrlNavigator);
59
60 private Q_SLOTS:
61 /**
62 * Sets the completion mode for all DolphinUrlNavigators and saves it in settings.
63 */
64 static void setCompletionMode(const KCompletion::CompletionMode completionMode);
65
66 private:
67 /** Contains all currently constructed DolphinUrlNavigators */
68 static std::forward_list<DolphinUrlNavigator *> s_instances;
69
70 /** Caches the (negated) places panel visibility */
71 static bool s_placesSelectorVisible;
72
73 friend class DolphinUrlNavigator;
74 };
75
76 #endif // DOLPHINURLNAVIGATORSCONTROLLER_H