kpilot Library API Documentation

pilotSerialDatabase.h

00001 #ifndef _KPILOT_PILOTSERIALDATABASE_H
00002 #define _KPILOT_PILOTSERIALDATABASE_H
00003 /* pilotSerialDatabase.h            KPilot
00004 **
00005 ** Copyright (C) 1998-2001 by Dan Pilone
00006 **
00007 ** See the .cc file for an explanation of what this file is for.
00008 */
00009 
00010 /*
00011 ** This program is free software; you can redistribute it and/or modify
00012 ** it under the terms of the GNU Lesser General Public License as published by
00013 ** the Free Software Foundation; either version 2.1 of the License, or
00014 ** (at your option) any later version.
00015 **
00016 ** This program is distributed in the hope that it will be useful,
00017 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 ** GNU Lesser General Public License for more details.
00020 **
00021 ** You should have received a copy of the GNU Lesser General Public License
00022 ** along with this program in a file called COPYING; if not, write to
00023 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
00024 ** MA 02111-1307, USA.
00025 */
00026 
00027 /*
00028 ** Bug reports and questions can be sent to kde-pim@kde.org
00029 */
00030 
00031 // Database class for a database on the pilot connected
00032 // via the serial port (ie: hot-sync cradle)
00033 
00034 #include "pilotDatabase.h"
00035 #include "pilotRecord.h"
00036 
00037 
00038 class PilotSerialDatabase : public PilotDatabase
00039 {
00040 public:
00041     PilotSerialDatabase(int linksocket, const QString &dbName,
00042         QObject * = 0L, const char * = 0L);
00043     virtual ~PilotSerialDatabase();
00044 
00046     virtual int readAppBlock(unsigned char* buffer, int maxLen);
00048     virtual int writeAppBlock(unsigned char* buffer, int len);  
00050     virtual int recordCount();
00052      virtual QValueList<recordid_t> idList();
00054     virtual PilotRecord* readRecordById(recordid_t id);
00056     virtual PilotRecord* readRecordByIndex(int index);
00058     virtual PilotRecord* readNextRecInCategory(int category);
00064     virtual PilotRecord* readNextModifiedRec(int *ind=NULL);
00066     virtual recordid_t writeRecord(PilotRecord* newRecordb);
00072     virtual int deleteRecord(recordid_t id, bool all=false);
00074     virtual int resetSyncFlags();
00076     virtual int resetDBIndex();
00078     virtual int cleanup();
00079 
00080     virtual QString dbPathName() const;
00081 
00083     virtual int deleteDatabase();
00085     virtual bool createDatabase(long creator=0, long type=0, int cardno=0, int flags=0, int version=0);
00086     QString getDBName() { return fDBName; }
00087 
00088 protected:
00089     virtual void openDatabase();
00090     virtual void closeDatabase();
00091     int getDBHandle() { return fDBHandle; }
00092 
00093 
00094 private:
00095     void setDBHandle(int handle) { fDBHandle = handle; }
00096 
00097     QString     fDBName;
00098     int         fDBHandle;
00099     int         fDBSocket;
00100 };
00101 
00102 #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 Sat May 1 11:36:49 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003