Subversion Repositories Scribus

Rev

Rev 16729 | Rev 18330 | 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>
29
#include <QImage>
30
#include <QListWidget>
31
#include <QMouseEvent>
32
#include <QPixmap>
33
#include <QToolTip>
34
#include <QVBoxLayout>
35
 
36
 
37
class QEvent;
38
class ScribusMainWindow;
39
class ScribusDoc;
40
 
41
 
42
#include "scribusapi.h"
16579 fschmid 43
#include "scdockpalette.h"
16729 fschmid 44
#include "sclistwidgetdelegate.h"
15061 fschmid 45
 
46
class SCRIBUS_API SymbolView : public QListWidget
47
{
48
        Q_OBJECT
49
 
50
public:
51
        SymbolView( QWidget* parent);
52
        ~SymbolView() {};
53
 
16729 fschmid 54
public slots:
55
        void HandleContextMenu(QPoint);
56
        void changeDisplay();
57
 
15061 fschmid 58
protected:
16729 fschmid 59
        bool viewportEvent(QEvent *event);
15061 fschmid 60
        void dragEnterEvent(QDragEnterEvent *e);
61
        void dragMoveEvent(QDragMoveEvent *e);
62
        void dropEvent(QDropEvent *e);
63
        void startDrag(Qt::DropActions supportedActions);
16729 fschmid 64
 
17793 fschmid 65
signals:
66
        void objectDropped();
67
 
16729 fschmid 68
private:
69
        ScListWidgetDelegate* delegate;
15061 fschmid 70
};
71
 
16579 fschmid 72
class SCRIBUS_API SymbolPalette : public ScDockPalette
15061 fschmid 73
{
74
        Q_OBJECT
75
 
76
public:
77
        SymbolPalette(QWidget* parent);
78
        ~SymbolPalette() {};
79
        void setMainWindow(ScribusMainWindow *mw);
80
        void setDoc(ScribusDoc *);
81
        void unsetDoc();
16034 fschmid 82
        void editingStart(QStringList names);
16029 fschmid 83
        void editingFinished();
15061 fschmid 84
        void updateSymbolList();
85
 
86
        virtual void changeEvent(QEvent *e);
87
 
88
public slots:
16029 fschmid 89
        void handleDoubleClick(QListWidgetItem *item);
16546 jghali 90
        void handleUpdateRequest(int);
15061 fschmid 91
        void languageChange();
92
 
16029 fschmid 93
signals:
94
        void startEdit(QString);
95
        void endEdit();
17793 fschmid 96
        void objectDropped();
16029 fschmid 97
 
15061 fschmid 98
protected:
99
        SymbolView *SymbolViewWidget;
100
        QVBoxLayout* PaletteLayout;
101
        ScribusDoc *currDoc;
102
        ScribusMainWindow *m_scMW;
16034 fschmid 103
        QStringList editItemNames;
15061 fschmid 104
};
105
 
16729 fschmid 106
#endif