Code

Add gui code for registration
[inkscape.git] / src / pedro / pedroxmpp.h
1 #ifndef __XMPP_H__
2 #define __XMPP_H__
3 /*
4  * API for the Pedro mini-XMPP client.
5  *
6  * Authors:
7  *   Bob Jamison
8  *
9  * Copyright (C) 2005 Bob Jamison
10  *
11  *  This library is free software; you can redistribute it and/or
12  *  modify it under the terms of the GNU Lesser General Public
13  *  License as published by the Free Software Foundation; either
14  *  version 2.1 of the License, or (at your option) any later version.
15  *
16  *  This library is distributed in the hope that it will be useful,
17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  *  Lesser General Public License for more details.
20  *
21  *  You should have received a copy of the GNU Lesser General Public
22  *  License along with this library; if not, write to the Free Software
23  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24  */
26 #include <stdio.h>
27 #include <vector>
29 #include <string>
31 #include "pedrodom.h"
33 namespace Pedro
34 {
36 typedef std::string DOMString;
39 //########################################################################
40 //# X M P P    E V E N T
41 //########################################################################
42 class XmppUser
43 {
44 public:
45     XmppUser()
46         {
47         }
48     XmppUser(const DOMString &jidArg, const DOMString &nickArg)
49         {
50         jid  = jidArg;
51         nick = nickArg;
52         }
53     XmppUser(const DOMString &jidArg,          const DOMString &nickArg,
54              const DOMString &subscriptionArg, const DOMString &groupArg)
55         {
56         jid          = jidArg;
57         nick         = nickArg;
58         subscription = subscriptionArg;
59         group        = groupArg;
60         }
61     XmppUser(const XmppUser &other)
62         {
63         jid          = other.jid;
64         nick         = other.nick;
65         subscription = other.subscription;
66         group        = other.group;
67         show         = other.show;
68         }
69     XmppUser &operator=(const XmppUser &other)
70         {
71         jid          = other.jid;
72         nick         = other.nick;
73         subscription = other.subscription;
74         group        = other.group;
75         show         = other.show;
76         return *this;
77         }
78     virtual ~XmppUser()
79         {}
80     DOMString jid;
81     DOMString nick;
82     DOMString subscription;
83     DOMString group;
84     DOMString show;
85 };
91 /**
92  * Class that emits information from a client
93  */
94 class XmppEvent
95 {
97 public:
99     /**
100      * People might want to refer to these docs to understand
101      * the XMPP terminology used here.
102      * http://www.ietf.org/rfc/rfc3920.txt      -- Xmpp Core
103      * http://www.ietf.org/rfc/rfc3921.txt      -- Messaging and presence
104      * http://www.jabber.org/jeps/jep-0077.html -- In-Band registration
105      * http://www.jabber.org/jeps/jep-0045.html -- Multiuser Chat
106      * http://www.jabber.org/jeps/jep-0047.html -- In-Band byte streams
107      * http://www.jabber.org/jeps/jep-0096.html -- File transfer
108      */
110     /**
111      *  No event type.  Default
112      */
113     static const int EVENT_NONE                 =  0;
115     /**
116      *  Client emits a status message.  Message is in getData().
117      */
118     static const int EVENT_STATUS               =  1;
120     /**
121      *  Client emits an error message.  Message is in getData().
122      */
123     static const int EVENT_ERROR                =  2;
125     /**
126      *  Client has connected to a host.  Host name is in getData().
127      */
128     static const int EVENT_CONNECTED            = 10;
130     /**
131      *  Client has disconnected from a host.  Host name is in getData().
132      */
133     static const int EVENT_DISCONNECTED         = 11;
135     /**
136      *  Client has successfully registered a new account on a server.
137      *  The server is in getFrom(), the user in getTo()
138      */
139     static const int EVENT_REGISTRATION_NEW     = 20;
141     /**
142      *  Client has successfully changed the password of an existing account on a server.
143      *  The server is in getFrom(), the user in getTo()
144      */
145     static const int EVENT_REGISTRATION_CHANGE_PASS  = 21;
147     /**
148      *  Client has successfully cancelled an existing account on a server.
149      *  The server is in getFrom(), the user in getTo()
150      */
151     static const int EVENT_REGISTRATION_CANCEL  = 22;
153     /**
154      *  A <presence> packet has been received.
155      *  getFrom()     returns the full jabber id
156      *  getPresence() returns the available/unavailable boolean
157      *  getShow()     returns the jabber 'show' string: 'show', 'away', 'xa', etc
158      *  getStatus()   returns a status message, sent from a client
159      *  Note: if a presence packet is determined to be MUC, it is
160      *    rather sent as an EVENT_MUC_JOIN, LEAVE, or PRESENCE
161      */
162     static const int EVENT_PRESENCE             = 30;
164     /**
165      *  Client has just received a complete roster.  The collected information
166      *  can be found at client.getRoster(), and is a std::vector of XmppUser
167      *  records.
168      */
169     static const int EVENT_ROSTER               = 31;
171     /**
172      *  Client has just received a message packet.
173      *  getFrom() returns the full jabber id of the sender
174      *  getData() returns the text of the message
175      *  getDom()  returns the DOM treelet for this stanza.  This is provided
176      *                to make message extension easier.
177      *  Note: if a message packet is determined to be MUC, it is
178      *    rather sent as an EVENT_MUC_MESSAGE
179      */
180     static const int EVENT_MESSAGE              = 32;
182     /**
183      *  THIS user has just joined a multi-user chat group.
184      *  getGroup()    returns the group name
185      *  getFrom()     returns the nick of the user in the group
186      *  getPresence() returns the available/unavailable boolean
187      *  getShow()     returns the jabber 'show' string: 'show', 'away', 'xa', etc
188      *  getStatus()   returns a status message, sent from a client
189      */
190     static const int EVENT_MUC_JOIN             = 40;
192     /**
193      *  THIS user has just left a multi-user chat group.
194      *  getGroup()    returns the group name
195      *  getFrom()     returns the nick of the user in the group
196      *  getPresence() returns the available/unavailable boolean
197      *  getShow()     returns the jabber 'show' string: 'show', 'away', 'xa', etc
198      *  getStatus()   returns a status message, sent from a client
199      */
200     static const int EVENT_MUC_LEAVE            = 41;
202     /**
203      *  Presence for another user in a multi-user chat room.
204      *  getGroup()    returns the group name
205      *  getFrom()     returns the nick of the user in the group
206      *  getPresence() returns the available/unavailable boolean
207      *  getShow()     returns the jabber 'show' string: 'show', 'away', 'xa', etc
208      *  getStatus()   returns a status message, sent from a client
209      */
210     static const int EVENT_MUC_PRESENCE         = 42;
212     /**
213      *  Client has just received a message packet from a multi-user chat room
214      *  getGroup() returns the group name
215      *  getFrom()  returns the full jabber id of the sender
216      *  getData()  returns the text of the message
217      *  getDom()   returns the DOM treelet for this stanza.  This is provided
218      *             to make message extension easier.
219      */
220     static const int EVENT_MUC_MESSAGE          = 43;
222     /**
223      *  Client has begun receiving a stream
224      */
225     static const int EVENT_STREAM_RECEIVE_INIT  = 50;
227     /**
228      *  Client receives another stream packet.
229      */
230     static const int EVENT_STREAM_RECEIVE       = 51;
232     /**
233      * Client has received the end of a stream
234      */
235     static const int EVENT_STREAM_RECEIVE_CLOSE = 52;
237     /**
238      * Other client has accepted a file.
239      */
240     static const int EVENT_FILE_ACCEPTED        = 60;
242     /**
243      * This client has just received a file.
244      */
245     static const int EVENT_FILE_RECEIVE         = 61;
247     /**
248      *  Constructs an event with one of the types above.
249      */
250     XmppEvent(int type);
252     /**
253      *  Copy constructor
254      */
255     XmppEvent(const XmppEvent &other);
257     /**
258      *  Assignment
259      */
260     virtual XmppEvent &operator=(const XmppEvent &other);
262     /**
263      *  Destructor
264      */
265     virtual ~XmppEvent();
267     /**
268      *  Assignment
269      */
270     virtual void assign(const XmppEvent &other);
272     /**
273      *  Return the event type.
274      */
275     virtual int getType() const;
278     /**
279      *
280      */
281     virtual DOMString getIqId() const;
284     /**
285      *
286      */
287     virtual void setIqId(const DOMString &val);
289     /**
290      *
291      */
292     virtual DOMString getStreamId() const;
295     /**
296      *
297      */
298     virtual void setStreamId(const DOMString &val);
300     /**
301      *
302      */
303     virtual bool getPresence() const;
306     /**
307      *
308      */
309     virtual void setPresence(bool val);
311     /**
312      *
313      */
314     virtual DOMString getShow() const;
317     /**
318      *
319      */
320     virtual void setShow(const DOMString &val);
322     /**
323      *
324      */
325     virtual DOMString getStatus() const;
327     /**
328      *
329      */
330     virtual void setStatus(const DOMString &val);
332     /**
333      *
334      */
335     virtual DOMString getTo() const;
337     /**
338      *
339      */
340     virtual void setTo(const DOMString &val);
342     /**
343      *
344      */
345     virtual DOMString getFrom() const;
347     /**
348      *
349      */
350     virtual void setFrom(const DOMString &val);
352     /**
353      *
354      */
355     virtual DOMString getGroup() const;
357     /**
358      *
359      */
360     virtual void setGroup(const DOMString &val);
362     /**
363      *
364      */
365     virtual Element *getDOM() const;
368     /**
369      *
370      */
371     virtual void setDOM(const Element *val);
373     /**
374      *
375      */
376     virtual std::vector<XmppUser> getUserList() const;
378     /**
379      *
380      */
381     virtual void setUserList(const std::vector<XmppUser> &userList);
383     /**
384      *
385      */
386     virtual DOMString getFileName() const;
389     /**
390      *
391      */
392     virtual void setFileName(const DOMString &val);
395     /**
396      *
397      */
398     virtual DOMString getFileDesc() const;
401     /**
402      *
403      */
404     virtual void setFileDesc(const DOMString &val);
407     /**
408      *
409      */
410     virtual long getFileSize() const;
413     /**
414      *
415      */
416     virtual void setFileSize(long val);
418     /**
419      *
420      */
421     virtual DOMString getFileHash() const;
423     /**
424      *
425      */
426     virtual void setFileHash(const DOMString &val);
428     /**
429      *
430      */
431     virtual DOMString getData() const;
434     /**
435      *
436      */
437     virtual void setData(const DOMString &val);
439 private:
441     int eventType;
443     DOMString iqId;
445     DOMString streamId;
447     bool      presence;
449     DOMString show;
451     DOMString status;
453     DOMString to;
455     DOMString from;
457     DOMString group;
459     DOMString data;
461     DOMString fileName;
462     DOMString fileDesc;
463     long      fileSize;
464     DOMString fileHash;
466     Element *dom;
468     std::vector<XmppUser>userList;
470 };
477 //########################################################################
478 //# X M P P    E V E N T    L I S T E N E R
479 //########################################################################
481 /**
482  * Class that receives and processes an XmppEvent.  Users should inherit
483  * from this class, and overload processXmppEvent() to perform their event
484  * handling
485  */
486 class XmppEventListener
488 public:
490     /**
491      *  Constructor  
492      */
493     XmppEventListener()
494         {}
496     /**
497      *  Assignment
498      */
499     XmppEventListener(const XmppEventListener &other)
500         {}
503     /**
504      * Destructor
505      */
506     virtual ~XmppEventListener()
507         {}
509     /**
510      *  Overload this method to provide your application-specific
511      *  event handling.  Use event.getType() to decide what to do
512      *  with the event.
513      */
514     virtual void processXmppEvent(const XmppEvent &event)
515         {}
517 };
521 //########################################################################
522 //# X M P P    E V E N T    T A R G E T
523 //########################################################################
525 /**
526  * A base class for classes that emit XmppEvents.
527  *
528  * Note: terminology: 'target' is the common term for this, although it
529  * seems odd that a 'target' is the source of the events.  It is clearer
530  * if you consider that the greater system targets this class with events,
531  * and this class delegates the handling to its listeners.
532  */
533 class XmppEventTarget
535 public:
537     /**
538      * Constructor
539      */
540     XmppEventTarget();
542     /**
543      *  Copy constructor
544      */
545     XmppEventTarget(const XmppEventTarget &other);
547     /**
548      * Destructor
549      */
550     virtual ~XmppEventTarget();
553     //###########################
554     //# M E S S A G E S
555     //###########################
558     /**
559      * Send an error message to all subscribers
560      */
561     void error(char *fmt, ...);
564     /**
565      * Send a status message to all subscribers
566      */
567     void status(char *fmt, ...);
569     //###########################
570     //# LISTENERS
571     //###########################
573     /**
574      *  Subscribe a subclass of XmppEventListener to this target's events.
575      */
576     virtual void addXmppEventListener(const XmppEventListener &listener);
578     /**
579      *  Unsubscribe a subclass of XmppEventListener from this target's events.
580      */
581     virtual void removeXmppEventListener(const XmppEventListener &listener);
583     /**
584      *  Remove all event subscribers
585      */
586     virtual void clearXmppEventListeners();
588     /**
589      *  This sends an event to all registered listeners.
590      */
591     virtual void dispatchXmppEvent(const XmppEvent &event);
593     /**
594      *  By enabling this, you provide an alternate way to get XmppEvents.
595      *  Any event sent to dispatchXmppEvent() is also sent to this queue,
596      *  so that it can be later be picked up by eventQueuePop();
597      *  This can sometimes be good for GUI's which can't always respond
598      *  repidly or asynchronously.
599      */
600     void eventQueueEnable(bool val);
602     /**
603      *  Return true if there is one or more XmppEvents waiting in the event
604      *  queue.  This is used to avoid calling eventQueuePop() when there is
605      *  nothing in the queue.
606      */
607     int eventQueueAvailable();
609     /**
610      *  Return the next XmppEvent in the queue.  Users should check that
611      *  eventQueueAvailable() is greater than 0 before calling this.  If
612      *  people forget to do this, an event of type XmppEvent::EVENT_NONE
613      *  is generated and returned.
614      */
615     XmppEvent eventQueuePop();
618 private:
620     std::vector<XmppEventListener *> listeners;
622     std::vector<XmppEvent> eventQueue;
623     bool eventQueueEnabled;
625     static const int targetWriteBufLen = 2048;
627     char targetWriteBuf[targetWriteBufLen];
628 };
634 //########################################################################
635 //# X M P P    C L I E N T
636 //########################################################################
638 //forward declarations
639 class TcpSocket;
640 class XmppChat;
641 class XmppGroupChat;
642 class XmppStream;
645 /**
646  *  This is the actual XMPP (Jabber) client.
647  */
648 class XmppClient : public XmppEventTarget
651 public:
653     //###########################
654     //# CONSTRUCTORS
655     //###########################
657     /**
658      * Constructor
659      */
660     XmppClient();
662     /**
663      *  Copy constructor
664      */
665     XmppClient(const XmppClient &other);
667     /**
668      *  Assignment
669      */
670     void assign(const XmppClient &other);
672     /**
673      * Destructor
674      */
675     virtual ~XmppClient();
678     //###########################
679     //# UTILITY
680     //###########################
682     /**
683      *  Pause execution of the app for a given number of
684      *  milliseconds.  Use this rarely, only when really needed.
685      */
686     virtual bool pause(unsigned long millis);
688     /**
689      *  Process a string so that it can safely be
690      *  placed in XML as PCDATA
691      */
692     DOMString toXml(const DOMString &str);
694     //###########################
695     //# CONNECTION
696     //###########################
698     /**
699      *
700      */
701     virtual bool connect();
703     /**
704      *
705      */
706     virtual bool connect(DOMString host, int port,
707                          DOMString userName,
708                          DOMString password,
709                          DOMString resource);
711     /**
712      *
713      */
714     virtual bool disconnect();
717     /**
718      *
719      */
720     virtual bool write(char *fmt, ...);
722     //#######################
723     //# V A R I A B L E S
724     //#######################
726     /**
727      *
728      */
729     virtual bool isConnected()
730         { return connected; }
732     /**
733      *
734      */
735     virtual DOMString getHost()
736         { return host; }
738     /**
739      *
740      */
741     virtual void setHost(const DOMString &val)
742         { host = val; }
744     /**
745      *
746      */
747     virtual DOMString getRealm()
748         { return realm; }
750     /**
751      *
752      */
753     virtual void setRealm(const DOMString &val)
754         { realm = val; }
756     /**
757      *
758      */
759     virtual int getPort()
760         { return port; }
762     /**
763      *
764      */
765     virtual void setPort(int val)
766         { port = val; }
768     /**
769      *
770      */
771     virtual DOMString getUsername();
773     /**
774      *
775      */
776     virtual void setUsername(const DOMString &val);
778     /**
779      *
780      */
781     virtual DOMString getPassword()
782         { return password; }
784     /**
785      *
786      */
787     virtual void setPassword(const DOMString &val)
788         { password = val; }
790     /**
791      *
792      */
793     virtual DOMString getResource()
794         { return resource; }
796     /**
797      *
798      */
799     virtual void setResource(const DOMString &val)
800         { resource = val; }
802     /**
803      *
804      */
805     virtual DOMString getJid()
806         { return jid; }
808     /**
809      *
810      */
811     virtual int getMsgId()
812         { return msgId++; }
816     //#######################
817     //# P R O C E S S I N G
818     //#######################
821     /**
822      *
823      */
824     bool processMessage(Element *root);
826     /**
827      *
828      */
829     bool processPresence(Element *root);
831     /**
832      *
833      */
834     bool processIq(Element *root);
836     /**
837      *
838      */
839     virtual bool receiveAndProcess();
841     /**
842      *
843      */
844     virtual bool receiveAndProcessLoop();
846     //#######################
847     //# ROSTER
848     //#######################
850     /**
851      *
852      */
853     bool rosterAdd(const DOMString &rosterGroup,
854                    const DOMString &otherJid,
855                    const DOMString &name);
857     /**
858      *
859      */
860     bool rosterDelete(const DOMString &otherJid);
862     /**
863      *
864      */
865     std::vector<XmppUser> getRoster();
867     /**
868      *
869      */
870     virtual void rosterShow(const DOMString &jid, const DOMString &show);
872     //#######################
873     //# REGISTRATION
874     //#######################
876     /**
877      *  Set whether the client should to in-band registration
878      *  before authentication.  Causes inBandRegistrationNew() to be called
879      *  synchronously, before async is started.
880      */
881     virtual void setDoRegister(bool val)
882         { doRegister = val; }
884     /**
885      * Change the password of an existing account with a server
886      */
887     bool inBandRegistrationChangePassword(const DOMString &newPassword);
889     /**
890      * Cancel an existing account with a server
891      */
892     bool inBandRegistrationCancel();
895     //#######################
896     //# CHAT (individual)
897     //#######################
899     /**
900      *
901      */
902     virtual bool message(const DOMString &user, const DOMString &subj,
903                          const DOMString &text);
905     /**
906      *
907      */
908     virtual bool message(const DOMString &user, const DOMString &text);
910     /**
911      *
912      */
913     virtual bool presence(const DOMString &presence);
915     //#######################
916     //# GROUP CHAT
917     //#######################
919     /**
920      *
921      */
922     virtual bool groupChatCreate(const DOMString &groupJid);
924     /**
925      *
926      */
927     virtual void groupChatDelete(const DOMString &groupJid);
929     /**
930      *
931      */
932     bool groupChatExists(const DOMString &groupJid);
934     /**
935      *
936      */
937     virtual void groupChatsClear();
939     /**
940      *
941      */
942     virtual void groupChatUserAdd(const DOMString &groupJid,
943                                   const DOMString &nick,
944                                   const DOMString &jid);
945     /**
946      *
947      */
948     virtual void groupChatUserShow(const DOMString &groupJid,
949                                    const DOMString &nick,
950                                    const DOMString &show);
952     /**
953      *
954      */
955     virtual void groupChatUserDelete(const DOMString &groupJid,
956                                      const DOMString &nick);
958     /**
959      *
960      */
961     virtual std::vector<XmppUser>
962           XmppClient::groupChatGetUserList(const DOMString &groupJid);
964     /**
965      *
966      */
967     virtual bool groupChatJoin(const DOMString &groupJid,
968                                const DOMString &nick,
969                                const DOMString &pass);
971     /**
972      *
973      */
974     virtual bool groupChatLeave(const DOMString &groupJid,
975                                 const DOMString &nick);
977     /**
978      *
979      */
980     virtual bool groupChatMessage(const DOMString &groupJid,
981                                   const DOMString &msg);
983     /**
984      *
985      */
986     virtual bool groupChatPrivateMessage(const DOMString &groupJid,
987                                          const DOMString &toNick,
988                                          const DOMString &msg);
990     /**
991      *
992      */
993     virtual bool groupChatPresence(const DOMString &groupJid,
994                                    const DOMString &nick,
995                                    const DOMString &presence);
998     //#######################
999     //# STREAMS
1000     //#######################
1002     typedef enum
1003         {
1004         STREAM_AVAILABLE,
1005         STREAM_OPENING,
1006         STREAM_OPEN,
1007         STREAM_CLOSING,
1008         STREAM_CLOSED,
1009         STREAM_ERROR
1010         } StreamStates;
1012     /**
1013      *
1014      */
1015     virtual int outputStreamOpen(const DOMString &jid,
1016                                  const DOMString &streamId);
1018     /**
1019      *
1020      */
1021     virtual int outputStreamWrite(int streamId,
1022                           const unsigned char *buf, unsigned long len);
1024     /**
1025      *
1026      */
1027     virtual int outputStreamClose(int streamId);
1029     /**
1030      *
1031      */
1032     virtual int inputStreamOpen(const DOMString &jid,
1033                                 const DOMString &streamId,
1034                                 const DOMString &iqId);
1036     /**
1037      *
1038      */
1039     virtual int inputStreamAvailable(int streamId);
1041     /**
1042      *
1043      */
1044     virtual std::vector<unsigned char> inputStreamRead(int streamId);
1046     /**
1047      *
1048      */
1049     virtual bool inputStreamClosing(int streamId);
1051     /**
1052      *
1053      */
1054     virtual int inputStreamClose(int streamId);
1057     //#######################
1058     //# FILE   TRANSFERS
1059     //#######################
1061     /**
1062      *
1063      */
1064     virtual bool fileSend(const DOMString &destJid,
1065                           const DOMString &offeredName,
1066                           const DOMString &fileName,
1067                           const DOMString &description);
1069     /**
1070      *
1071      */
1072     virtual bool fileSendBackground(const DOMString &destJid,
1073                                     const DOMString &offeredName,
1074                                     const DOMString &fileName,
1075                                     const DOMString &description);
1077     /**
1078      *
1079      */
1080     virtual bool fileReceive(const DOMString &fromJid,
1081                              const DOMString &iqId,
1082                              const DOMString &streamId,
1083                              const DOMString &fileName,
1084                              long  fileSize,
1085                              const DOMString &fileHash);
1086     /**
1087      *
1088      */
1089     virtual bool fileReceiveBackground(const DOMString &fromJid,
1090                                        const DOMString &iqId,
1091                                        const DOMString &streamId,
1092                                        const DOMString &fileName,
1093                                        long  fileSize,
1094                                        const DOMString &fileHash);
1097 private:
1099     void init();
1101     DOMString host;
1103     /**
1104      * will be same as host, unless username is
1105      * user@realm
1106      */
1107     DOMString realm;
1109     int port;
1111     DOMString username;
1113     DOMString password;
1115     DOMString resource;
1117     DOMString jid;
1119     int msgId;
1121     TcpSocket *sock;
1123     bool connected;
1125     bool createSession();
1127     bool checkConnect();
1129     DOMString readStanza();
1131     bool saslMd5Authenticate();
1133     bool saslPlainAuthenticate();
1135     bool saslAuthenticate();
1137     bool iqAuthenticate(const DOMString &streamId);
1139     /**
1140      * Register a new account with a server.  Not done by user
1141      */
1142     bool inBandRegistrationNew();
1144     bool keepGoing;
1146     bool doRegister;
1148     static const int writeBufLen = 2048;
1150     unsigned char writeBuf[writeBufLen];
1152     std::vector<XmppGroupChat *>groupChats;
1154     static const int outputStreamCount = 16;
1156     XmppStream *outputStreams[outputStreamCount];
1158     static const int inputStreamCount = 16;
1160     XmppStream *inputStreams[inputStreamCount];
1162     static const int fileSendCount = 16;
1164     XmppStream *fileSends[fileSendCount];
1166     std::vector<XmppUser>roster;
1167 };
1172 //########################################################################
1173 //# X M P P    G R O U P    C H A T
1174 //########################################################################
1176 /**
1177  *
1178  */
1179 class XmppGroupChat
1181 public:
1183     /**
1184      *
1185      */
1186     XmppGroupChat(const DOMString &groupJid);
1188     /**
1189      *
1190      */
1191     XmppGroupChat(const XmppGroupChat &other);
1193     /**
1194      *
1195      */
1196     virtual ~XmppGroupChat();
1198     /**
1199      *
1200      */
1201     virtual DOMString getGroupJid();
1203     /**
1204      *
1205      */
1206     virtual void userAdd(const DOMString &nick,
1207                          const DOMString &jid);
1208     /**
1209      *
1210      */
1211     virtual void userShow(const DOMString &nick,
1212                           const DOMString &show);
1214     /**
1215      *
1216      */
1217     virtual void userDelete(const DOMString &nick);
1219     /**
1220      *
1221      */
1222     virtual std::vector<XmppUser> getUserList() const;
1225 private:
1227     DOMString groupJid;
1229     std::vector<XmppUser>userList;
1231 };
1242 } //namespace Pedro
1244 #endif /* __XMPP_H__ */
1246 //########################################################################
1247 //# E N D    O F     F I L E
1248 //########################################################################