• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kaddressbook

undocmds.h

Go to the documentation of this file.
00001 /*
00002     This file is part of KAddressBook.
00003     Copyright (C) 1999 Don Sanders <sanders@kde.org>
00004                   2005 Tobias Koenig <tokoe@kde.org>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 
00025 #ifndef COMMANDS_H
00026 #define COMMANDS_H
00027 
00028 // Commands for undo/redo functionality.
00029 
00030 #include <QtCore/QString>
00031 #include <QtCore/QStringList>
00032 #include <QtGui/QUndoCommand>
00033 
00034 #include <kabc/addressbook.h>
00035 #include <kabc/addressee.h>
00036 
00037 #include "kablock.h"
00038 
00039 namespace KAB {
00040 class Core;
00041 }
00042 
00043 class Command : public QUndoCommand
00044 {
00045   public:
00046     Command( KABC::AddressBook *addressBook ) { mAddressBook = addressBook; }
00047 
00048   protected:
00049     KABC::AddressBook *addressBook() const { return mAddressBook; }
00050     KABLock *lock() const { return KABLock::self( mAddressBook ); }
00051 
00052   private:
00053     KABC::AddressBook *mAddressBook;
00054 };
00055 
00056 class DeleteCommand : public Command
00057 {
00058   public:
00059     DeleteCommand( KABC::AddressBook *addressBook, const QStringList &uidList );
00060 
00061     virtual QString text() const;
00062     virtual void undo();
00063     virtual void redo();
00064 
00065   private:
00066     KABC::Addressee::List mAddresseeList;
00067     QStringList mUIDList;
00068 };
00069 
00070 class PasteCommand : public Command
00071 {
00072   public:
00073     PasteCommand( KAB::Core *core,
00074                   const KABC::Addressee::List &addressees );
00075 
00076     virtual QString text() const;
00077     virtual void undo();
00078     virtual void redo();
00079 
00080   private:
00081     KABC::Addressee::List mAddresseeList;
00082     KAB::Core *mCore;
00083 };
00084 
00085 class CutCommand : public Command
00086 {
00087   public:
00088     CutCommand( KABC::AddressBook *addressBook, const QStringList &uidList );
00089 
00090     virtual QString text() const;
00091     virtual void undo();
00092     virtual void redo();
00093 
00094   private:
00095     KABC::Addressee::List mAddresseeList;
00096     QStringList mUIDList;
00097     QString mClipText;
00098     QString mOldText;
00099 };
00100 
00101 class NewCommand : public Command
00102 {
00103   public:
00104     NewCommand( KABC::AddressBook *addressBook,
00105                 const KABC::Addressee::List &addressees );
00106 
00107     virtual QString text() const;
00108     virtual void undo();
00109     virtual void redo();
00110 
00111   private:
00112     KABC::Addressee::List mAddresseeList;
00113 };
00114 
00115 class EditCommand : public Command
00116 {
00117   public:
00118     EditCommand( KABC::AddressBook *addressBook, const KABC::Addressee &oldAddressee,
00119                  const KABC::Addressee &newAddressee );
00120 
00121     virtual QString text() const;
00122     virtual void undo();
00123     virtual void redo();
00124 
00125   private:
00126     KABC::Addressee mOldAddressee;
00127     KABC::Addressee mNewAddressee;
00128 };
00129 
00130 #endif

kaddressbook

Skip menu "kaddressbook"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal