~ubuntu-branches/ubuntu/karmic/rkward/karmic

« back to all changes in this revision

Viewing changes to rkward/dataeditor/twintableundo.h

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Friedrichsmeier
  • Date: 2006-11-06 16:30:00 UTC
  • mfrom: (1.2.1 upstream) (3.1.1 feisty)
  • Revision ID: james.westby@ubuntu.com-20061106163000-qi8ju75eqecrfay7
* new upstream release
* depend on either php4-cli or php5-cli

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
                          twintableundo  -  description
3
 
                             -------------------
4
 
    begin                : Fri Apr 7 2006
5
 
    copyright            : (C) 2006 by Thomas Friedrichsmeier
6
 
    email                : tfry@users.sourceforge.net
7
 
 ***************************************************************************/
8
 
 
9
 
/***************************************************************************
10
 
 *                                                                         *
11
 
 *   This program is free software; you can redistribute it and/or modify  *
12
 
 *   it under the terms of the GNU General Public License as published by  *
13
 
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 
 *   (at your option) any later version.                                   *
15
 
 *                                                                         *
16
 
 ***************************************************************************/
17
 
 
18
 
#ifndef TWINTABLEUNDO_H
19
 
#define TWINTABLEUNDO_H
20
 
 
21
 
#include "kcommand.h"
22
 
 
23
 
class TwinTableMember;
24
 
 
25
 
class TwinTableCommand : public KCommand {
26
 
public:
27
 
        TwinTableCommand (TwinTableMember *table, int row, int col, const QString &new_text);
28
 
        ~TwinTableCommand ();
29
 
/** reimplemented from KCommand to return "Edit Cell" */
30
 
        QString name () const;
31
 
/** reimplemented from KCommand to redo editing the cell */
32
 
        void execute ();
33
 
/** reimplemented from KCommand to revert the cell */
34
 
        void unexecute ();
35
 
private:
36
 
        int row;
37
 
        int col;
38
 
        TwinTableMember *table;
39
 
        QString old_text;
40
 
        QString new_text;
41
 
};
42
 
 
43
 
class TwinTablePasteCommand : public KCommand {
44
 
public:
45
 
        TwinTableCommand (TwinTableMember *table, int top_row, int left_col, int bottom_row, int right_col, const QCString &old_content, const QCString &pasted);
46
 
        ~TwinTableCommand ();
47
 
/** reimplemented from KCommand to return "Edit Cell" */
48
 
        QString name () const;
49
 
/** reimplemented from KCommand to redo pasting */
50
 
        void execute ();
51
 
/** reimplemented from KCommand to undo pasting */
52
 
        void unexecute ();
53
 
private:
54
 
        int top_row;
55
 
        int left_col;
56
 
        int bottom_row;
57
 
        int right_col;
58
 
        TwinTableMember *table;
59
 
        QCString before;
60
 
        QCString after;
61
 
};
62
 
 
63
 
class TwinTableUndo : public KCommandHistory {
64
 
public:
65
 
        TwinTableUndo (KActionCollection *actionCollection);
66
 
        ~TwinTableUndo ();
67
 
 
68
 
/** basically a wrapper around KCommandHistory::addCommand () */
69
 
        void makeChange (TwinTableMember *table, int row, int col, const QString &new_text);
70
 
        void startBlock (const QString &name);
71
 
        void endBlock ();
72
 
private:
73
 
        TwinTableCommandSequence *current_block;
74
 
};
75
 
 
76
 
#endif