2 * SPDX-FileCopyrightText: 2015 Ashish Bansal <bansal.ashish096@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0-or-later
15 class OrgKdeDolphinMainWindowInterface
;
19 QList
<QUrl
> validateUris(const QStringList
&uriList
);
22 * Returns the home url which is defined in General Settings
26 enum class OpenNewWindowFlag
{ None
= 0, Select
= 1 << 1 };
27 Q_DECLARE_FLAGS(OpenNewWindowFlags
, OpenNewWindowFlag
)
30 * Opens a new Dolphin window
32 void openNewWindow(const QList
<QUrl
> &urls
= {}, QWidget
*window
= nullptr, const OpenNewWindowFlags
&flags
= OpenNewWindowFlag::None
);
35 * Attaches URLs to an existing Dolphin instance if possible.
36 * If @p preferredService is a valid dbus service, it will be tried first.
37 * @p preferredService needs to support the org.kde.dolphin.MainWindow dbus interface with the /dolphin/Dolphin_1 path.
38 * Returns true if the URLs were successfully attached.
40 bool attachToExistingInstance(const QList
<QUrl
> &inputUrls
, bool openFiles
, bool splitView
, const QString
&preferredService
, const QString
&activationToken
);
43 * Returns a QVector with all GUI-capable Dolphin instances
45 QVector
<QPair
<QSharedPointer
<OrgKdeDolphinMainWindowInterface
>, QStringList
>> dolphinGuiInstances(const QString
&preferredService
);
47 QPair
<QString
, Qt::SortOrder
> sortOrderForUrl(QUrl
&url
);
50 * TODO: Use global KDE spacings instead of Dolphin-specific ones once we have them.
52 constexpr int VERTICAL_SPACER_HEIGHT
= 12;
53 constexpr int LAYOUT_SPACING_SMALL
= 4;
56 enum Animated
{ WithAnimation
, WithoutAnimation
};
58 class GlobalConfig
: public QObject
63 GlobalConfig() = delete;
66 * @return a value from the global KDE config that should be
67 * multiplied with every animation duration once.
68 * 0.0 is returned if animations are globally turned off.
69 * 1.0 is the default value.
71 static double animationDurationFactor();
74 static void updateAnimationDurationFactor(const KConfigGroup
&group
, const QByteArrayList
&names
);
77 static double s_animationDurationFactor
;