2020-11-05 22:30:07 +00:00
|
|
|
/*
|
|
|
|
This file is part of the KDE project
|
2023-06-04 16:09:42 +00:00
|
|
|
SPDX-FileCopyrightText: 2020 Felix Ernst <felixernst@kde.org>
|
2020-11-05 22:30:07 +00:00
|
|
|
|
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DOLPHINURLNAVIGATORSCONTROLLER_H
|
|
|
|
#define DOLPHINURLNAVIGATORSCONTROLLER_H
|
|
|
|
|
|
|
|
#include <KCompletion>
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include <forward_list>
|
|
|
|
|
|
|
|
class DolphinUrlNavigator;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief A controller managing all DolphinUrlNavigators.
|
|
|
|
*
|
|
|
|
* This class is used to apply settings changes to all constructed DolphinUrlNavigators.
|
|
|
|
*
|
|
|
|
* @see DolphinUrlNavigator
|
|
|
|
*/
|
|
|
|
class DolphinUrlNavigatorsController : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
DolphinUrlNavigatorsController() = delete;
|
|
|
|
|
2021-02-08 22:09:59 +00:00
|
|
|
public Q_SLOTS:
|
2020-11-05 22:30:07 +00:00
|
|
|
/**
|
|
|
|
* Refreshes all DolphinUrlNavigators to get synchronized with the
|
|
|
|
* Dolphin settings if they were changed.
|
|
|
|
*/
|
|
|
|
static void slotReadSettings();
|
|
|
|
|
|
|
|
static void slotPlacesPanelVisibilityChanged(bool visible);
|
|
|
|
|
|
|
|
private:
|
|
|
|
/**
|
2021-12-06 12:59:23 +00:00
|
|
|
* @return whether the places selector of DolphinUrlNavigators should be visible.
|
2020-11-05 22:30:07 +00:00
|
|
|
*/
|
|
|
|
static bool placesSelectorVisible();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds \p dolphinUrlNavigator to the list of DolphinUrlNavigators
|
|
|
|
* controlled by this class.
|
|
|
|
*/
|
|
|
|
static void registerDolphinUrlNavigator(DolphinUrlNavigator *dolphinUrlNavigator);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes \p dolphinUrlNavigator from the list of DolphinUrlNavigators
|
|
|
|
* controlled by this class.
|
|
|
|
*/
|
|
|
|
static void unregisterDolphinUrlNavigator(DolphinUrlNavigator *dolphinUrlNavigator);
|
|
|
|
|
2021-02-08 22:09:59 +00:00
|
|
|
private Q_SLOTS:
|
2020-11-05 22:30:07 +00:00
|
|
|
/**
|
|
|
|
* Sets the completion mode for all DolphinUrlNavigators and saves it in settings.
|
|
|
|
*/
|
|
|
|
static void setCompletionMode(const KCompletion::CompletionMode completionMode);
|
|
|
|
|
|
|
|
private:
|
|
|
|
/** Contains all currently constructed DolphinUrlNavigators */
|
|
|
|
static std::forward_list<DolphinUrlNavigator *> s_instances;
|
|
|
|
|
|
|
|
/** Caches the (negated) places panel visibility */
|
|
|
|
static bool s_placesSelectorVisible;
|
|
|
|
|
|
|
|
friend class DolphinUrlNavigator;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DOLPHINURLNAVIGATORSCONTROLLER_H
|