Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

SNAC-BOS.h

00001 /*
00002  * SNAC - Visible/invisible list management
00003  * Mitz Pettel, 2001
00004  *
00005  * based on: SNAC - Buddy (Contact) list management
00006  * Copyright (C) 2001 Barnaby Gray <barnaby@beedesign.co.uk>.
00007  *
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or (at
00011  * your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021  *
00022  */
00023 
00024 #ifndef SNAC_BOS_H
00025 #define SNAC_BOS_H
00026 
00027 #include <string>
00028 #include <list>
00029 
00030 #include <libicq2000/SNAC-base.h>
00031 #include <libicq2000/Contact.h>
00032 #include <libicq2000/ContactList.h>
00033 #include <libicq2000/UserInfoBlock.h>
00034 
00035 namespace ICQ2000 {
00036 
00037   // List stuff (Family 0x0009)
00038   const unsigned short SNAC_BOS_Add_Visible = 0x0005;
00039   const unsigned short SNAC_BOS_Remove_Visible = 0x0006;
00040   const unsigned short SNAC_BOS_Add_Invisible = 0x0007;
00041   const unsigned short SNAC_BOS_Remove_Invisible = 0x0008;
00042   const unsigned short SNAC_BOS_Add_Tmp_Visible = 0x000A;
00043   const unsigned short SNAC_BOS_Remove_Tmp_Visible = 0x000B;
00044 
00045   // ----------------- Visible/invisible List (Family 0x0009) SNACs -----------
00046 
00047   class BOSFamilySNAC : virtual public SNAC {
00048    public:
00049     unsigned short Family() const { return SNAC_FAM_BOS; }
00050   };
00051 
00052   class BOSListSNAC : virtual public BOSFamilySNAC, public OutSNAC {
00053     protected:
00054       std::list<std::string> m_buddy_list;
00055       void OutputBody(Buffer& b) const;
00056 
00057     public:
00058       BOSListSNAC();
00059       BOSListSNAC(const ContactList& l);
00060       BOSListSNAC(const ContactRef& c);
00061       BOSListSNAC(const std::string& s);
00062       void addContact(const ContactRef& c);
00063   };
00064 
00065 
00066   class AddVisibleSNAC : public BOSListSNAC {
00067     public:
00068       unsigned short Subtype() const { return SNAC_BOS_Add_Visible; }
00069       AddVisibleSNAC();
00070       AddVisibleSNAC(const ContactList& l);
00071       AddVisibleSNAC(const ContactRef& c);
00072       AddVisibleSNAC(const std::string& s);
00073   };
00074 
00075   class AddInvisibleSNAC : public BOSListSNAC {
00076     public:
00077       unsigned short Subtype() const { return SNAC_BOS_Add_Invisible; }
00078       AddInvisibleSNAC();
00079       AddInvisibleSNAC(const ContactList& l);
00080       AddInvisibleSNAC(const ContactRef& c);
00081       AddInvisibleSNAC(const std::string& s);
00082   };
00083 
00084   class AddTmpVisibleSNAC : public BOSListSNAC {
00085     public:
00086       unsigned short Subtype() const { return SNAC_BOS_Add_Tmp_Visible; }
00087       AddTmpVisibleSNAC();
00088       AddTmpVisibleSNAC(const ContactList& l);
00089       AddTmpVisibleSNAC(const ContactRef& c);
00090       AddTmpVisibleSNAC(const std::string& s);
00091   };
00092 
00093   class RemoveVisibleSNAC : public BOSListSNAC {
00094     public:
00095       unsigned short Subtype() const { return SNAC_BOS_Remove_Visible; }
00096       RemoveVisibleSNAC();
00097       RemoveVisibleSNAC(const ContactList& l);
00098       RemoveVisibleSNAC(const ContactRef& c);
00099       RemoveVisibleSNAC(const std::string& s);
00100   };
00101 
00102   class RemoveInvisibleSNAC : public BOSListSNAC {
00103     public:
00104       unsigned short Subtype() const { return SNAC_BOS_Remove_Invisible; }
00105       RemoveInvisibleSNAC();
00106       RemoveInvisibleSNAC(const ContactList& l);
00107       RemoveInvisibleSNAC(const ContactRef& c);
00108       RemoveInvisibleSNAC(const std::string& s);
00109   };
00110 
00111   class RemoveTmpVisibleSNAC : public BOSListSNAC {
00112     public:
00113       unsigned short Subtype() const { return SNAC_BOS_Remove_Tmp_Visible; }
00114       RemoveTmpVisibleSNAC();
00115       RemoveTmpVisibleSNAC(const ContactList& l);
00116       RemoveTmpVisibleSNAC(const ContactRef& c);
00117       RemoveTmpVisibleSNAC(const std::string& s);
00118   };
00119   
00120 }
00121 
00122 #endif

Generated on Sun Jul 21 10:57:32 2002 for libicq2000 by doxygen1.2.16