Scribus
Open source desktop publishing at your fingertips
shapepalette.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  shapepalette.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 SHAPEPAL_H
23 #define SHAPEPAL_H
24 
25 #include <QKeyEvent>
26 #include <QImage>
27 #include <QListWidget>
28 #include <QMouseEvent>
29 #include <QPixmap>
30 #include <QToolBox>
31 #include <QToolButton>
32 #include <QToolTip>
33 #include <QVBoxLayout>
34 #include <QHash>
35 
36 
37 class QEvent;
38 class ScribusMainWindow;
39 class ScribusDoc;
40 
41 
42 #include "pluginapi.h"
43 #include "ui/scdockpalette.h"
44 #include "ui/sclistwidgetdelegate.h"
45 #include "fpointarray.h"
46 
47 struct shapeData
48 {
49  int width;
50  int height;
51  QString name;
52  FPointArray path;
53 };
54 
55 class PLUGIN_API ShapeView : public QListWidget
56 {
57  Q_OBJECT
58 
59 public:
60  ShapeView( QWidget* parent);
61  ~ShapeView() {};
62  void updateShapeList();
63  QHash<QString, shapeData> m_Shapes;
64  ScribusMainWindow *m_scMW;
65 
66 public slots:
67  void HandleContextMenu(QPoint);
68  void changeDisplay();
69  void delOne();
70  void deleteAll();
71 signals:
72  void objectDropped();
73 
74 protected:
75  bool viewportEvent(QEvent *event);
76  void keyPressEvent(QKeyEvent *e);
77  void dragEnterEvent(QDragEnterEvent *e);
78  void dragMoveEvent(QDragMoveEvent *e);
79  void dropEvent(QDropEvent *e);
80  void startDrag(Qt::DropActions supportedActions);
81 
82 
83 private:
84  ScListWidgetDelegate* delegate;
85 };
86 
87 class PLUGIN_API ShapePalette : public ScDockPalette
88 {
89  Q_OBJECT
90 
91 public:
92  ShapePalette(QWidget* parent);
93  ~ShapePalette() {};
94  void writeToPrefs();
95  void readFromPrefs();
96  double decodePSDfloat(uint data);
97  void setMainWindow(ScribusMainWindow *mw);
98  void setDoc(ScribusDoc *);
99  void unsetDoc();
100  ScribusMainWindow *m_scMW;
101 
102  virtual void changeEvent(QEvent *e);
103 
104 public slots:
105  void closeTab();
106  void Import();
107  void languageChange();
108 
109 protected:
110  ShapeView *ShapeViewWidget;
111  QToolBox* Frame3;
112  QWidget* containerWidget;
113  QVBoxLayout* vLayout;
114  QHBoxLayout* buttonLayout;
115  QToolButton* importButton;
116  QToolButton* closeButton;
117  ScribusDoc *m_doc;
118 };
119 
120 #endif
Definition: shapepalette.h:47
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
the Document Class
Definition: scribusdoc.h:90
Definition: shapepalette.h:87
Definition: shapepalette.h:55
Definition: sclistwidgetdelegate.h:29
Definition: fpointarray.h:42