Subversion Repositories Scribus

Rev

Rev 24048 | Rev 25114 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
15061 fschmid 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>
19473 craig 29
#include <QKeyEvent>
15061 fschmid 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"
16579 fschmid 44
#include "scdockpalette.h"
16729 fschmid 45
#include "sclistwidgetdelegate.h"
15061 fschmid 46
 
47
class SCRIBUS_API SymbolView : public QListWidget
48
{
49
        Q_OBJECT
50
 
51
public:
52
        SymbolView( QWidget* parent);
53
        ~SymbolView() {};
54
 
16729 fschmid 55
public slots:
20409 fschmid 56
        void HandleContextMenu(QPoint p);
16729 fschmid 57
        void changeDisplay();
58
 
15061 fschmid 59
protected:
16729 fschmid 60
        bool viewportEvent(QEvent *event);
15061 fschmid 61
        void dragEnterEvent(QDragEnterEvent *e);
62
        void dragMoveEvent(QDragMoveEvent *e);
63
        void dropEvent(QDropEvent *e);
64
        void startDrag(Qt::DropActions supportedActions);
16729 fschmid 65
 
17793 fschmid 66
signals:
67
        void objectDropped();
68
 
16729 fschmid 69
private:
70
        ScListWidgetDelegate* delegate;
15061 fschmid 71
};
72
 
16579 fschmid 73
class SCRIBUS_API SymbolPalette : public ScDockPalette
15061 fschmid 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();
16034 fschmid 83
        void editingStart(QStringList names);
16029 fschmid 84
        void editingFinished();
15061 fschmid 85
        void updateSymbolList();
86
 
87
public slots:
20409 fschmid 88
        void handleContextMenue(QPoint p);
16029 fschmid 89
        void handleDoubleClick(QListWidgetItem *item);
20409 fschmid 90
        void handleEditItem();
91
        void handleDeleteItem();
16546 jghali 92
        void handleUpdateRequest(int);
15061 fschmid 93
        void languageChange();
24137 craig 94
        void keyPressEvent(QKeyEvent *e) override;
15061 fschmid 95
 
16029 fschmid 96
signals:
97
        void startEdit(QString);
98
        void endEdit();
17793 fschmid 99
        void objectDropped();
16029 fschmid 100
 
15061 fschmid 101
protected:
102
        SymbolView *SymbolViewWidget;
103
        QVBoxLayout* PaletteLayout;
18330 jghali 104
        ScribusDoc *m_doc;
15061 fschmid 105
        ScribusMainWindow *m_scMW;
16034 fschmid 106
        QStringList editItemNames;
20409 fschmid 107
        QListWidgetItem *m_item;
24048 jghali 108
 
109
        void changeEvent(QEvent *e) override;
15061 fschmid 110
};
111
 
16729 fschmid 112
#endif