~ubuntu-branches/ubuntu/lucid/kdebase/lucid

« back to all changes in this revision

Viewing changes to apps/keditbookmarks/commandhistory.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-12-02 13:28:20 UTC
  • mfrom: (1.1.35 upstream)
  • Revision ID: james.westby@ubuntu.com-20091202132820-yaqzqr7livmarip5
Tags: 4:4.3.80-0ubuntu1
* New upstream release:
  - Drop kubuntu_05_konsole_colour_scheme.diff, applied upstream
  - Drop kubuntu_15-17.diff, applied upstream
  - Bump build-depend versions
  - Add build-depend on shared-desktop-ontologies for nepomuk support
  - Update various .install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
   Copyright (C) 2000, 2009 David Faure <faure@kde.org>
 
3
   Copyright (C) 2002-2003 Alexander Kellett <lypanov@kde.org>
 
4
 
 
5
   This program is free software; you can redistribute it and/or
 
6
   modify it under the terms of the GNU General Public License as
 
7
   published by the Free Software Foundation; either version 2 of
 
8
   the License, or (at your option) version 3.
 
9
 
 
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
 
13
   GNU General Public License for more details.
 
14
 
 
15
   You should have received a copy of the GNU General Public License
 
16
   along with this program.  If not, see <http://www.gnu.org/licenses/>
 
17
*/
 
18
 
 
19
#ifndef COMMANDHISTORY_H
 
20
#define COMMANDHISTORY_H
 
21
 
 
22
#include <kundostack.h>
 
23
#include <QObject>
 
24
class QUndoCommand;
 
25
class KActionCollection;
 
26
 
 
27
class CmdHistory : public QObject
 
28
{
 
29
    Q_OBJECT
 
30
public:
 
31
    CmdHistory(KActionCollection *collection);
 
32
    virtual ~CmdHistory() {}
 
33
 
 
34
    void notifyDocSaved();
 
35
 
 
36
    void clearHistory();
 
37
    void addCommand(QUndoCommand *);
 
38
 
 
39
    // Adds command without executing it.
 
40
    void addInFlightCommand(QUndoCommand *);
 
41
 
 
42
    static CmdHistory *self();
 
43
 
 
44
public Q_SLOTS:
 
45
    void undo();
 
46
    void redo();
 
47
 
 
48
private:
 
49
    void commandExecuted(const QUndoCommand *k);
 
50
 
 
51
private:
 
52
    // Ported from K3Command/K3CommandHistory to QUndoCommand/KUndoStack for KDE-4.4.0
 
53
    KUndoStack m_commandHistory;
 
54
    static CmdHistory *s_self;
 
55
};
 
56
 
 
57
#endif /* COMMANDHISTORY_H */
 
58