kaddressbook

pab_pablib.h
1/***************************************************************************
2 pablib.h - description
3 -------------------
4 begin : Tue Jul 4 2000
5 copyright : (C) 2000 by Hans Dijkema
6 email : kmailcvt@hum.org
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18
19#ifndef PAB_LIB_H
20#define PAB_LIB_H
21
22#include <tdelocale.h>
23#include <tqfile.h>
24
25#include "pab_mapihd.h"
26
27#define INDEX_OF_INDEX 0x000000c4
28#define PAB_REC_OK 0xbcec
29#define PAB_FILE_ID 0x4e444221
30
31class pab
32{
33 friend class pabrec;
34
35 private:
36 TQFile in;
37 const char *pabfile;
38 TQString cap;
39 TQWidget *parent;
40 public:
41 pab(const char *pabFile);
42 ~pab();
43 private:
44 content_t skip(int longwords) { return relative(longwords); }
45 content_t go(adr_t);
46 content_t relative(int longwords);
47 content_t relative(pabsize_t);
48 content_t add(adr_t &,int words);
49 content_t read(void);
50 void read(unsigned char *mem,content_t size);
51 void read(word_t &);
52 pabsize_t size(content_t);
53 void size(content_t,pabsize_t &, pabsize_t &);
54 word_t lower(content_t);
55 word_t upper(content_t);
56 byte_t readbyte(void);
57 adr_t curpos(void) { return in.at(); }
58 adr_t tell(void) { return curpos(); }
59 private:
60 bool recUnknown(pabrec & R);
61 bool recNoFunction(pabrec & R);
62 const char *get(unsigned char *mem,pabrec_entry e,pabrec & R);
63 bool knownPAB(void);
64 private:
65 void rdPabRec(pabrec & R);
66 void prt(unsigned char *mem,pabrec & R,pabrec_entry E);
67 void getrange(pabrec & R,pabrec_entry e,word_t & b,word_t & _e);
68 private:
69 bool convert(adr_t A,content_t start,content_t stop);
70 void dotable(adr_t table,content_t start,content_t stop);
71 void processRec(adr_t REC);
72 public:
73 bool convert(void);
74};
75
76
77#endif