kocommandhistory.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef kocommandhistory_h
00022 #define kocommandhistory_h
00023
00024 #include <qptrlist.h>
00025 #include <qstring.h>
00026 #include <qobject.h>
00027 #include <koffice_export.h>
00028
00029 class KAction;
00030 class KActionCollection;
00031 class QPopupMenu;
00032 class KCommand;
00033 #include <qlistbox.h>
00034
00035 class KoListBox : public QListBox {
00036 Q_OBJECT
00037 public:
00038 KoListBox( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00039 protected:
00040 virtual void contentsMouseMoveEvent ( QMouseEvent * );
00041 signals:
00042 void changeNumberOfSelectedItem( int );
00043 };
00044
00057 class KOFFICEUI_EXPORT KoCommandHistory : public QObject {
00058 Q_OBJECT
00059 public:
00065 KoCommandHistory();
00066
00075 KoCommandHistory(KActionCollection *actionCollection, bool withMenus = true);
00076
00080 virtual ~KoCommandHistory();
00081
00087 void clear();
00088
00097 void addCommand(KCommand *command, bool execute=true);
00098
00102 int undoLimit() const { return m_undoLimit; }
00106 void setUndoLimit(int limit);
00110 int redoLimit() const { return m_redoLimit; }
00114 void setRedoLimit(int limit);
00115
00122 void updateActions();
00123
00124 public slots:
00129 virtual void undo();
00134 virtual void redo();
00143 virtual void documentSaved();
00144
00145 protected slots:
00146 void slotUndoAboutToShow();
00147 void slotUndoActivated( int );
00148 void slotRedoAboutToShow();
00149 void slotRedoActivated( int );
00150 void slotUndoActivated( QListBoxItem *);
00151 void slotRedoActivated( QListBoxItem *);
00152 void slotChangeRedoNumberOfSelectedItem( int );
00153 void slotChangeUndoNumberOfSelectedItem( int );
00154 signals:
00160 void commandExecuted();
00165 void documentRestored();
00166
00167 private:
00168 void clipCommands();
00169
00170 QPtrList<KCommand> m_commands;
00171 KAction *m_undo, *m_redo;
00172 QPopupMenu *m_undoPopup, *m_redoPopup;
00173 int m_undoLimit, m_redoLimit;
00174 bool m_first;
00175 protected:
00176 virtual void virtual_hook( int id, void* data );
00177 private:
00178 class KoCommandHistoryPrivate;
00179 KoCommandHistoryPrivate *d;
00180 };
00181
00182 #endif
This file is part of the documentation for lib Library Version 1.4.2.