~ubuntu-branches/ubuntu/maverick/scribus-ng/maverick-backports

« back to all changes in this revision

Viewing changes to scribus/undogui.h

  • Committer: Bazaar Package Importer
  • Author(s): Oleksandr Moskalenko
  • Date: 2009-02-09 09:25:18 UTC
  • mfrom: (5.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090209092518-iqsxmh3pjspgrdyd
Tags: 1.3.5.dfsg~svn20090208-2
debian/control: Use "type-handling -n arm,armel,armeb any" to generate the
list of architectures to build on.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#ifndef UNDOGUI_H
28
28
#define UNDOGUI_H
29
29
 
 
30
#include <QListWidgetItem>
30
31
#include "scribusapi.h"
31
32
#include "undoobject.h"
32
33
#include "undostate.h"
33
34
#include "scrpalettebase.h"
34
 
#include <vector>
35
 
#include <qwidget.h>
36
 
#include <qdialog.h>
37
 
#include <qstring.h>
38
 
#include <qlistbox.h>
39
 
#include <qtoolbutton.h>
40
 
#include <qpainter.h>
41
 
#include <qpixmap.h>
42
 
#include <qpopupmenu.h>
43
35
 
 
36
class QEvent;
 
37
class QMenu;
 
38
class QListWidget;
44
39
class QCheckBox;
45
 
class PrefsContext;
 
40
 
46
41
 
47
42
/**
48
43
 * @brief UndoGui is a virtual superclass for undo/redo widgets.
70
65
         * @param name Name of the object
71
66
         * @param f widget flags
72
67
         */
73
 
        UndoGui(QWidget* parent = 0, const char* name = "UndoGui", WFlags f = 0);
 
68
        UndoGui(QWidget* parent = 0, const char* name = "UndoGui", Qt::WFlags f = 0);
74
69
 
75
70
        /** @brief Destroys the widget */
76
71
        virtual ~UndoGui() {};
77
72
 
78
73
        /** @brief Empties the undo stack representation. */
79
74
        virtual void clear() = 0;
80
 
 
 
75
        
81
76
public slots:
82
77
        /**
83
78
         * @brief Insert a new undo item.
158
153
        QToolButton* undoButton;
159
154
        QToolButton* redoButton;
160
155
        */
161
 
        QPopupMenu* undoMenu;
162
 
        QPopupMenu* redoMenu;
 
156
        QMenu* undoMenu;
 
157
        QMenu* redoMenu;
163
158
        void updateUndoMenu();
164
159
        void updateRedoMenu();
165
160
public:
179
174
private slots:
180
175
        void undoClicked();
181
176
        void redoClicked();
182
 
        void undoMenuClicked(int id);
183
 
        void redoMenuClicked(int id);
 
177
        void undoMenuClicked(QAction *id);
 
178
        void redoMenuClicked(QAction *id);
184
179
public slots:
185
180
        /**
186
181
         * @brief Insert a new undo item.
263
258
private:
264
259
        int currentSelection;
265
260
        int redoItems;
266
 
        QListBox* undoList;
 
261
        QListWidget* undoList;
267
262
        QCheckBox* objectBox;
268
263
        QPushButton* undoButton;
269
264
        QPushButton* redoButton;
275
270
/*** UndoPalette::UndoItem ****************************************************/
276
271
        
277
272
        /** @brief UndoItem provides a custom QListBoxItem for the undo history view. */
278
 
        class UndoItem : public QListBoxItem
 
273
        class UndoItem : public QListWidgetItem
279
274
        {
280
275
        private:
281
276
                /** @brief An icon for the undo target */
315
310
                 const QString &actionDescription,
316
311
                 QPixmap *targetPixmap,
317
312
                 QPixmap *actionPixmap,
318
 
                         bool isUndoAction);
 
313
                         bool isUndoAction,
 
314
                     QListWidget * parent = 0);
319
315
                ~UndoItem();
320
 
                void paint(QPainter *painter);
321
 
                int height(const QListBox*) const;
322
 
                int width(const QListBox*) const;
 
316
                /*void paint(QPainter *painter);
 
317
                int height(const QListWidget*) const;
 
318
                int width(const QListWidget*) const;*/
323
319
                QString getDescription();
324
320
                bool isUndoAction();
325
321
                void setUndoAction(bool isUndo);
331
327
        void undoClicked();
332
328
        void redoClicked();
333
329
        void undoListClicked(int i);
334
 
        void showToolTip(QListBoxItem *i);
 
330
        void showToolTip(QListWidgetItem *i);
335
331
        void removeToolTip();
336
332
        void objectCheckBoxClicked(bool on);
337
333
 
346
342
 
347
343
        /** @brief Destroys the widget */
348
344
        ~UndoPalette();
 
345
        
 
346
        virtual void changeEvent(QEvent *e);
349
347
 
350
348
        /** @brief Empties the undo stack for this widget. */
351
349
        void clear();