kitchensync

unknownsyncee.h

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2002 Holger Freyther <zecke@handhelds.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 KSYNC_UNKNOWNSYNCEE_H
00022 #define KSYNC_UNKNOWNSYNCEE_H
00023 
00024 #include <qdatetime.h>
00025 #include <qcstring.h>
00026 
00027 #include <syncee.h>
00028 
00029 namespace KSync {
00030 
00037 class KDE_EXPORT UnknownSyncEntry : public SyncEntry
00038 {
00039   public:
00046     enum DownLoadMode { Tempfile = 0, ByteArray };
00047     typedef QPtrList<UnknownSyncEntry> PtrList;
00048 
00049     UnknownSyncEntry( Syncee *parent );
00050 
00057     UnknownSyncEntry( const QByteArray& array, const QString& path,
00058                       Syncee *parent );
00059 
00066     UnknownSyncEntry( const QString& fileName, const QString& path,
00067                       Syncee *parent );
00068 
00072     UnknownSyncEntry( const UnknownSyncEntry& entry );
00073 
00074     ~UnknownSyncEntry();
00075 
00079     QByteArray array()const;
00080 
00084     QString path()const;
00085 
00089     QString fileName()const;
00090 
00094     int mode()const;
00095 
00099     QDateTime lastAccess()const;
00100 
00104     void setLastAccess(const QDateTime& time);
00105 
00106     QString name();
00107     QString id();
00108     QString timestamp();
00109     bool equals( SyncEntry* entry );
00110     SyncEntry* clone();
00111 
00112   private:
00113     int mMode;
00114     bool mHasAccess : 1;
00115     QByteArray mArray;
00116     QString mPath;
00117     QString mFileName;
00118     QDateTime mTime;
00119 
00120     class UnknownSyncEntryPrivate;
00121     UnknownSyncEntryPrivate *d;
00122 };
00123 
00124 class KDE_EXPORT UnknownSyncee : public Syncee
00125 {
00126   public:
00127     UnknownSyncee( Merger* m = 0);
00128     ~UnknownSyncee();
00129 
00130     UnknownSyncEntry* firstEntry();
00131     UnknownSyncEntry* nextEntry();
00132     QString type()const;
00133     void addEntry( SyncEntry*  );
00134     void removeEntry( SyncEntry* );
00135 
00136     bool writeBackup( const QString & );
00137     bool restoreBackup( const QString & );
00138 
00139   private:
00141     UnknownSyncEntry::PtrList mList;
00142 
00143     class UnknownSynceePrivate;
00144     UnknownSynceePrivate *d;
00145 };
00146 
00147 }
00148 
00149 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys