-rw-r--r-- | kaddressbook/undocmds.h | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/kaddressbook/undocmds.h b/kaddressbook/undocmds.h new file mode 100644 index 0000000..c3f23cc --- a/dev/null +++ b/kaddressbook/undocmds.h | |||
@@ -0,0 +1,117 @@ | |||
1 | /* | ||
2 | This file is part of KAddressBook. | ||
3 | Copyright (C) 1999 Don Sanders <sanders@kde.org> | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
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, write to the Free Software | ||
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
18 | |||
19 | As a special exception, permission is given to link this program | ||
20 | with any edition of Qt, and distribute the resulting executable, | ||
21 | without including the source code for Qt in the source distribution. | ||
22 | */ | ||
23 | |||
24 | #ifndef UNDOCMDS_H | ||
25 | #define UNDOCMDS_H | ||
26 | // | ||
27 | // Commands for undo/redo functionality. | ||
28 | |||
29 | #include <qstring.h> | ||
30 | #include <qstringlist.h> | ||
31 | |||
32 | #include <kabc/addressee.h> | ||
33 | |||
34 | #include "undo.h" | ||
35 | |||
36 | namespace KABC { | ||
37 | class AddressBook; | ||
38 | } | ||
39 | |||
40 | class KABCore; | ||
41 | |||
42 | class PwDeleteCommand : public Command | ||
43 | { | ||
44 | public: | ||
45 | PwDeleteCommand(KABC::AddressBook *doc, const QStringList &uidList ); | ||
46 | virtual ~PwDeleteCommand(); | ||
47 | virtual QString name(); | ||
48 | virtual void undo(); | ||
49 | virtual void redo(); | ||
50 | |||
51 | private: | ||
52 | KABC::AddressBook *mDocument; | ||
53 | KABC::Addressee::List mAddresseeList; | ||
54 | QStringList mUidList; | ||
55 | }; | ||
56 | |||
57 | class PwPasteCommand : public Command | ||
58 | { | ||
59 | public: | ||
60 | PwPasteCommand( KABCore *core, const KABC::Addressee::List &list ); | ||
61 | virtual QString name(); | ||
62 | virtual void undo(); | ||
63 | virtual void redo(); | ||
64 | |||
65 | private: | ||
66 | KABCore *mCore; | ||
67 | KABC::Addressee::List mAddresseeList; | ||
68 | }; | ||
69 | |||
70 | class PwCutCommand : public Command | ||
71 | { | ||
72 | public: | ||
73 | PwCutCommand(KABC::AddressBook *doc, const QStringList &uidList); | ||
74 | virtual QString name(); | ||
75 | virtual void undo(); | ||
76 | virtual void redo(); | ||
77 | |||
78 | private: | ||
79 | KABC::AddressBook *mDocument; | ||
80 | KABC::Addressee::List mAddresseeList; | ||
81 | QStringList mUidList; | ||
82 | QString mClipText; | ||
83 | QString mOldText; | ||
84 | }; | ||
85 | |||
86 | class PwNewCommand : public Command | ||
87 | { | ||
88 | public: | ||
89 | PwNewCommand(KABC::AddressBook *doc, const KABC::Addressee &a ); | ||
90 | ~PwNewCommand(); | ||
91 | virtual QString name(); | ||
92 | virtual void undo(); | ||
93 | virtual void redo(); | ||
94 | |||
95 | private: | ||
96 | KABC::AddressBook *mDocument; | ||
97 | KABC::Addressee mA; | ||
98 | }; | ||
99 | |||
100 | class PwEditCommand : public Command | ||
101 | { | ||
102 | public: | ||
103 | PwEditCommand(KABC::AddressBook *doc, | ||
104 | const KABC::Addressee &oldA, | ||
105 | const KABC::Addressee &newA); | ||
106 | virtual ~PwEditCommand(); | ||
107 | virtual QString name(); | ||
108 | virtual void undo(); | ||
109 | virtual void redo(); | ||
110 | |||
111 | private: | ||
112 | KABC::AddressBook *mDocument; | ||
113 | KABC::Addressee mOldA; | ||
114 | KABC::Addressee mNewA; | ||
115 | }; | ||
116 | |||
117 | #endif | ||