kpilot

idmapper.h

Go to the documentation of this file.
00001 #ifndef _KPILOT_IDMAPPER_H
00002 #define _KPILOT_IDMAPPER_H
00003 /*
00004 ** Copyright (C) 2006 Bertjan Broeksema <bbroeksema@bluebottle.com>
00005 */
00006 
00007 /*
00008 ** This program is free software; you can redistribute it and/or modify
00009 ** it under the terms of the GNU Lesser General Public License as published by
00010 ** the Free Software Foundation; either version 2.1 of the License, or
00011 ** (at your option) any later version.
00012 **
00013 ** This program is distributed in the hope that it will be useful,
00014 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016 ** GNU Lesser General Public License for more details.
00017 **
00018 ** You should have received a copy of the GNU Lesser General Public License
00019 ** along with this program in a file called COPYING; if not, write to
00020 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00021 ** MA 02110-1301, USA.
00022 */
00023 
00024 /*
00025 ** Bug reports and questions can be sent to kde-pim@kde.org
00026 */
00027 
00028 #include <qstring.h>
00029 #include <qdatetime.h>
00030 #include <qvaluelist.h>
00031 
00032 #include "pi-macros.h"
00033 
00034 #include <kconfig.h>
00035 
00036 class IDMapperPrivate;
00037 
00043 class IDMapper
00044 {
00045 public:
00049     IDMapper();
00050     
00054     IDMapper( const QString &file );
00055     
00056     ~IDMapper();
00057     
00061     void registerPCObjectId( const QString &conduit, const QString &uid );
00062     
00066     QValueList<QString> getPCObjectIds( const QString &conduit );
00067     
00071     void registerHHObjectId( const QString &conduit, recordid_t pid );
00072     
00076     QValueList<recordid_t> getHHObjectIds( const QString &conduit );
00077     
00082     void setPCObjectId( const QString &conduit, recordid_t pid
00083         , const QString &uid );
00084     
00089     void setHHObjectId( const QString &conduit, const QString &uid
00090         , recordid_t pid );
00091     
00096     recordid_t getHHObjectId( const QString &conduit, const QString &uid );
00097     
00102     QString getHHObjectId( const QString &conduit, recordid_t pid );
00103     
00109     bool hasPCId( const QString &conduit, recordid_t pid );
00110     
00116     bool hasHHId( const QString &conduit, const QString &uid );
00117     
00123     void setLastSyncTime( const QString &conduit, const QString &uid,
00124         const QDateTime &date );
00125     
00131     void setLastSyncTime( const QString &conduit, recordid_t pid
00132         , const QDateTime &date );
00133     
00141     QDateTime lastTimeSynced( const QString &conduit, const QString &uid );
00142     
00150     QDateTime lastTimeSynced( const QString &conduit, recordid_t pid );
00151 
00152 protected:
00153     bool openDatasource( const QString &file );
00154 
00155 private:
00156     IDMapperPrivate *fP;
00157 };
00158 
00159 #endif