File indexing completed on 2024-05-12 16:02:12

0001 /* This file is part of the KDE project
0002  *
0003  * SPDX-FileCopyrightText: 2005-2006 Boudewijn Rempt <boud@valdyas.org>
0004  * SPDX-FileCopyrightText: 2006 Thomas Zander <zander@kde.org>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.0-or-later
0007  */
0008 #ifndef KO_TOOL_DOCKER_H
0009 #define KO_TOOL_DOCKER_H
0010 
0011 #include <QDockWidget>
0012 #include <QPointer>
0013 #include <KisKineticScroller.h>
0014 
0015 class QWidget;
0016 
0017 #include <kritawidgets_export.h>
0018 #include <KoCanvasObserverBase.h>
0019 /**
0020  * The tool docker shows the tool option widget associated with the
0021  * current tool and the current canvas.
0022  */
0023 class KRITAWIDGETS_EXPORT KoToolDocker : public QDockWidget, public KoCanvasObserverBase
0024 {
0025     Q_OBJECT
0026 public:
0027     explicit KoToolDocker(QWidget *parent = 0);
0028     ~KoToolDocker() override;
0029 
0030     void resetWidgets();
0031 
0032     /// reimplemented
0033     void setCanvas(KoCanvasBase *canvas) override;
0034     void unsetCanvas() override;
0035 
0036 public Q_SLOTS:
0037     /**
0038      * Update the option widgets to the argument one, removing the currently set widget.
0039      */
0040     void setOptionWidgets(const QList<QPointer<QWidget> > &optionWidgetList);
0041     void slotScrollerStateChange(QScroller::State state);
0042 
0043     /**
0044      * Returns whether the docker has an optionwidget attached
0045      */
0046     bool hasOptionWidget();
0047 
0048 private:
0049     Q_PRIVATE_SLOT(d, void locationChanged(Qt::DockWidgetArea area))
0050 
0051     class Private;
0052     Private * const d;
0053 };
0054 
0055 #endif