Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / apps / konqueror / src / konqundomanager.h
blobc974cd2cc565436756145f27b8b2741086c7603a
1 /* This file is part of the KDE project
2 Copyright 2007 David Faure <faure@kde.org>
3 Copyright 2007 Eduardo Robles Elvira <edulix@gmail.com>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; see the file COPYING. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #ifndef KONQUNDOMANAGER_H
22 #define KONQUNDOMANAGER_H
24 #include "konqprivate_export.h"
26 #include <QObject>
27 #include "konqclosedtabitem.h"
28 class QAction;
30 /**
31 * Note that there is one KonqUndoManager per mainwindow.
32 * It integrates KonqFileUndoManager (undoing file operations)
33 * and undoing the closing of tabs.
35 class KONQ_TESTS_EXPORT KonqUndoManager : public QObject
37 Q_OBJECT
38 public:
39 explicit KonqUndoManager(QObject* parent);
40 ~KonqUndoManager();
42 bool undoAvailable() const;
43 QString undoText() const;
44 quint64 newCommandSerialNumber();
46 const QList<KonqClosedTabItem* >& closedTabsList() const;
47 void undoClosedTab(int index);
48 void addClosedTabItem(KonqClosedTabItem* closedTabItem);
49 void updateSupportsFileUndo(bool enable);
51 public Q_SLOTS:
52 void undo();
53 void clearClosedTabsList();
54 void undoLastClosedTab();
55 /**
56 * Opens in a new tab the URL the user selected from the closed tabs menu
57 * (by emitting openClosedTab), and takes it from the list.
59 void slotClosedTabsActivated(QAction* action);
61 Q_SIGNALS:
62 void undoAvailable(bool canUndo);
63 void undoTextChanged(const QString& text);
65 /// Emitted when a closed tab should be reopened
66 void openClosedTab(const KonqClosedTabItem&);
67 /// Emitted when closedTabsList() has changed.
68 void closedTabsListChanged();
70 private Q_SLOTS:
71 void slotFileUndoAvailable(bool);
72 void slotFileUndoTextChanged(const QString& text);
74 private:
75 QList<KonqClosedTabItem *> m_closedTabsList;
76 bool m_supportsFileUndo;
79 #endif /* KONQUNDOMANAGER_H */