kpilot Library API Documentation

doc-conduit.h

00001 #ifndef _doc_CONDUIT_H 00002 #define _doc_CONDUIT_H 00003 /* doc-conduit.h KPilot 00004 ** 00005 ** Copyright (C) 2002-2003 by Reinhold Kainhofer 00006 ** 00007 */ 00008 00009 /* 00010 ** This program is free software; you can redistribute it and/or modify 00011 ** it under the terms of the GNU General Public License as published by 00012 ** the Free Software Foundation; either version 2 of the License, or 00013 ** (at your option) any later version. 00014 ** 00015 ** This program is distributed in the hope that it will be useful, 00016 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 ** GNU General Public License for more details. 00019 ** 00020 ** You should have received a copy of the GNU General Public License 00021 ** along with this program in a file called COPYING; if not, write to 00022 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00023 ** MA 02111-1307, USA. 00024 */ 00025 00026 /* 00027 ** Bug reports and questions can be sent to kde-pim@kde.org 00028 */ 00029 00030 00031 #include <plugin.h> 00032 00033 class docSyncInfo; 00034 typedef QValueList<docSyncInfo> syncInfoList; 00035 00036 typedef enum eSyncDirectionEnum { 00037 eSyncNone, 00038 // eSyncAll, 00039 eSyncPDAToPC, 00040 eSyncPCToPDA, 00041 eSyncDelete, 00042 eSyncConflict 00043 }; 00044 typedef enum eTextStatus { 00045 eStatNone=0, 00046 eStatNew=1, 00047 eStatChanged=2, 00048 eStatBookmarksChanged=4, 00049 eStatDeleted=8, 00050 eStatDoesntExist=16 00051 }; 00052 00053 00054 QString dirToString(eSyncDirectionEnum dir); 00055 00056 class DOCConduit:public ConduitAction { 00057 Q_OBJECT 00058 public: 00059 eSyncDirectionEnum eSyncDirection; 00060 00061 public: 00062 DOCConduit(KPilotDeviceLink * o, 00063 const char *n = 0L, const QStringList & a = QStringList()); 00064 virtual ~ DOCConduit(); 00065 00066 bool encode(QStringList fileName, PilotDatabase * db); 00067 bool decode(PilotDatabase * db, QString fileName); 00068 virtual bool exec(); 00069 protected: 00070 virtual bool isCorrectDBTypeCreator(DBInfo dbinfo); 00071 virtual const unsigned long dbtype(); 00072 virtual const unsigned long dbcreator(); 00073 00074 public slots: 00077 void syncNextDB(); 00078 void syncNextTXT(); 00079 void checkPDBFiles(); 00080 void checkDeletedDocs(); 00081 void resolve(); 00082 void syncDatabases(); 00083 void cleanup(); 00084 00085 private: 00090 void readConfig(); 00091 00095 bool needsSync(docSyncInfo &sinfo); 00100 PilotDatabase *preSyncAction(docSyncInfo &sinfo) const; 00101 00102 bool doSync(docSyncInfo &sinfo); 00107 bool postSyncAction(PilotDatabase * dbinfo, docSyncInfo &sinfo, bool res = true); 00108 00109 bool pcTextChanged(QString txtfn); 00110 bool hhTextChanged(PilotDatabase*docdb); 00111 00115 PilotDatabase*openDOCDatabase(QString dbname); 00116 00117 QString constructPDBFileName(QString name); 00118 QString constructTXTFileName(QString name); 00119 00120 00121 QString fTXTDir, fPDBDir; 00122 bool fKeepPDBLocally; 00123 eSyncDirectionEnum eConflictResolution; 00124 int fTXTBookmarks, fPDBBookmarks; 00125 bool fCompress, fIgnoreBmkChangesOnly, fLocalSync, fAlwaysUseResolution; 00126 QStringList fDBListSynced; 00127 QStringList fDBNames; 00128 syncInfoList fSyncInfoList; 00129 syncInfoList::Iterator fSyncInfoListIterator; 00130 long int dbnr; 00131 00132 QStringList docnames; 00133 QStringList::Iterator dociterator; 00134 }; 00135 00136 class docSyncInfo 00137 { 00138 public: 00139 docSyncInfo(QString hhDB=QString(), QString txtfn=QString(), QString pdbfn=QString(), eSyncDirectionEnum dir=eSyncNone) 00140 { 00141 handheldDB=hhDB; 00142 txtfilename=txtfn; 00143 pdbfilename=pdbfn; 00144 direction=dir; 00145 fPCStatus=eStatNone; 00146 fPalmStatus=eStatNone; 00147 }; 00148 ~docSyncInfo(){}; 00149 QString handheldDB, txtfilename, pdbfilename; 00150 DBInfo dbinfo; 00151 eSyncDirectionEnum direction; 00152 eTextStatus fPCStatus, fPalmStatus; 00153 }; 00154 00155 00156 #endif
KDE Logo
This file is part of the documentation for kpilot Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 23:57:48 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003