1 #ifndef __ICQCONTACT_H_
2 #define __ICQCONTACT_H_
11 #include "imcontact.h"
21 ENUM_PLUSPLUS(imgender
)
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
;
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) {};
45 unsigned int birth_day
, birth_month
, birth_year
;
46 unsigned short lang1
, lang2
, lang3
;
49 string
strbirthdate() const;
50 string
strtimezone() const;
52 int checkfreq
, checklast
;
56 workinfo(): country(0) {};
58 string city
, state
, phone
, fax
, street
, company
;
59 string dept
, position
, homepage
, zip
;
60 unsigned short country
;
64 string service
, password
;
65 vector
<pair
<string
, string
> > params
;
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
;
83 vector
<string
> interests
, background
;
86 string
tosane(const string
&p
) const;
89 icqcontact(imcontact adesc
);
92 void setstatus(imstatus fstatus
, bool reflect
= true);
93 void setlastread(time_t flastread
);
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;
135 void setsound(imevent::imeventtype event
, const string
&sf
);
136 void playsound(imevent::imeventtype event
) const;
142 void excludefromlist();
143 void includeintolist(int agroupid
, bool reqauth
);
144 void includeintolist();
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
);