14#include "kddockwidgets/docks_export.h"
16#include "kddockwidgets/KDDockWidgets.h"
17#include "kddockwidgets/QtCompat_p.h"
26class EventFilterInterface;
27struct CreateViewOptions;
28class ClassicDropIndicatorOverlay;
29class SegmentedDropIndicatorOverlay;
50 virtual const char *
name()
const = 0;
57 static bool hasInstance();
61 virtual bool hasActivePopup()
const;
73 virtual std::shared_ptr<Core::Window>
windowAt(Point globalPos)
const = 0;
92 bool isQtWidgets()
const;
95 bool isQtQuick()
const;
104 int startDragDistance()
const;
195 virtual bool supportsAeroSnap()
const;
198 static std::vector<KDDockWidgets::FrontendType> frontendTypes();
201 static bool isInitialized();
203#if defined(DOCKS_DEVELOPER_MODE) && !defined(DARTAGNAN_BINDINGS_RUN)
205#define DEFAULT_TIMEOUT 20000
212 virtual KDDW_QCORO_TASK tests_wait(
int ms)
const = 0;
216 virtual KDDW_QCORO_TASK tests_waitForResize(
View *,
int timeout = DEFAULT_TIMEOUT)
const = 0;
217 virtual KDDW_QCORO_TASK tests_waitForResize(
Controller *,
int timeout = DEFAULT_TIMEOUT)
const = 0;
218 virtual KDDW_QCORO_TASK tests_waitForDeleted(
View *,
int timeout = DEFAULT_TIMEOUT)
const = 0;
219 virtual KDDW_QCORO_TASK tests_waitForDeleted(
Controller *,
int timeout = DEFAULT_TIMEOUT)
const = 0;
224 virtual KDDW_QCORO_TASK tests_waitForWindowActive(std::shared_ptr<Core::Window>,
int timeout = DEFAULT_TIMEOUT)
const = 0;
228 virtual KDDW_QCORO_TASK tests_waitForEvent(Core::Object *w, Event::Type type,
int timeout = DEFAULT_TIMEOUT)
const = 0;
229 virtual KDDW_QCORO_TASK tests_waitForEvent(
View *, Event::Type type,
int timeout = DEFAULT_TIMEOUT)
const = 0;
230 virtual KDDW_QCORO_TASK tests_waitForEvent(std::shared_ptr<Core::Window>, Event::Type type,
231 int timeout = DEFAULT_TIMEOUT)
const = 0;
233 virtual void tests_doubleClickOn(Point globalPos,
View *receiver) = 0;
234 virtual void tests_doubleClickOn(Point globalPos, std::shared_ptr<Core::Window> receiver) = 0;
235 virtual void tests_pressOn(Point globalPos,
View *receiver) = 0;
236 virtual void tests_pressOn(Point globalPos, std::shared_ptr<Core::Window> receiver) = 0;
237 virtual KDDW_QCORO_TASK tests_releaseOn(Point globalPos,
View *receiver) = 0;
238 virtual KDDW_QCORO_TASK tests_mouseMove(Point globalPos,
View *receiver) = 0;
242 virtual std::shared_ptr<Core::Window> tests_createWindow() = 0;
250 static void tests_deinitPlatform();
252 std::string m_expectedWarning;
255#ifdef DOCKS_TESTING_METHODS
257 class WarningObserver
261 WarningObserver() =
default;
262 virtual ~WarningObserver();
263 virtual void onFatal() = 0;
269 virtual View *tests_createView(CreateViewOptions,
View *parent =
nullptr) = 0;
273 virtual View *tests_createFocusableView(CreateViewOptions,
View *parent =
nullptr) = 0;
276 virtual View *tests_createNonClosableView(
View *parent =
nullptr) = 0;
278 virtual void installMessageHandler() = 0;
279 virtual void uninstallMessageHandler() = 0;
284 createMainWindow(
const QString &uniqueName, CreateViewOptions,
285 MainWindowOptions options = MainWindowOption_HasCentralFrame,
288 virtual void pauseForDebugger();
293 virtual void tests_initPlatform_impl()
299 virtual void tests_deinitPlatform_impl()
310 virtual int startDragDistance_impl()
const;
317#if defined(DOCKS_DEVELOPER_MODE)
319#if !defined(DARTAGNAN_BINDINGS_RUN)
321struct SetExpectedWarning
323 explicit SetExpectedWarning(
const std::string &s)
326 Platform::instance()->m_expectedWarning = s;
329 ~SetExpectedWarning()
331 Platform::instance()->m_expectedWarning.clear();
341#if defined(DOCKS_TESTING_METHODS)
343struct CreateViewOptions
345 bool isVisible =
false;
347 Size minSize = { 0, 0 };
348 Size maxSize = Size(16777215, 16777215);
349 Size size = { 1000, 1000 };
350 bool createWindow =
false;
352 Size getMinSize()
const
357 Size getMaxSize()
const
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...