1 /* 2 For general Scribus (>=1.3.2) copyright and licensing information please refer 3 to the COPYING file provided with the program. Following this notice may exist 4 a copyright and/or license notice that predates the release of Scribus 1.3.2 5 for which a new license (GPL+exception) is in place. 6 */ 7 /*************************************************************************** 8 symbolpalette.h - description 9 ------------------- 10 begin : Tue Mar 27 2012 11 copyright : (C) 2012 by Franz Schmid 12 email : Franz.Schmid@altmuehlnet.de 13 copyright : Scribus Team 14 ***************************************************************************/ 15 16 /*************************************************************************** 17 * * 18 * This program is free software; you can redistribute it and/or modify * 19 * it under the terms of the GNU General Public License as published by * 20 * the Free Software Foundation; either version 2 of the License, or * 21 * (at your option) any later version. * 22 * * 23 ***************************************************************************/ 24 25 #ifndef INLINEPAL_H 26 #define INLINEPAL_H 27 28 #include <QDragEnterEvent> 29 #include <QDragLeaveEvent> 30 #include <QDragMoveEvent> 31 #include <QDropEvent> 32 #include <QImage> 33 #include <QListWidget> 34 #include <QMouseEvent> 35 #include <QPixmap> 36 #include <QToolTip> 37 #include <QVBoxLayout> 38 39 40 class QEvent; 41 class ScribusMainWindow; 42 class ScribusDoc; 43 44 45 #include "scribusapi.h" 46 #include "scdockpalette.h" 47 #include "sclistwidgetdelegate.h" 48 49 class SCRIBUS_API InlineView : public QListWidget 50 { 51 Q_OBJECT 52 53 public: 54 InlineView( QWidget* parent); ~InlineView()55 ~InlineView() {}; 56 57 protected: 58 void dragEnterEvent(QDragEnterEvent *e); 59 void dragMoveEvent(QDragMoveEvent *e); 60 void dropEvent(QDropEvent *e); 61 void startDrag(Qt::DropActions supportedActions); 62 63 signals: 64 void objectDropped(QString); 65 66 private: 67 ScListWidgetDelegate* delegate; 68 }; 69 70 class SCRIBUS_API InlinePalette : public ScDockPalette 71 { 72 Q_OBJECT 73 74 public: 75 InlinePalette(QWidget* parent); ~InlinePalette()76 ~InlinePalette() {}; 77 void setMainWindow(ScribusMainWindow *mw); 78 void setDoc(ScribusDoc *); 79 void unsetDoc(); 80 void editingStart(int itemID); 81 void editingFinished(); 82 void updateItemList(); 83 84 public slots: 85 void handleContextMenue(QPoint p); 86 void handlePasteToItem(); 87 void handleEditItem(); 88 void handleDoubleClick(QListWidgetItem *item); 89 void handleDeleteItem(); 90 void handleUpdateRequest(int); 91 void languageChange(); 92 93 signals: 94 void startEdit(int); 95 void endEdit(); 96 void objectDropped(QString); 97 98 protected: 99 InlineView *InlineViewWidget; 100 QVBoxLayout* PaletteLayout; 101 ScribusDoc *m_doc; 102 ScribusMainWindow *m_scMW; 103 int actItem; 104 int currentEditedItem; 105 106 void changeEvent(QEvent *e) override; 107 }; 108 109 #endif 110