moved the old Changelog, which only contained log from the old centericq
[centerim.git] / src / icqcontact.h
blob69a7e943f4470d30d9f21fa7e2b699523294b12f
1 #ifndef __ICQCONTACT_H_
2 #define __ICQCONTACT_H_
4 #include "icqcommon.h"
6 #include <sys/stat.h>
7 #include <dirent.h>
9 #include "cmenus.h"
11 #include "imcontact.h"
12 #include "imevents.h"
14 enum imgender {
15 genderUnspec = 0,
16 genderMale,
17 genderFemale,
18 imgender_size
21 ENUM_PLUSPLUS(imgender)
23 class icqcontact {
24 public:
25 struct basicinfo {
26 basicinfo()
27 : country(0), randomgroup(0), requiresauth(false),
28 webaware(false), authawait(false), serverbased(false) { };
30 string fname, lname, email, city, state, phone, fax;
31 string street, cellular, zip;
32 unsigned short country, randomgroup;
33 bool requiresauth, webaware, authawait, serverbased;
36 struct moreinfo {
37 moreinfo():
38 age(0), gender(genderUnspec), birth_day(0),
39 birth_month(0), birth_year(0), lang1(0), lang2(0), lang3(0),
40 timezone(0), checkfreq(0), checklast(0) {};
42 unsigned char age;
43 imgender gender;
44 string homepage;
45 unsigned int birth_day, birth_month, birth_year;
46 unsigned short lang1, lang2, lang3;
47 signed char timezone;
49 string strbirthdate() const;
50 string strtimezone() const;
52 int checkfreq, checklast;
55 struct workinfo {
56 workinfo(): country(0) {};
58 string city, state, phone, fax, street, company;
59 string dept, position, homepage, zip;
60 unsigned short country;
63 struct reginfo {
64 string service, password;
65 vector<pair<string, string> > params;
68 protected:
69 imcontact cdesc;
70 imstatus status;
72 int fupdated, groupid, fhistoffset;
73 bool finlist, congratulated, modified, fhasevents, usepgpkey, openedforchat;
74 time_t lastread, lastseen, lasttyping;
76 string sound[imevent::imeventtype_size];
77 string nick, about, dispnick, postponed, lastip, pgpkey;
79 basicinfo binfo;
80 moreinfo minfo;
81 workinfo winfo;
82 reginfo rinfo;
83 vector<string> interests, background;
85 void scanhistory();
86 string tosane(const string &p) const;
88 public:
89 icqcontact(imcontact adesc);
90 ~icqcontact();
92 void setstatus(imstatus fstatus, bool reflect = true);
93 void setlastread(time_t flastread);
94 void setlastseen();
96 void setnick(const string &fnick);
97 void setdispnick(const string &fnick);
99 void setbasicinfo(const basicinfo &ainfo);
100 void setmoreinfo(const moreinfo &ainfo);
101 void setworkinfo(const workinfo &ainfo);
102 void setreginfo(const reginfo &ainfo);
103 void setinterests(const vector<string> &ainterests);
104 void setbackground(const vector<string> &abackground);
105 void setabout(const string &data);
106 void setlastip(const string &flastip);
108 const basicinfo &getbasicinfo() const { return binfo; }
109 const moreinfo &getmoreinfo() const { return minfo; }
110 const workinfo &getworkinfo() const { return winfo; }
111 const reginfo &getreginfo() const { return rinfo; }
112 const vector<string> &getinterests() const { return interests; }
113 const vector<string> &getbackground() const { return background; }
115 string getabout() const;
116 string getlastip() const;
118 time_t getlastread() const;
119 time_t getlastseen() const;
121 imstatus getstatus() const;
123 bool hasevents() const { return fhasevents; }
124 void sethasevents(bool n) { fhasevents = n; }
125 bool isopenedforchat() const { return openedforchat; }
126 void setopenedforchat(bool n) { openedforchat = n; }
127 void toggleopenedforchat() { openedforchat = !openedforchat; }
129 string getnick() const;
130 string getdispnick() const;
132 int updated() const;
133 void unsetupdated();
135 void setsound(imevent::imeventtype event, const string &sf);
136 void playsound(imevent::imeventtype event) const;
138 void clear();
139 void load();
140 void save();
141 void remove();
142 void excludefromlist();
143 void includeintolist(int agroupid, bool reqauth);
144 void includeintolist();
145 bool inlist() const;
147 bool isbirthday() const;
148 string getdirname() const;
150 char getshortstatus() const;
152 void setpostponed(const string &apostponed);
153 string getpostponed() const;
155 int gethistoffset() const;
156 void sethistoffset(int aoffset);
158 void setgroupid(int agroupid, bool reflect = true);
159 int getgroupid() const;
161 const imcontact getdesc() const;
162 void setdesc(const imcontact &ic);
164 void remindbirthday(bool r);
166 bool operator > (const icqcontact &acontact) const;
167 static int compare1(const icqcontact& a, const icqcontact& b);
168 static int compare2(const icqcontact& a, const icqcontact& b);
170 time_t getlasttyping() const { return lasttyping; }
171 void setlasttyping(time_t t) { lasttyping = t; }
173 string getpgpkey() const;
174 void setpgpkey(const string &key);
176 bool getusepgpkey() const;
177 void setusepgpkey(bool usekey);
180 #endif