Updating ChangeLog for 4.22.10
[centerim.git] / src / hooks / icqhook.h
blob1950b72736b3df38667fd447180e6b2ef4fdbee9
1 #ifndef __ICQHOOK_H__
2 #define __ICQHOOK_H__
4 #include "abstracthook.h"
6 #ifdef BUILD_ICQ
8 #include "icqmlist.h"
10 #include "libicq2000/Client.h"
11 #include "libicq2000/events.h"
13 using namespace ICQ2000;
15 class icqhook: public abstracthook, public sigslot::has_slots<> {
16 protected:
17 Client cli;
19 vector<int> rfds, wfds, efds;
21 enum {
22 Normal
23 } blockmode;
25 time_t timer_poll, timer_resolve;
26 bool fonline, flogged, sblrecv;
27 unsigned int reguin;
28 SearchResultEvent *searchevent;
30 typedef pair<unsigned int, contactstatus> visInfo;
31 vector<visInfo> vislist;
32 vector<imcontact> uinstosend;
34 void connected_cb(ConnectedEvent *ev);
35 void disconnected_cb(DisconnectedEvent *ev);
36 void messaged_cb(MessageEvent *ev);
37 void messageack_cb(MessageEvent *ev);
38 void contactlist_cb(ContactListEvent *ev);
39 void contact_userinfo_change_signal_cb(UserInfoChangeEvent *ev);
40 void contact_status_change_signal_cb(StatusChangeEvent *ev);
41 void contact_typing_signal_cb(UserTypingNotificationEvent *ev);
42 void newuin_cb(NewUINEvent *ev);
43 void rate_cb(RateInfoChangeEvent *ev);
44 void logger_cb(LogEvent *ev);
45 void socket_cb(SocketEvent *ev);
46 void want_auto_resp_cb(ICQMessageEvent *ev);
47 void search_result_cb(SearchResultEvent *ev);
48 // void server_based_contact_list_cb(ServerBasedContactEvent *ev);
49 void sbl_received_cb(SBLReceivedEvent *ev);
50 void self_contact_userinfo_change_cb(UserInfoChangeEvent *ev);
51 void self_contact_status_change_cb(StatusChangeEvent *ev);
52 // void password_changed_cb(PasswordChangeEvent *ev);
54 imstatus icq2imstatus(const Status st) const;
56 void resolve();
57 void sendinvisible();
58 void updateinforecord(ContactRef ic, icqcontact *c);
59 void processemailevent(const string &sender, const string &email, const string &message);
61 ContactRef addContact(unsigned int uin, const string &groupname);
63 public:
64 icqhook();
65 ~icqhook();
67 void init();
69 void connect();
70 void disconnect();
71 void exectimers();
72 void main();
74 void getsockets(fd_set &rfds, fd_set &wfds, fd_set &efds, int &hsocket) const;
75 bool isoursocket(fd_set &rfds, fd_set &wfds, fd_set &efds) const;
77 bool online() const;
78 bool logged() const;
79 bool isconnecting() const;
80 bool enabled() const;
82 bool send(const imevent &ev);
84 void sendnewuser(const imcontact &c);
85 void removeuser(const imcontact &c);
87 void setautostatus(imstatus st);
88 imstatus getstatus() const;
90 void requestinfo(const imcontact &c);
91 void requestawaymsg(const imcontact &c);
93 bool regconnect(const string &aserv);
94 bool regattempt(unsigned int &auin, const string &apassword, const string &email);
96 void lookup(const imsearchparams &params, verticalmenu &dest);
97 void sendupdateuserinfo(const icqcontact &c);
99 void updatecontact(icqcontact *c);
100 void renamegroup(const string &oldname, const string &newname);
103 extern icqhook ihook;
105 #endif
107 #endif