1 /* This file is part of the KDE project 2 Copyright (C) 2008 C. Boemann <cbo@boemann.dk> 3 Copyright (C) 2008 Thorsten Zachmann <zachmann@kde.org> 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Library General Public 7 License as published by the Free Software Foundation; either 8 version 2 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Library General Public License for more details. 14 15 You should have received a copy of the GNU Library General Public License 16 along with this library; see the file COPYING.LIB. If not, write to 17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef KPRCLICKACTIONDOCKER_H 22 #define KPRCLICKACTIONDOCKER_H 23 24 #include <QWidget> 25 #include <QMap> 26 #include <QPixmap> 27 #include <KoCanvasObserverBase.h> 28 29 class KUndo2Command; 30 class KoPAViewBase; 31 class KoCanvasBase; 32 class KPrSoundCollection; 33 34 /** 35 * This is the click action docker widget that let's you choose a click action for your shapes 36 */ 37 class KPrClickActionDocker : public QWidget, public KoCanvasObserverBase 38 { 39 Q_OBJECT 40 public: 41 explicit KPrClickActionDocker( QWidget* parent = 0, Qt::WindowFlags flags = 0 ); 42 43 void setView( KoPAViewBase* view ); 44 45 public Q_SLOTS: 46 void addCommand( KUndo2Command * command ); 47 48 private Q_SLOTS: 49 /// selection has changed 50 void selectionChanged(); 51 52 /// reimplemented 53 void setCanvas( KoCanvasBase *canvas ) override; unsetCanvas()54 void unsetCanvas() override { m_canvas = 0; m_view = 0; } 55 private: 56 KoPAViewBase *m_view; 57 KPrSoundCollection *m_soundCollection; 58 KoCanvasBase *m_canvas; 59 QMap<QString, QWidget *> m_eventActionWidgets; 60 }; 61 62 #endif // KPRCLICKACTIONDOCKER_H 63 64