KDDockWidgets API Documentation  1.5
FrameworkWidgetFactory.h
Go to the documentation of this file.
1 /*
2  This file is part of KDDockWidgets.
3 
4  SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5  Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6 
7  SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8 
9  Contact KDAB at <info@kdab.com> for commercial licensing options.
10 */
11 
12 #ifndef KDDOCKWIDGETS_FRAMEWORKWIDGETFACTORY_H
13 #define KDDOCKWIDGETS_FRAMEWORKWIDGETFACTORY_H
14 
15 #include "docks_export.h"
16 #include "KDDockWidgets.h"
17 #include "QWidgetAdapter.h"
18 
19 // clazy:excludeall=ctor-missing-parent-argument
20 
28 QT_BEGIN_NAMESPACE
29 class QAbstractButton;
30 QT_END_NAMESPACE
31 
32 namespace Layouting {
33 class Separator;
34 class Widget;
35 }
36 
37 namespace KDDockWidgets {
38 
39 class MainWindowBase;
40 class DropIndicatorOverlayInterface;
41 class FloatingWindow;
42 class TabWidget;
43 class TitleBar;
44 class Frame;
45 class DropArea;
46 class SideBar;
47 class TabBar;
48 class TabWidgetQuick;
49 
67 class DOCKS_EXPORT FrameworkWidgetFactory : public QObject
68 {
69  Q_OBJECT
70 public:
72 
75  virtual ~FrameworkWidgetFactory();
76 
83  virtual Frame *createFrame(QWidgetOrQuick *parent = nullptr, FrameOptions options = FrameOption_None) const = 0;
84 
89  virtual TitleBar *createTitleBar(Frame *frame) const = 0;
90 
95  virtual TitleBar *createTitleBar(FloatingWindow *floatingWindow) const = 0;
96 
100  virtual TabWidget *createTabWidget(Frame *parent) const = 0;
101 
105  virtual TabBar *createTabBar(TabWidget *parent = nullptr) const = 0;
106 
111  virtual Layouting::Separator *createSeparator(Layouting::Widget *parent = nullptr) const = 0;
112 
117  virtual FloatingWindow *createFloatingWindow(MainWindowBase *parent = nullptr) const = 0;
118 
124  virtual FloatingWindow *createFloatingWindow(Frame *frame, MainWindowBase *parent = nullptr, QRect suggestedGeometry = {}) const = 0;
125 
129  virtual DropIndicatorOverlayInterface *createDropIndicatorOverlay(DropArea *dropArea) const = 0;
130 
133  virtual QWidgetOrQuick *createRubberBand(QWidgetOrQuick *parent) const = 0;
134 
138  virtual SideBar *createSideBar(SideBarLocation loc, MainWindowBase *parent) const = 0;
139 
140 #ifdef KDDOCKWIDGETS_QTWIDGETS
141  virtual QAbstractButton *createTitleBarButton(QWidget *parent, TitleBarButtonType) const = 0;
144 #else
145  virtual QUrl titleBarFilename() const = 0;
146  virtual QUrl dockwidgetFilename() const = 0;
147  virtual QUrl frameFilename() const = 0;
148  virtual QUrl floatingWindowFilename() const = 0;
149 #endif
150 
153  virtual QIcon iconForButtonType(TitleBarButtonType type, qreal dpr) const = 0;
154 
155 private:
156  Q_DISABLE_COPY(FrameworkWidgetFactory)
157 };
158 
162 class DOCKS_EXPORT DefaultWidgetFactory : public FrameworkWidgetFactory
163 {
164  Q_OBJECT
165 public:
166  DefaultWidgetFactory() = default;
167  Frame *createFrame(QWidgetOrQuick *parent, FrameOptions) const override;
168  TitleBar *createTitleBar(Frame *) const override;
169  TitleBar *createTitleBar(FloatingWindow *) const override;
170  TabWidget *createTabWidget(Frame *parent) const override;
171  TabBar *createTabBar(TabWidget *parent) const override;
172  Layouting::Separator *createSeparator(Layouting::Widget *parent = nullptr) const override;
173  FloatingWindow *createFloatingWindow(MainWindowBase *parent = nullptr) const override;
174  FloatingWindow *createFloatingWindow(Frame *frame, MainWindowBase *parent = nullptr, QRect suggestedGeometry = {}) const override;
175  DropIndicatorOverlayInterface *createDropIndicatorOverlay(DropArea *) const override;
176  QWidgetOrQuick *createRubberBand(QWidgetOrQuick *parent) const override;
177  SideBar *createSideBar(SideBarLocation loc, MainWindowBase *parent) const override;
178 
179 #ifdef KDDOCKWIDGETS_QTWIDGETS
180  QAbstractButton *createTitleBarButton(QWidget *parent, TitleBarButtonType) const override;
181 #else
182  Q_INVOKABLE QUrl titleBarFilename() const override;
183  QUrl dockwidgetFilename() const override;
184  QUrl frameFilename() const override;
185  QUrl floatingWindowFilename() const override;
186 #endif
187 
188  QIcon iconForButtonType(TitleBarButtonType type, qreal dpr) const override;
189 
191 
192 private:
193  Q_DISABLE_COPY(DefaultWidgetFactory)
194 };
195 
196 }
197 
198 #endif
KDDockWidgets::FrameworkWidgetFactory::createTitleBar
virtual TitleBar * createTitleBar(Frame *frame) const =0
Called internally by the framework to create a TitleBar Override to provide your own TitleBar sub-cla...
KDDockWidgets::FrameworkWidgetFactory::iconForButtonType
virtual QIcon iconForButtonType(TitleBarButtonType type, qreal dpr) const =0
Returns the icon to be used with the specified type.
QUrl
KDDockWidgets::FrameOption_None
@ FrameOption_None
Definition: KDDockWidgets.h:260
QRect
KDDockWidgets.h
File with KDDockWidgets namespace-level enums and methods.
KDDockWidgets::TitleBarButtonType
TitleBarButtonType
describes a type of button you can have in the title bar
Definition: KDDockWidgets.h:221
QWidget
KDDockWidgets::FrameworkWidgetFactory::FrameworkWidgetFactory
FrameworkWidgetFactory()=default
KDDockWidgets::DropIndicatorType
DropIndicatorType
Definition: KDDockWidgets.h:192
Separator
KDDockWidgets::DefaultWidgetFactory
The FrameworkWidgetFactory that's used if none is specified.
Definition: FrameworkWidgetFactory.h:163
QWidgetAdapter.h
Abstraction for supporting both QtWidgets and QtQuick.
KDDockWidgets::FrameworkWidgetFactory::createRubberBand
virtual QWidgetOrQuick * createRubberBand(QWidgetOrQuick *parent) const =0
Called internally by the framework to create a RubberBand to show as drop zone Returns a rubber band.
QObject
Layouting::Widget
An abstraction/wrapper around QWidget, QtQuickItem or anything else.
Definition: Widget.h:79
KDDockWidgets::FrameworkWidgetFactory::createFloatingWindow
virtual FloatingWindow * createFloatingWindow(Frame *frame, MainWindowBase *parent=nullptr, QRect suggestedGeometry={}) const =0
Called internally by the framework to create a FloatingWindow Override to provide your own FloatingWi...
QIcon
KDDockWidgets::FrameworkWidgetFactory::createTabWidget
virtual TabWidget * createTabWidget(Frame *parent) const =0
Called internally by the framework to create a TabWidget Override to provide your own TabWidget sub-c...
KDDockWidgets::FrameworkWidgetFactory::createFrame
virtual Frame * createFrame(QWidgetOrQuick *parent=nullptr, FrameOptions options=FrameOption_None) const =0
Called internally by the framework to create a Frame class Override to provide your own Frame sub-cla...
KDDockWidgets::SideBarLocation
SideBarLocation
Each main window supports 4 sidebars.
Definition: KDDockWidgets.h:211
KDDockWidgets::FrameworkWidgetFactory::createTitleBar
virtual TitleBar * createTitleBar(FloatingWindow *floatingWindow) const =0
Called internally by the framework to create a TitleBar Override to provide your own TitleBar sub-cla...
KDDockWidgets::FrameworkWidgetFactory::createFloatingWindow
virtual FloatingWindow * createFloatingWindow(MainWindowBase *parent=nullptr) const =0
Called internally by the framework to create a FloatingWindow Override to provide your own FloatingWi...
KDDockWidgets::FrameworkWidgetFactory::createTabBar
virtual TabBar * createTabBar(TabWidget *parent=nullptr) const =0
Called internally by the framework to create a TabBar Override to provide your own TabBar sub-class.
KDDockWidgets::FrameworkWidgetFactory::createSeparator
virtual Layouting::Separator * createSeparator(Layouting::Widget *parent=nullptr) const =0
Called internally by the framework to create a Separator Override to provide your own Separator sub-c...
KDDockWidgets::FrameworkWidgetFactory::createDropIndicatorOverlay
virtual DropIndicatorOverlayInterface * createDropIndicatorOverlay(DropArea *dropArea) const =0
Called internally by the framework to create a DropIndicatorOverlayInterface Override to provide your...
KDDockWidgets::FrameworkWidgetFactory
A factory class for allowing the user to customize some internal widgets. This is optional,...
Definition: FrameworkWidgetFactory.h:68
KDDockWidgets::FrameworkWidgetFactory::createSideBar
virtual SideBar * createSideBar(SideBarLocation loc, MainWindowBase *parent) const =0
Called internally by the framework to create a SideBar.
KDDockWidgets
Definition: Config.cpp:36
QAbstractButton
KDDockWidgets::MainWindowBase
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
Definition: MainWindowBase.h:56
KDDockWidgets::DefaultWidgetFactory::DefaultWidgetFactory
DefaultWidgetFactory()=default
Layouting
Definition: FrameworkWidgetFactory.h:32
KDDockWidgets::DefaultWidgetFactory::s_dropIndicatorType
static DropIndicatorType s_dropIndicatorType
Definition: FrameworkWidgetFactory.h:190

© 2019-2022 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated on Mon Mar 7 2022 02:01:20 for KDDockWidgets API Documentation by doxygen 1.8.20