1 /* 2 * Copyright (c) 2005 Boudewijn Rempt <boud@valdyas.org> 3 * Copyright (c) 2005-2008 Thomas Zander <zander@kde.org> 4 * Copyright (c) 2009 Peter Simonsson <peter.simonsson@gmail.com> 5 * Copyright (c) 2010 Cyrille Berger <cberger@cberger.net> 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Library General Public 9 * License as published by the Free Software Foundation; either 10 * version 2 of the License, or (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Library General Public License for more details. 16 * 17 * You should have received a copy of the GNU Library General Public License 18 * along with this library; see the file COPYING.LIB. If not, write to 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 * Boston, MA 02110-1301, USA. 21 */ 22 #ifndef _KO_TOOLBOX_DOCKER_H_ 23 #define _KO_TOOLBOX_DOCKER_H_ 24 25 #include <KoCanvasObserverBase.h> 26 27 #include <QDockWidget> 28 29 class KoCanvasBase; 30 class KoToolBox; 31 class KoToolBoxScrollArea; 32 33 class KoToolBoxDocker : public QDockWidget, public KoCanvasObserverBase 34 { 35 Q_OBJECT 36 public: 37 explicit KoToolBoxDocker(KoToolBox *toolBox); 38 39 /// reimplemented from KoCanvasObserverBase 40 void setCanvas(KoCanvasBase *canvas) override; 41 void unsetCanvas() override; observerName()42 QString observerName() const override { return QStringLiteral("KoToolBoxDocker"); } 43 44 protected: 45 void resizeEvent(QResizeEvent *event) override; 46 47 protected Q_SLOTS: 48 void updateToolBoxOrientation(Qt::DockWidgetArea area); 49 void updateFloating(bool); 50 51 private: 52 KoToolBox *m_toolBox; 53 KoToolBoxScrollArea *m_scrollArea; 54 }; 55 56 #endif // _KO_TOOLBOX_DOCKER_H_ 57