/* This file is part of KDDockWidgets. SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company Author: Sérgio Martins SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only Contact KDAB at for commercial licensing options. */ #ifndef KDDOCKWIDGETS_PLATFORM_QTWIDGETS_H #define KDDOCKWIDGETS_PLATFORM_QTWIDGETS_H #pragma once #include "kddockwidgets/qtcommon/Platform.h" namespace KDDockWidgets { namespace Core { class MainWindow; } namespace QtWidgets { /// @brief implements functions specific to a particular platform /// A platform can be for example qtwidgets, qtquick, etc. class DOCKS_EXPORT Platform : public QtCommon::Platform_qt { public: Platform(); ~Platform() override; const char *name() const override; bool hasActivePopup() const override; std::shared_ptr qobjectAsView(QObject *) const override; std::shared_ptr windowFromQWindow(QWindow *) const override; Core::ViewFactory *createDefaultViewFactory() override; std::shared_ptr windowAt(QPoint globalPos) const override; int screenNumberForView(Core::View *) const override; QSize screenSizeFor(Core::View *) const override; int startDragDistance_impl() const override; Core::View *createView(Core::Controller *controller, Core::View *parent = nullptr) const override; bool inDisallowedDragView(QPoint globalPos) const override; bool usesFallbackMouseGrabber() const override; void ungrabMouse() override; #ifdef DOCKS_TESTING_METHODS explicit Platform(int &argc, char **argv, bool defaultToOffscreenQPA); void tests_initPlatform_impl() override; void tests_deinitPlatform_impl() override; Core::View *tests_createView(Core::CreateViewOptions, Core::View *parent = nullptr) override; Core::View *tests_createFocusableView(Core::CreateViewOptions, Core::View *parent = nullptr) override; Core::View *tests_createNonClosableView(Core::View *parent = nullptr) override; std::shared_ptr tests_createWindow() override; Core::MainWindow * createMainWindow(const QString &uniqueName, Core::CreateViewOptions, MainWindowOptions options = MainWindowOption_HasCentralGroup, Core::View *parent = nullptr, Qt::WindowFlags = {}) const override; #endif protected: void init(); class GlobalEventFilter; GlobalEventFilter *const m_globalEventFilter; }; } } #endif