Subversion Repositories Scribus

Rev

Rev 18330 | Rev 20409 | 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:
56
        void HandleContextMenu(QPoint);
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
        virtual void changeEvent(QEvent *e);
88
 
89
public slots:
16029 fschmid 90
        void handleDoubleClick(QListWidgetItem *item);
16546 jghali 91
        void handleUpdateRequest(int);
15061 fschmid 92
        void languageChange();
19473 craig 93
        void keyPressEvent(QKeyEvent *e);
15061 fschmid 94
 
16029 fschmid 95
signals:
96
        void startEdit(QString);
97
        void endEdit();
17793 fschmid 98
        void objectDropped();
16029 fschmid 99
 
15061 fschmid 100
protected:
101
        SymbolView *SymbolViewWidget;
102
        QVBoxLayout* PaletteLayout;
18330 jghali 103
        ScribusDoc *m_doc;
15061 fschmid 104
        ScribusMainWindow *m_scMW;
16034 fschmid 105
        QStringList editItemNames;
15061 fschmid 106
};
107
 
16729 fschmid 108
#endif