Main Page   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 
00043   // ----------------- Visible/invisible List (Family 0x0009) SNACs -----------
00044 
00045   class BOSFamilySNAC : virtual public SNAC {
00046    public:
00047     unsigned short Family() const { return SNAC_FAM_BOS; }
00048   };
00049 
00050   class AddVisibleSNAC : public BOSFamilySNAC, public OutSNAC {
00051    private:
00052     list<string> m_buddy_list;
00053     
00054    protected:
00055     void OutputBody(Buffer& b) const;
00056 
00057    public:
00058     AddVisibleSNAC();
00059     AddVisibleSNAC(const ContactList& l);
00060     AddVisibleSNAC(const Contact& c);
00061 
00062     void addVisible(const Contact& c);
00063 
00064     unsigned short Subtype() const { return SNAC_BOS_Add_Visible; }
00065   };
00066 
00067   class RemoveVisibleSNAC : public BOSFamilySNAC, public OutSNAC {
00068    private:
00069     list<string> m_buddy_list;
00070     
00071    protected:
00072     void OutputBody(Buffer& b) const;
00073 
00074    public:
00075     RemoveVisibleSNAC();
00076     RemoveVisibleSNAC(const ContactList& l);
00077     RemoveVisibleSNAC(const string& s);
00078 
00079     void removeVisible(const Contact& c);
00080 
00081     unsigned short Subtype() const { return SNAC_BOS_Remove_Visible; }
00082   };
00083   
00084   class AddInvisibleSNAC : public BOSFamilySNAC, public OutSNAC {
00085    private:
00086     list<string> m_buddy_list;
00087     
00088    protected:
00089     void OutputBody(Buffer& b) const;
00090 
00091    public:
00092     AddInvisibleSNAC();
00093     AddInvisibleSNAC(const ContactList& l);
00094     AddInvisibleSNAC(const Contact& c);
00095 
00096     void addInvisible(const Contact& c);
00097 
00098     unsigned short Subtype() const { return SNAC_BOS_Add_Invisible; }
00099   };
00100 
00101   class RemoveInvisibleSNAC : public BOSFamilySNAC, public OutSNAC {
00102    private:
00103     list<string> m_buddy_list;
00104     
00105    protected:
00106     void OutputBody(Buffer& b) const;
00107 
00108    public:
00109     RemoveInvisibleSNAC();
00110     RemoveInvisibleSNAC(const ContactList& l);
00111     RemoveInvisibleSNAC(const string& s);
00112 
00113     void removeInvisible(const Contact& c);
00114 
00115     unsigned short Subtype() const { return SNAC_BOS_Remove_Invisible; }
00116   };
00117   
00118 }
00119 
00120 #endif

Generated on Tue Jan 15 12:24:35 2002 for libicq2000 by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001