2 * SPDX-FileCopyrightText: 2015 Ashish Bansal <bansal.ashish096@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0-or-later
15 class OrgKdeDolphinMainWindowInterface
;
18 QList
<QUrl
> validateUris(const QStringList
& uriList
);
21 * Returns the home url which is defined in General Settings
25 enum class OpenNewWindowFlag
{
29 Q_DECLARE_FLAGS(OpenNewWindowFlags
, OpenNewWindowFlag
)
32 * Opens a new Dolphin window
34 void openNewWindow(const QList
<QUrl
> &urls
= {}, QWidget
*window
= nullptr, const OpenNewWindowFlags
&flags
= OpenNewWindowFlag::None
);
37 * Attaches URLs to an existing Dolphin instance if possible.
38 * If @p preferredService is a valid dbus service, it will be tried first.
39 * @p preferredService needs to support the org.kde.dolphin.MainWindow dbus interface with the /dolphin/Dolphin_1 path.
40 * Returns true if the URLs were successfully attached.
42 bool attachToExistingInstance(const QList
<QUrl
>& inputUrls
, bool openFiles
, bool splitView
, const QString
& preferredService
, const QString
&activationToken
);
45 * Returns a QVector with all GUI-capable Dolphin instances
47 QVector
<QPair
<QSharedPointer
<OrgKdeDolphinMainWindowInterface
>, QStringList
>> dolphinGuiInstances(const QString
& preferredService
);
49 QPair
<QString
, Qt::SortOrder
> sortOrderForUrl(QUrl
&url
);
52 * TODO: Move this somewhere global to all KDE apps, not just Dolphin
54 const int VERTICAL_SPACER_HEIGHT
= 12;
55 const int LAYOUT_SPACING_SMALL
= 2;
63 class GlobalConfig
: public QObject
68 GlobalConfig() = delete;
71 * @return a value from the global KDE config that should be
72 * multiplied with every animation duration once.
73 * 0.0 is returned if animations are globally turned off.
74 * 1.0 is the default value.
76 static double animationDurationFactor();
79 static void updateAnimationDurationFactor(const KConfigGroup
&group
, const QByteArrayList
&names
);
82 static double s_animationDurationFactor
;