/home/matthew/data/programming/current/libircpp/channeluserlist.h

00001 /* 
00002  * libircpp++ channeluserlist.h
00003  */
00004 #ifndef __CHANNELUSERLIST_H__
00005 #define __CHANNELUSERLIST_H__
00006 
00007 #include <string>
00008 #include "entity.h"
00009 #include "user.h"
00010 #include "irclist.h"
00011 
00012 namespace ircpp {
00013         class message;
00014         class channel;
00015 
00016         class channeluserlist
00017         {
00018                 /* Interface functions */
00019                 public:
00020                         /* Constructors and destructors */
00021                         channeluserlist(session& s, channel& c, listmode mode);
00022                         ~channeluserlist();
00023 
00024                         /* Data access functions */
00025                         user& find(const std::string& name) const;
00026                         bool add(user& u);
00027                         user& user_just_left(); /* If a user just left this channel, returns it, once only. see implementation for details */
00028                         /* TODO v0.2 multiple lists for all-users, ops, voices, normal users, halfops?, and a parameter to begin and end to choose which list ye want */
00029                         irclist<user>::iterator begin() const;
00030                         irclist<user>::iterator end() const;
00031                         size_t count() const;
00032                         void disconnect_signals();
00033 
00034                 private:
00035                         bool clear();
00036 
00037                         /* Slots */
00038                         void pre_names_slot(const message& msg);
00039                         void pre_join_slot(const std::string& s_user, const std::string& channel);
00040                         void pre_leave_slot(message& msg);
00041                         void post_leave_slot(message& msg);
00042                         void user_deleting_slot(entity& u);
00043 
00044                         /* Connections to slots */
00045                         boost::signals::connection pre_join_connection;
00046                         boost::signals::connection pre_names_connection;
00047                         boost::signals::connection pre_leave_connection;
00048                         boost::signals::connection post_leave_connection;
00049 
00050                 /* Private data */
00051                 private:
00052                         session& _s;
00053                         channel& _c;
00054                         listmode _mode;
00055                         irclist<user> _list;
00056                         user* _user_just_left;
00057         };
00058 
00059 } /* namespace ircpp */
00060 
00061 #endif /* __CHANNELUSERLIST_H__ */

Generated on Sat Oct 13 23:35:40 2007 for libircpp by  doxygen 1.5.3