diff --git a/src/platformtheme/kdeplatformfiledialogbase_p.h b/src/platformtheme/kdeplatformfiledialogbase_p.h index 487bdbb..118f35a 100644 --- a/src/platformtheme/kdeplatformfiledialogbase_p.h +++ b/src/platformtheme/kdeplatformfiledialogbase_p.h @@ -1,63 +1,62 @@ /* This file is part of the KDE libraries * Copyright 2013 Aleix Pol Gonzalez * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KDEPLATFORMFILEDIALOGBASE_H #define KDEPLATFORMFILEDIALOGBASE_H #include #include #include -class KFileWidget; class QDialogButtonBox; class KDEPlatformFileDialogBase : public QDialog { Q_OBJECT public: friend class KDEPlatformFileDialogHelper; explicit KDEPlatformFileDialogBase(); virtual QUrl directory() = 0; virtual void selectMimeTypeFilter(const QString &filter) = 0; virtual void selectNameFilter(const QString &filter) = 0; virtual void setDirectory(const QUrl &directory) = 0; virtual void selectFile(const QUrl &filename) = 0; virtual QString selectedMimeTypeFilter() = 0; virtual QString selectedNameFilter() = 0; virtual QList selectedFiles() = 0; void delayedShow(); void discardDelayedShow(); Q_SIGNALS: void closed(); void fileSelected(const QUrl &file); void filesSelected(const QList &files); void currentChanged(const QUrl &path); void directoryEntered(const QUrl &directory); void filterSelected(const QString &filter); protected: void closeEvent(QCloseEvent *e) override; QDialogButtonBox *m_buttons; QTimer m_timer; }; #endif diff --git a/src/platformtheme/kdeplatformfiledialoghelper.h b/src/platformtheme/kdeplatformfiledialoghelper.h index f84c23b..dc61505 100644 --- a/src/platformtheme/kdeplatformfiledialoghelper.h +++ b/src/platformtheme/kdeplatformfiledialoghelper.h @@ -1,88 +1,87 @@ /* This file is part of the KDE libraries * Copyright 2013 Aleix Pol Gonzalez * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KDEPLATFORMFILEDIALOGHELPER_H #define KDEPLATFORMFILEDIALOGHELPER_H #include #include "kdeplatformfiledialogbase_p.h" class KFileWidget; -class QDialogButtonBox; class KDEPlatformFileDialog : public KDEPlatformFileDialogBase { Q_OBJECT public: friend class KDEPlatformFileDialogHelper; explicit KDEPlatformFileDialog(); QUrl directory() override; void selectMimeTypeFilter(const QString &filter) override; void selectNameFilter(const QString &filter) override; void setDirectory(const QUrl &directory) override; void selectFile(const QUrl &filename) override; void setViewMode(QFileDialogOptions::ViewMode view); void setFileMode(QFileDialogOptions::FileMode mode); void setCustomLabel(QFileDialogOptions::DialogLabel label, const QString & text); QString selectedMimeTypeFilter() override; QString selectedNameFilter() override; QList selectedFiles() override; protected: KFileWidget *m_fileWidget; }; class KDEPlatformFileDialogHelper : public QPlatformFileDialogHelper { Q_OBJECT public: KDEPlatformFileDialogHelper(); ~KDEPlatformFileDialogHelper() override; void initializeDialog(); bool defaultNameFilterDisables() const override; QUrl directory() const override; QList selectedFiles() const override; QString selectedMimeTypeFilter() const override; void selectMimeTypeFilter(const QString &filter) override; QString selectedNameFilter() const override; void selectNameFilter(const QString &filter) override; void selectFile(const QUrl &filename) override; void setFilter() override; void setDirectory(const QUrl &directory) override; bool isSupportedUrl(const QUrl& url) const override; void exec() override; void hide() override; bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override; private Q_SLOTS: void saveSize(); private: void restoreSize(); KDEPlatformFileDialogBase *m_dialog; bool m_directorySet = false; bool m_fileSelected = false; bool m_dialogInitialized = false; }; #endif // KDEPLATFORMFILEDIALOGHELPER_H diff --git a/src/platformtheme/kdeplatformtheme.h b/src/platformtheme/kdeplatformtheme.h index f1cf5e5..6a327d9 100644 --- a/src/platformtheme/kdeplatformtheme.h +++ b/src/platformtheme/kdeplatformtheme.h @@ -1,76 +1,75 @@ /* This file is part of the KDE libraries * Copyright 2013 Kevin Ottens * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KDEPLATFORMTHEME_H #define KDEPLATFORMTHEME_H #include #include #include #include class KHintsSettings; class KFontSettingsData; class KWaylandIntegration; class X11Integration; class QIconEngine; class QWindow; -class AltKeyEventListener; class KdePlatformTheme : public QPlatformTheme { public: KdePlatformTheme(); ~KdePlatformTheme() override; QVariant themeHint(ThemeHint hint) const override; QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions) const override; const QPalette *palette(Palette type = SystemPalette) const override; const QFont *font(Font type) const override; QIconEngine *createIconEngine(const QString &iconName) const override; QList keyBindings(QKeySequence::StandardKey key) const override; QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const override; bool usePlatformNativeDialog(DialogType type) const override; QString standardButtonText(int button) const override; QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override; QPlatformMenuBar *createPlatformMenuBar() const override; private: void loadSettings(); void setQtQuickControlsTheme(); static void setWindowProperty(QWindow *window, const QByteArray &name, const QByteArray &value); KHintsSettings *m_hints; KFontSettingsData *m_fontsData; QScopedPointer m_kwaylandIntegration; QScopedPointer m_x11Integration; }; #endif // KDEPLATFORMTHEME_H diff --git a/src/platformtheme/kwaylandintegration.h b/src/platformtheme/kwaylandintegration.h index 7c4653d..bc29628 100644 --- a/src/platformtheme/kwaylandintegration.h +++ b/src/platformtheme/kwaylandintegration.h @@ -1,68 +1,67 @@ /* This file is part of the KDE libraries * Copyright 2015 Martin Gräßlin * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License or ( at * your option ) version 3 or, at the discretion of KDE e.V. ( which shall * act as a proxy as in section 14 of the GPLv3 ), any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KWAYLANDINTEGRATION_H #define KWAYLANDINTEGRATION_H #include #include class QWindow; namespace KWayland { namespace Client { -class ServerSideDecorationManager; class ServerSideDecorationPaletteManager; class AppMenuManager; class Registry; } } class KWaylandIntegration : public QObject { Q_OBJECT public: explicit KWaylandIntegration(); ~KWaylandIntegration() override; void init(); void setAppMenu(QWindow *window, const QString &serviceName, const QString &objectPath); void setPalette(QWindow *window, const QString &paletteName); bool eventFilter(QObject *watched, QEvent *event) override; private: void shellSurfaceCreated(QWindow *w); void shellSurfaceDestroyed(QWindow *w); void installColorScheme(QWindow *w); KWayland::Client::AppMenuManager *m_appMenuManager = nullptr; KWayland::Client::ServerSideDecorationPaletteManager *m_paletteManager = nullptr; KWayland::Client::Registry* m_registry = nullptr; struct WindowInfo { QString appMenuServiceName; QString appMenuObjectPath; }; QHash m_windowInfo; }; #endif