Scribus
Open source desktop publishing at your fingertips
symbolpalette.h
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  copyright : Scribus Team
11  ***************************************************************************/
12 
13 /***************************************************************************
14  * *
15  * This program is free software; you can redistribute it and/or modify *
16  * it under the terms of the GNU General Public License as published by *
17  * the Free Software Foundation; either version 2 of the License, or *
18  * (at your option) any later version. *
19  * *
20  ***************************************************************************/
21 
22 #ifndef SYMBOLPAL_H
23 #define SYMBOLPAL_H
24 
25 #include <QDragEnterEvent>
26 #include <QDragLeaveEvent>
27 #include <QDragMoveEvent>
28 #include <QDropEvent>
29 #include <QKeyEvent>
30 #include <QImage>
31 #include <QListWidget>
32 #include <QMouseEvent>
33 #include <QPixmap>
34 #include <QToolTip>
35 #include <QVBoxLayout>
36 
37 
38 class QEvent;
39 class ScribusMainWindow;
40 class ScribusDoc;
41 
42 
43 #include "scribusapi.h"
44 #include "scdockpalette.h"
45 #include "sclistwidgetdelegate.h"
46 
47 class SCRIBUS_API SymbolView : public QListWidget
48 {
49  Q_OBJECT
50 
51 public:
52  SymbolView( QWidget* parent);
53  ~SymbolView() {};
54 
55 public slots:
56  void HandleContextMenu(QPoint p);
57  void changeDisplay();
58 
59 protected:
60  bool viewportEvent(QEvent *event);
61  void dragEnterEvent(QDragEnterEvent *e);
62  void dragMoveEvent(QDragMoveEvent *e);
63  void dropEvent(QDropEvent *e);
64  void startDrag(Qt::DropActions supportedActions);
65 
66 signals:
67  void objectDropped();
68 
69 private:
70  ScListWidgetDelegate* delegate;
71 };
72 
73 class SCRIBUS_API SymbolPalette : public ScDockPalette
74 {
75  Q_OBJECT
76 
77 public:
78  SymbolPalette(QWidget* parent);
79  ~SymbolPalette() {};
80  void setMainWindow(ScribusMainWindow *mw);
81  void setDoc(ScribusDoc *);
82  void unsetDoc();
83  void editingStart(QStringList names);
84  void editingFinished();
85  void updateSymbolList();
86 
87  virtual void changeEvent(QEvent *e);
88 
89 public slots:
90  void handleContextMenue(QPoint p);
91  void handleDoubleClick(QListWidgetItem *item);
92  void handleEditItem();
93  void handleDeleteItem();
94  void handleUpdateRequest(int);
95  void languageChange();
96  void keyPressEvent(QKeyEvent *e);
97 
98 signals:
99  void startEdit(QString);
100  void endEdit();
101  void objectDropped();
102 
103 protected:
104  SymbolView *SymbolViewWidget;
105  QVBoxLayout* PaletteLayout;
106  ScribusDoc *m_doc;
107  ScribusMainWindow *m_scMW;
108  QStringList editItemNames;
109  QListWidgetItem *m_item;
110 };
111 
112 #endif
Definition: scdockpalette.h:38
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
Definition: symbolpalette.h:73
the Document Class
Definition: scribusdoc.h:90
Definition: symbolpalette.h:47
Definition: sclistwidgetdelegate.h:29