00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef CAPABILITIES_H
00024 #define CAPABILITIES_H
00025
00026 #include <libicq2000/buffer.h>
00027
00028 #include <set>
00029
00030 namespace ICQ2000 {
00031
00032 class Capabilities {
00033 public:
00034
00035
00036
00037
00038
00039
00040 enum Flag {
00041 Chat = 0,
00042 Voice = 1,
00043 SendFile = 2,
00044 ICQ = 3,
00045 IMImage = 4,
00046 BuddyIcon = 5,
00047 SaveStocks = 6,
00048 GetFile = 7,
00049 ICQServerRelay = 8,
00050 Games = 9,
00051 Games2 = 10,
00052 SendBuddyList = 11,
00053 ICQRTF = 12,
00054 ICQUnknown = 13,
00055 Empty = 14,
00056 TrillianCrypt = 15,
00057 APInfo = 16,
00058 ICQUnknown2 = 17
00059 };
00060
00061 private:
00062 static const unsigned int sizeof_cap = 16;
00063
00064 struct Block {
00065 Flag flag;
00066 unsigned char data[sizeof_cap];
00067 };
00068 static const Block caps[];
00069
00070 std::set<Flag> m_flags;
00071
00072 public:
00073 Capabilities();
00074
00075 void default_icq2000_capabilities();
00076 void default_icq2002_capabilities();
00077
00078 void clear();
00079 void set_capability_flag(Flag f);
00080 void clear_capability_flag(Flag f);
00081 bool has_capability_flag(Flag f) const;
00082
00083 void Parse(Buffer& b, unsigned short len);
00084 void Output(Buffer& b) const;
00085
00086 unsigned short get_length() const;
00087
00088 bool get_accept_adv_msgs() const;
00089 };
00090
00091 }
00092
00093 #endif