00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef SNAC_BUD_H
00023 #define SNAC_BUD_H
00024
00025 #include <string>
00026 #include <list>
00027
00028 #include <libicq2000/SNAC-base.h>
00029 #include <libicq2000/Contact.h>
00030 #include <libicq2000/ContactList.h>
00031 #include <libicq2000/UserInfoBlock.h>
00032
00033 namespace ICQ2000 {
00034
00035
00036 const unsigned short SNAC_BUD_Error = 0x0001;
00037 const unsigned short SNAC_BUD_AddBuddy = 0x0004;
00038 const unsigned short SNAC_BUD_RemoveBuddy = 0x0005;
00039 const unsigned short SNAC_BUD_Online = 0x000b;
00040 const unsigned short SNAC_BUD_Offline = 0x000c;
00041
00042
00043
00044 class BUDFamilySNAC : virtual public SNAC {
00045 public:
00046 unsigned short Family() const { return SNAC_FAM_BUD; }
00047 };
00048
00049 class AddBuddySNAC : public BUDFamilySNAC, public OutSNAC {
00050 private:
00051 list<string> m_buddy_list;
00052
00053 protected:
00054 void OutputBody(Buffer& b) const;
00055
00056 public:
00057 AddBuddySNAC();
00058 AddBuddySNAC(const ContactList& l);
00059 AddBuddySNAC(const Contact& c);
00060
00061 void addBuddy(const Contact& c);
00062
00063 unsigned short Subtype() const { return SNAC_BUD_AddBuddy; }
00064 };
00065
00066 class RemoveBuddySNAC : public BUDFamilySNAC, public OutSNAC {
00067 private:
00068 list<string> m_buddy_list;
00069
00070 protected:
00071 void OutputBody(Buffer& b) const;
00072
00073 public:
00074 RemoveBuddySNAC();
00075 RemoveBuddySNAC(const ContactList& l);
00076 RemoveBuddySNAC(const string& s);
00077
00078 void removeBuddy(const Contact& c);
00079
00080 unsigned short Subtype() const { return SNAC_BUD_RemoveBuddy; }
00081 };
00082
00083 class BuddyOnlineSNAC : public BUDFamilySNAC, public InSNAC {
00084 private:
00085 UserInfoBlock m_userinfo;
00086
00087 protected:
00088 void ParseBody(Buffer& b);
00089
00090 public:
00091 BuddyOnlineSNAC();
00092
00093 const UserInfoBlock& getUserInfo() const { return m_userinfo; }
00094 unsigned short Subtype() const { return SNAC_BUD_Online; }
00095 };
00096
00097
00098 class BuddyOfflineSNAC : public BUDFamilySNAC, public InSNAC {
00099 private:
00100 UserInfoBlock m_userinfo;
00101
00102 protected:
00103 void ParseBody(Buffer& b);
00104
00105 public:
00106 BuddyOfflineSNAC();
00107
00108 UserInfoBlock getUserInfo() const { return m_userinfo; }
00109 unsigned short Subtype() const { return SNAC_BUD_Offline; }
00110 };
00111
00112
00113 }
00114
00115 #endif