pilotDatabase.h
00001
#ifndef _KPILOT_PILOTDATABASE_H
00002
#define _KPILOT_PILOTDATABASE_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
#ifdef HAVE_CONFIG_H
00033
#include "config.h"
00034
#endif
00035
00036
#include <qobject.h>
00037
#include <qvaluelist.h>
00038
00039
00040
00041
00042
#ifdef TIME_WITH_SYS_TIME
00043
# include <sys/time.h>
00044
# include <time.h>
00045
#else
00046
# ifdef HAVE_SYS_TIME_H
00047
# include <sys/time.h>
00048
# else
00049
# include <time.h>
00050
# endif
00051
#endif
00052
00053
#include <pi-macros.h>
00054
00055
#include "pilotRecord.h"
00056
00057
00058
00067 class PilotDatabase :
public QObject
00068 {
00069 Q_OBJECT
00070
public:
00071
PilotDatabase(QObject *,
const char *);
00072
virtual ~
PilotDatabase();
00073
00074
enum { MAX_APPINFO_SIZE=8192
00075 } Constants;
00076
00082
virtual bool createDatabase(
long creator=0,
long type=0,
00083
int cardno=0,
int flags=0,
int version=0) = 0;
00084
00090
virtual int deleteDatabase()=0;
00091
00093
virtual int readAppBlock(
unsigned char* buffer,
int maxLen) = 0;
00094
00096
virtual int writeAppBlock(
unsigned char* buffer,
int len) = 0;
00097
00099
virtual int recordCount()=0;
00100
00102
virtual QValueList<recordid_t>
idList()=0;
00103
00105
virtual PilotRecord*
readRecordById(recordid_t
id) = 0;
00106
00108
virtual PilotRecord*
readRecordByIndex(
int index) = 0;
00109
00111
virtual PilotRecord*
readNextRecInCategory(
int category) = 0;
00112
00119
virtual PilotRecord*
readNextModifiedRec(
int *ind=NULL) = 0;
00120
00125
virtual recordid_t
writeRecord(PilotRecord* newRecord) = 0;
00126
00134
virtual int deleteRecord(recordid_t
id,
bool all=
false) = 0;
00135
00137
virtual int resetSyncFlags() = 0;
00138
00140
virtual int resetDBIndex() = 0;
00141
00143
virtual int cleanup() = 0;
00144
00145
bool isDBOpen()
const {
return fDBOpen; }
00146
00151
virtual QString
dbPathName()
const = 0;
00152
00157
static void listAppInfo(
const struct CategoryAppInfo *);
00158
00159
protected:
00160
virtual void openDatabase() = 0;
00161
virtual void closeDatabase() = 0;
00162
00163
void setDBOpen(
bool yesno) { fDBOpen = yesno; }
00164
00165
private:
00166
bool fDBOpen;
00167 };
00168
00169
#endif
This file is part of the documentation for kpilot Library Version 3.2.2.