31 #include <tqstringlist.h>
33 #include <tdeabc/addressbook.h>
34 #include <tdeabc/addressee.h>
35 #include <tdeabc/vcardparser.h>
45 class Command :
public KCommand
48 Command( TDEABC::AddressBook *addressBook ) { mAddressBook = addressBook; }
51 TDEABC::AddressBook *addressBook()
const {
return mAddressBook; }
52 KABLock *lock()
const {
return KABLock::self( mAddressBook ); }
53 bool resourceExist( TDEABC::Resource *resource );
55 TDEABC::AddressBook* mAddressBook;
58 class DeleteCommand :
public Command
61 DeleteCommand( TDEABC::AddressBook *addressBook,
const TQStringList &uidList );
63 virtual TQString name()
const;
64 virtual void unexecute();
65 virtual void execute();
68 TDEABC::Addressee::List mAddresseeList;
69 TQStringList mUIDList;
72 class PasteCommand :
public Command
75 PasteCommand( KAB::Core *core,
76 const TDEABC::Addressee::List &addressees );
78 virtual TQString name()
const;
79 virtual void unexecute();
80 virtual void execute();
83 TDEABC::Addressee::List mAddresseeList;
87 class CutCommand :
public Command
90 CutCommand( TDEABC::AddressBook *addressBook,
const TQStringList &uidList );
92 virtual TQString name()
const;
93 virtual void unexecute();
94 virtual void execute();
97 TDEABC::Addressee::List mAddresseeList;
98 TQStringList mUIDList;
99 #if defined(KABC_VCARD_ENCODING_FIX)
100 TQByteArray mClipText;
107 class NewCommand :
public Command
110 NewCommand( TDEABC::AddressBook *addressBook,
111 const TDEABC::Addressee::List &addressees );
113 virtual TQString name()
const;
114 virtual void unexecute();
115 virtual void execute();
118 TDEABC::Addressee::List mAddresseeList;
121 class EditCommand :
public Command
124 EditCommand( TDEABC::AddressBook *addressBook,
const TDEABC::Addressee &oldAddressee,
125 const TDEABC::Addressee &newAddressee );
127 virtual TQString name()
const;
128 virtual void unexecute();
129 virtual void execute();
132 TDEABC::Addressee mOldAddressee;
133 TDEABC::Addressee mNewAddressee;
136 class CopyToCommand :
public Command
139 CopyToCommand( TDEABC::AddressBook *addressBook,
const TQStringList &uidList,
140 TDEABC::Resource *resource );
142 virtual TQString name()
const;
143 virtual void unexecute();
144 virtual void execute();
147 TDEABC::Addressee::List mAddresseeList;
148 TQStringList mUIDList;
149 TDEABC::Resource *mResource;
152 class MoveToCommand :
public Command
155 MoveToCommand( KAB::Core *core,
const TQStringList &uidList,
156 TDEABC::Resource *resource );
158 virtual TQString name()
const;
159 virtual void unexecute();
160 virtual void execute();
161 void moveContactTo( TDEABC::Resource *resource );
164 TDEABC::Addressee::List mAddresseeList;
165 TQStringList mUIDList;
166 TDEABC::Resource *mResource;