ksync

addressbooksyncee.h

00001 /*
00002     This file is part of ksync.
00003 
00004     Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library 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 GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 #ifndef ADDRESSBOOKSYNCEE_H
00022 #define ADDRESSBOOKSYNCEE_H
00023 
00024 #include <kabc/addressbook.h>
00025 #include <kdepimmacros.h>
00026 #include "ksyncer.h"
00027 
00028 class KDE_EXPORT AddressBookSyncEntry : public KSyncEntry
00029 {
00030   public:
00031     AddressBookSyncEntry( const KABC::Addressee & );
00032 
00033     QString name();
00034     QString id();
00035     QString timestamp();
00036 
00037     bool equals( KSyncEntry *entry );
00038 
00039     KABC::Addressee addressee() { return mAddressee; }
00040 
00041   private:
00042     KABC::Addressee mAddressee;
00043 };
00044 
00049 class KDE_EXPORT AddressBookSyncee : public KSyncee
00050 {
00051   public:
00052     AddressBookSyncee();
00053     ~AddressBookSyncee();
00054 
00055     AddressBookSyncEntry *firstEntry();
00056     AddressBookSyncEntry *nextEntry();
00057 
00058 //    AddressBookSyncEntry *findEntry(const QString &id);
00059 
00060     void addEntry(KSyncEntry *);
00061     void removeEntry(KSyncEntry *);
00062 
00063     bool read();
00064     bool write();
00065 
00066   private:
00067     AddressBookSyncEntry *createEntry( const KABC::Addressee & );
00068 
00069     KABC::AddressBook *mAddressBook;
00070 
00071     KABC::AddressBook::Iterator mAddressBookIterator;
00072 
00073     QPtrList<AddressBookSyncEntry> mEntries;
00074 };
00075 
00076 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys