ee3234fd4a69e8778c3ab9bd3c6333637102ec74
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-2007 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 <glib.h>
28 #include <vector>
29 #include <map>
31 #include <string>
33 #include "pedrodom.h"
35 namespace Pedro
36 {
38 typedef std::string DOMString;
41 //########################################################################
42 //# X M P P E V E N T
43 //########################################################################
44 class XmppUser
45 {
46 public:
47 XmppUser()
48 {
49 }
50 XmppUser(const DOMString &jidArg, const DOMString &nickArg)
51 {
52 jid = jidArg;
53 nick = nickArg;
54 }
55 XmppUser(const DOMString &jidArg, const DOMString &nickArg,
56 const DOMString &subscriptionArg, const DOMString &groupArg)
57 {
58 jid = jidArg;
59 nick = nickArg;
60 subscription = subscriptionArg;
61 group = groupArg;
62 }
63 XmppUser(const XmppUser &other)
64 {
65 jid = other.jid;
66 nick = other.nick;
67 subscription = other.subscription;
68 group = other.group;
69 show = other.show;
70 }
71 XmppUser &operator=(const XmppUser &other)
72 {
73 jid = other.jid;
74 nick = other.nick;
75 subscription = other.subscription;
76 group = other.group;
77 show = other.show;
78 return *this;
79 }
80 virtual ~XmppUser()
81 {}
82 DOMString jid;
83 DOMString nick;
84 DOMString subscription;
85 DOMString group;
86 DOMString show;
87 };
93 /**
94 * Class that emits information from a client
95 */
96 class XmppEvent
97 {
99 public:
101 /**
102 * People might want to refer to these docs to understand
103 * the XMPP terminology used here.
104 * http://www.ietf.org/rfc/rfc3920.txt -- Xmpp Core
105 * http://www.ietf.org/rfc/rfc3921.txt -- Messaging and presence
106 * http://www.jabber.org/jeps/jep-0077.html -- In-Band registration
107 * http://www.jabber.org/jeps/jep-0045.html -- Multiuser Chat
108 * http://www.jabber.org/jeps/jep-0047.html -- In-Band byte streams
109 * http://www.jabber.org/jeps/jep-0096.html -- File transfer
110 */
112 /**
113 * No event type. Default
114 */
115 static const int EVENT_NONE = 0;
117 /**
118 * Client emits a status message. Message is in getData().
119 */
120 static const int EVENT_STATUS = 1;
122 /**
123 * Client emits an error message. Message is in getData().
124 */
125 static const int EVENT_ERROR = 2;
127 /**
128 * Client has connected to a host. Host name is in getData().
129 */
130 static const int EVENT_CONNECTED = 10;
132 /**
133 * Client has disconnected from a host. Host name is in getData().
134 */
135 static const int EVENT_DISCONNECTED = 11;
137 /**
138 * Client has begun speaking to the server in SSL. This is usually
139 * emitted just before EVENT_CONNECTED, since authorization has not
140 * yet taken place.
141 */
142 static const int EVENT_SSL_STARTED = 12;
144 /**
145 * Client has successfully registered a new account on a server.
146 * The server is in getFrom(), the user in getTo()
147 */
148 static const int EVENT_REGISTRATION_NEW = 20;
150 /**
151 * Client has successfully changed the password of an existing account on a server.
152 * The server is in getFrom(), the user in getTo()
153 */
154 static const int EVENT_REGISTRATION_CHANGE_PASS = 21;
156 /**
157 * Client has successfully cancelled an existing account on a server.
158 * The server is in getFrom(), the user in getTo()
159 */
160 static const int EVENT_REGISTRATION_CANCEL = 22;
162 /**
163 * A <presence> packet has been received.
164 * getFrom() returns the full jabber id
165 * getPresence() returns the available/unavailable boolean
166 * getShow() returns the jabber 'show' string: 'show', 'away', 'xa', etc
167 * getStatus() returns a status message, sent from a client
168 * Note: if a presence packet is determined to be MUC, it is
169 * rather sent as an EVENT_MUC_JOIN, LEAVE, or PRESENCE
170 */
171 static const int EVENT_PRESENCE = 30;
173 /**
174 * Client has just received a complete roster. The collected information
175 * can be found at client.getRoster(), and is a std::vector of XmppUser
176 * records.
177 */
178 static const int EVENT_ROSTER = 31;
180 /**
181 * Client has just received a message packet.
182 * getFrom() returns the full jabber id of the sender
183 * getData() returns the text of the message
184 * getDom() returns the DOM treelet for this stanza. This is provided
185 * to make message extension easier.
186 * Note: if a message packet is determined to be MUC, it is
187 * rather sent as an EVENT_MUC_MESSAGE
188 */
189 static const int EVENT_MESSAGE = 32;
191 /**
192 * THIS user has just joined a multi-user chat group.
193 * getGroup() returns the group name
194 * getFrom() returns the nick of the user in the group
195 * getPresence() returns the available/unavailable boolean
196 * getShow() returns the jabber 'show' string: 'show', 'away', 'xa', etc
197 * getStatus() returns a status message, sent from a client
198 */
199 static const int EVENT_MUC_JOIN = 40;
201 /**
202 * THIS user has just left a multi-user chat group.
203 * getGroup() returns the group name
204 * getFrom() returns the nick of the user in the group
205 * getPresence() returns the available/unavailable boolean
206 * getShow() returns the jabber 'show' string: 'show', 'away', 'xa', etc
207 * getStatus() returns a status message, sent from a client
208 */
209 static const int EVENT_MUC_LEAVE = 41;
211 /**
212 * Presence for another user in a multi-user chat room.
213 * getGroup() returns the group name
214 * getFrom() returns the nick of the user in the group
215 * getPresence() returns the available/unavailable boolean
216 * getShow() returns the jabber 'show' string: 'show', 'away', 'xa', etc
217 * getStatus() returns a status message, sent from a client
218 */
219 static const int EVENT_MUC_PRESENCE = 42;
221 /**
222 * Client has just received a message packet from a multi-user chat room
223 * getGroup() returns the group name
224 * getFrom() returns the full jabber id of the sender
225 * getData() returns the text of the message
226 * getDom() returns the DOM treelet for this stanza. This is provided
227 * to make message extension easier.
228 */
229 static const int EVENT_MUC_MESSAGE = 43;
231 /**
232 * Client has begun receiving a stream
233 */
234 static const int EVENT_STREAM_RECEIVE_INIT = 50;
236 /**
237 * Client receives another stream packet.
238 */
239 static const int EVENT_STREAM_RECEIVE = 51;
241 /**
242 * Client has received the end of a stream
243 */
244 static const int EVENT_STREAM_RECEIVE_CLOSE = 52;
246 /**
247 * Other client has accepted a file.
248 */
249 static const int EVENT_FILE_ACCEPTED = 60;
251 /**
252 * This client has just received a file.
253 */
254 static const int EVENT_FILE_RECEIVE = 61;
256 /**
257 * Constructs an event with one of the types above.
258 */
259 XmppEvent(int type);
261 /**
262 * Copy constructor
263 */
264 XmppEvent(const XmppEvent &other);
266 /**
267 * Assignment
268 */
269 virtual XmppEvent &operator=(const XmppEvent &other);
271 /**
272 * Destructor
273 */
274 virtual ~XmppEvent();
276 /**
277 * Assignment
278 */
279 virtual void assign(const XmppEvent &other);
281 /**
282 * Return the event type.
283 */
284 virtual int getType() const;
287 /**
288 *
289 */
290 virtual DOMString getIqId() const;
293 /**
294 *
295 */
296 virtual void setIqId(const DOMString &val);
298 /**
299 *
300 */
301 virtual DOMString getStreamId() const;
304 /**
305 *
306 */
307 virtual void setStreamId(const DOMString &val);
309 /**
310 *
311 */
312 virtual bool getPresence() const;
315 /**
316 *
317 */
318 virtual void setPresence(bool val);
320 /**
321 *
322 */
323 virtual DOMString getShow() const;
326 /**
327 *
328 */
329 virtual void setShow(const DOMString &val);
331 /**
332 *
333 */
334 virtual DOMString getStatus() const;
336 /**
337 *
338 */
339 virtual void setStatus(const DOMString &val);
341 /**
342 *
343 */
344 virtual DOMString getTo() const;
346 /**
347 *
348 */
349 virtual void setTo(const DOMString &val);
351 /**
352 *
353 */
354 virtual DOMString getFrom() const;
356 /**
357 *
358 */
359 virtual void setFrom(const DOMString &val);
361 /**
362 *
363 */
364 virtual DOMString getGroup() const;
366 /**
367 *
368 */
369 virtual void setGroup(const DOMString &val);
371 /**
372 *
373 */
374 virtual Element *getDOM() const;
377 /**
378 *
379 */
380 virtual void setDOM(const Element *val);
382 /**
383 *
384 */
385 virtual std::vector<XmppUser> getUserList() const;
387 /**
388 *
389 */
390 virtual void setUserList(const std::vector<XmppUser> &userList);
392 /**
393 *
394 */
395 virtual DOMString getFileName() const;
398 /**
399 *
400 */
401 virtual void setFileName(const DOMString &val);
404 /**
405 *
406 */
407 virtual DOMString getFileDesc() const;
410 /**
411 *
412 */
413 virtual void setFileDesc(const DOMString &val);
416 /**
417 *
418 */
419 virtual long getFileSize() const;
422 /**
423 *
424 */
425 virtual void setFileSize(long val);
427 /**
428 *
429 */
430 virtual DOMString getFileHash() const;
432 /**
433 *
434 */
435 virtual void setFileHash(const DOMString &val);
437 /**
438 *
439 */
440 virtual DOMString getData() const;
443 /**
444 *
445 */
446 virtual void setData(const DOMString &val);
448 private:
450 int eventType;
452 DOMString iqId;
454 DOMString streamId;
456 bool presence;
458 DOMString show;
460 DOMString status;
462 DOMString to;
464 DOMString from;
466 DOMString group;
468 DOMString data;
470 DOMString fileName;
471 DOMString fileDesc;
472 long fileSize;
473 DOMString fileHash;
475 Element *dom;
477 std::vector<XmppUser>userList;
479 };
486 //########################################################################
487 //# X M P P E V E N T L I S T E N E R
488 //########################################################################
490 /**
491 * Class that receives and processes an XmppEvent. Users should inherit
492 * from this class, and overload processXmppEvent() to perform their event
493 * handling
494 */
495 class XmppEventListener
496 {
497 public:
499 /**
500 * Constructor
501 */
502 XmppEventListener()
503 {}
505 /**
506 * Assignment
507 */
508 XmppEventListener(const XmppEventListener &/*other*/)
509 {}
512 /**
513 * Destructor
514 */
515 virtual ~XmppEventListener()
516 {}
518 /**
519 * Overload this method to provide your application-specific
520 * event handling. Use event.getType() to decide what to do
521 * with the event.
522 */
523 virtual void processXmppEvent(const XmppEvent &/*event*/)
524 {}
526 };
530 //########################################################################
531 //# X M P P E V E N T T A R G E T
532 //########################################################################
534 /**
535 * A base class for classes that emit XmppEvents.
536 *
537 * Note: terminology: 'target' is the common term for this, although it
538 * seems odd that a 'target' is the source of the events. It is clearer
539 * if you consider that the greater system targets this class with events,
540 * and this class delegates the handling to its listeners.
541 */
542 class XmppEventTarget
543 {
544 public:
546 /**
547 * Constructor
548 */
549 XmppEventTarget();
551 /**
552 * Copy constructor
553 */
554 XmppEventTarget(const XmppEventTarget &other);
556 /**
557 * Destructor
558 */
559 virtual ~XmppEventTarget();
562 //###########################
563 //# M E S S A G E S
564 //###########################
567 /**
568 * Send an error message to all subscribers
569 */
570 void error(const char *fmt, ...) G_GNUC_PRINTF(2,3);
573 /**
574 * Send a status message to all subscribers
575 */
576 void status(const char *fmt, ...) G_GNUC_PRINTF(2,3);
578 //###########################
579 //# LISTENERS
580 //###########################
582 /**
583 * Subscribe a subclass of XmppEventListener to this target's events.
584 */
585 virtual void addXmppEventListener(const XmppEventListener &listener);
587 /**
588 * Unsubscribe a subclass of XmppEventListener from this target's events.
589 */
590 virtual void removeXmppEventListener(const XmppEventListener &listener);
592 /**
593 * Remove all event subscribers
594 */
595 virtual void clearXmppEventListeners();
597 /**
598 * This sends an event to all registered listeners.
599 */
600 virtual void dispatchXmppEvent(const XmppEvent &event);
602 /**
603 * By enabling this, you provide an alternate way to get XmppEvents.
604 * Any event sent to dispatchXmppEvent() is also sent to this queue,
605 * so that it can be later be picked up by eventQueuePop();
606 * This can sometimes be good for GUI's which can't always respond
607 * repidly or asynchronously.
608 */
609 void eventQueueEnable(bool val);
611 /**
612 * Return true if there is one or more XmppEvents waiting in the event
613 * queue. This is used to avoid calling eventQueuePop() when there is
614 * nothing in the queue.
615 */
616 int eventQueueAvailable();
618 /**
619 * Return the next XmppEvent in the queue. Users should check that
620 * eventQueueAvailable() is greater than 0 before calling this. If
621 * people forget to do this, an event of type XmppEvent::EVENT_NONE
622 * is generated and returned.
623 */
624 XmppEvent eventQueuePop();
627 private:
629 std::vector<XmppEventListener *> listeners;
631 std::vector<XmppEvent> eventQueue;
632 bool eventQueueEnabled;
633 };
639 //########################################################################
640 //# X M P P C L I E N T
641 //########################################################################
643 //forward declarations
644 class TcpSocket;
645 class XmppChat;
646 class XmppGroupChat;
647 class XmppStream;
650 /**
651 * This is the actual XMPP (Jabber) client.
652 */
653 class XmppClient : public XmppEventTarget
654 {
656 public:
658 //###########################
659 //# CONSTRUCTORS
660 //###########################
662 /**
663 * Constructor
664 */
665 XmppClient();
667 /**
668 * Copy constructor
669 */
670 XmppClient(const XmppClient &other);
672 /**
673 * Assignment
674 */
675 void assign(const XmppClient &other);
677 /**
678 * Destructor
679 */
680 virtual ~XmppClient();
683 //###########################
684 //# UTILITY
685 //###########################
687 /**
688 * Pause execution of the app for a given number of
689 * milliseconds. Use this rarely, only when really needed.
690 */
691 virtual bool pause(unsigned long millis);
693 /**
694 * Process a string so that it can safely be
695 * placed in XML as PCDATA
696 */
697 DOMString toXml(const DOMString &str);
699 //###########################
700 //# CONNECTION
701 //###########################
703 /**
704 *
705 */
706 virtual bool connect();
708 /**
709 *
710 */
711 virtual bool connect(DOMString host, int port,
712 DOMString userName,
713 DOMString password,
714 DOMString resource);
716 /**
717 *
718 */
719 virtual bool disconnect();
722 /**
723 *
724 */
725 virtual bool write(const char *fmt, ...) G_GNUC_PRINTF(2,3);
727 //#######################
728 //# V A R I A B L E S
729 //#######################
731 /**
732 *
733 */
734 virtual bool isConnected()
735 { return connected; }
737 /**
738 *
739 */
740 virtual DOMString getHost()
741 { return host; }
743 /**
744 *
745 */
746 virtual void setHost(const DOMString &val)
747 { host = val; }
749 /**
750 *
751 */
752 virtual DOMString getRealm()
753 { return realm; }
755 /**
756 *
757 */
758 virtual void setRealm(const DOMString &val)
759 { realm = val; }
761 /**
762 *
763 */
764 virtual int getPort()
765 { return port; }
767 /**
768 *
769 */
770 virtual void setPort(int val)
771 { port = val; }
773 /**
774 *
775 */
776 virtual DOMString getUsername();
778 /**
779 *
780 */
781 virtual void setUsername(const DOMString &val);
783 /**
784 *
785 */
786 virtual DOMString getPassword()
787 { return password; }
789 /**
790 *
791 */
792 virtual void setPassword(const DOMString &val)
793 { password = val; }
795 /**
796 *
797 */
798 virtual DOMString getResource()
799 { return resource; }
801 /**
802 *
803 */
804 virtual void setResource(const DOMString &val)
805 { resource = val; }
807 /**
808 *
809 */
810 virtual void setJid(const DOMString &val)
811 { jid = val; }
813 /**
814 *
815 */
816 virtual DOMString getJid()
817 { return jid; }
821 /**
822 *
823 */
824 virtual int getMsgId()
825 { return msgId++; }
829 //#######################
830 //# P R O C E S S I N G
831 //#######################
834 /**
835 *
836 */
837 bool processMessage(Element *root);
839 /**
840 *
841 */
842 bool processPresence(Element *root);
844 /**
845 *
846 */
847 bool processIq(Element *root);
849 /**
850 *
851 */
852 virtual bool receiveAndProcess();
854 /**
855 *
856 */
857 virtual bool receiveAndProcessLoop();
859 //#######################
860 //# ROSTER
861 //#######################
863 /**
864 *
865 */
866 bool rosterAdd(const DOMString &rosterGroup,
867 const DOMString &otherJid,
868 const DOMString &name);
870 /**
871 *
872 */
873 bool rosterDelete(const DOMString &otherJid);
875 /**
876 *
877 */
878 std::vector<XmppUser> getRoster();
880 /**
881 *
882 */
883 virtual void rosterShow(const DOMString &jid, const DOMString &show);
885 //#######################
886 //# REGISTRATION
887 //#######################
889 /**
890 * Set whether the client should to in-band registration
891 * before authentication. Causes inBandRegistrationNew() to be called
892 * synchronously, before async is started.
893 */
894 virtual void setDoRegister(bool val)
895 { doRegister = val; }
897 /**
898 * Change the password of an existing account with a server
899 */
900 bool inBandRegistrationChangePassword(const DOMString &newPassword);
902 /**
903 * Cancel an existing account with a server
904 */
905 bool inBandRegistrationCancel();
908 //#######################
909 //# CHAT (individual)
910 //#######################
912 /**
913 *
914 */
915 virtual bool message(const DOMString &user, const DOMString &subj,
916 const DOMString &text);
918 /**
919 *
920 */
921 virtual bool message(const DOMString &user, const DOMString &text);
923 /**
924 *
925 */
926 virtual bool presence(const DOMString &presence);
928 //#######################
929 //# GROUP CHAT
930 //#######################
932 /**
933 *
934 */
935 virtual bool groupChatCreate(const DOMString &groupJid);
937 /**
938 *
939 */
940 virtual void groupChatDelete(const DOMString &groupJid);
942 /**
943 *
944 */
945 bool groupChatExists(const DOMString &groupJid);
947 /**
948 *
949 */
950 virtual void groupChatsClear();
952 /**
953 *
954 */
955 virtual void groupChatUserAdd(const DOMString &groupJid,
956 const DOMString &nick,
957 const DOMString &jid);
958 /**
959 *
960 */
961 virtual void groupChatUserShow(const DOMString &groupJid,
962 const DOMString &nick,
963 const DOMString &show);
965 /**
966 *
967 */
968 virtual void groupChatUserDelete(const DOMString &groupJid,
969 const DOMString &nick);
971 /**
972 *
973 */
974 virtual std::vector<XmppUser>
975 groupChatGetUserList(const DOMString &groupJid);
977 /**
978 *
979 */
980 virtual bool groupChatJoin(const DOMString &groupJid,
981 const DOMString &nick,
982 const DOMString &pass);
984 /**
985 *
986 */
987 virtual bool groupChatLeave(const DOMString &groupJid,
988 const DOMString &nick);
990 /**
991 *
992 */
993 virtual bool groupChatMessage(const DOMString &groupJid,
994 const DOMString &msg);
996 /**
997 *
998 */
999 virtual bool groupChatPrivateMessage(const DOMString &groupJid,
1000 const DOMString &toNick,
1001 const DOMString &msg);
1003 /**
1004 *
1005 */
1006 virtual bool groupChatPresence(const DOMString &groupJid,
1007 const DOMString &nick,
1008 const DOMString &presence);
1011 //#######################
1012 //# STREAMS
1013 //#######################
1015 typedef enum
1016 {
1017 STREAM_AVAILABLE,
1018 STREAM_OPENING,
1019 STREAM_OPEN,
1020 STREAM_CLOSING,
1021 STREAM_CLOSED,
1022 STREAM_ERROR
1023 } StreamStates;
1025 /**
1026 *
1027 */
1028 virtual bool outputStreamOpen(const DOMString &jid,
1029 const DOMString &streamId);
1031 /**
1032 *
1033 */
1034 virtual bool outputStreamWrite(const DOMString &streamId,
1035 const std::vector<unsigned char> &buf);
1037 /**
1038 *
1039 */
1040 virtual bool outputStreamClose(const DOMString &streamId);
1042 /**
1043 *
1044 */
1045 virtual bool inputStreamOpen(const DOMString &jid,
1046 const DOMString &streamId,
1047 const DOMString &iqId);
1049 /**
1050 *
1051 */
1052 virtual bool inputStreamClose(const DOMString &streamId);
1055 //#######################
1056 //# FILE TRANSFERS
1057 //#######################
1059 /**
1060 *
1061 */
1062 virtual bool fileSend(const DOMString &destJid,
1063 const DOMString &offeredName,
1064 const DOMString &fileName,
1065 const DOMString &description);
1067 /**
1068 *
1069 */
1070 virtual bool fileSendBackground(const DOMString &destJid,
1071 const DOMString &offeredName,
1072 const DOMString &fileName,
1073 const DOMString &description);
1075 /**
1076 *
1077 */
1078 virtual bool fileReceive(const DOMString &fromJid,
1079 const DOMString &iqId,
1080 const DOMString &streamId,
1081 const DOMString &fileName,
1082 long fileSize,
1083 const DOMString &fileHash);
1084 /**
1085 *
1086 */
1087 virtual bool fileReceiveBackground(const DOMString &fromJid,
1088 const DOMString &iqId,
1089 const DOMString &streamId,
1090 const DOMString &fileName,
1091 long fileSize,
1092 const DOMString &fileHash);
1095 private:
1097 void init();
1099 DOMString host;
1101 /**
1102 * will be same as host, unless username is
1103 * user@realm
1104 */
1105 DOMString realm;
1107 int port;
1109 DOMString username;
1111 DOMString password;
1113 DOMString resource;
1115 DOMString jid;
1117 int msgId;
1119 TcpSocket *sock;
1121 bool connected;
1123 bool createSession();
1125 bool checkConnect();
1127 DOMString readStanza();
1129 bool saslMd5Authenticate();
1131 bool saslPlainAuthenticate();
1133 bool saslAuthenticate(const DOMString &streamId);
1135 bool iqAuthenticate(const DOMString &streamId);
1137 /**
1138 * Register a new account with a server. Not done by user
1139 */
1140 bool inBandRegistrationNew();
1142 bool keepGoing;
1144 bool doRegister;
1146 std::vector<XmppGroupChat *>groupChats;
1148 //#### Roster
1149 std::vector<XmppUser>roster;
1152 //#### Streams
1154 bool processInBandByteStreamMessage(Element *root);
1156 DOMString streamPacket;
1158 std::map<DOMString, XmppStream *> outputStreams;
1160 std::map<DOMString, XmppStream *> inputStreams;
1163 //#### File send
1165 bool processFileMessage(Element *root);
1167 std::map<DOMString, XmppStream *> fileSends;
1169 };
1174 //########################################################################
1175 //# X M P P G R O U P C H A T
1176 //########################################################################
1178 /**
1179 *
1180 */
1181 class XmppGroupChat
1182 {
1183 public:
1185 /**
1186 *
1187 */
1188 XmppGroupChat(const DOMString &groupJid);
1190 /**
1191 *
1192 */
1193 XmppGroupChat(const XmppGroupChat &other);
1195 /**
1196 *
1197 */
1198 virtual ~XmppGroupChat();
1200 /**
1201 *
1202 */
1203 virtual DOMString getGroupJid();
1205 /**
1206 *
1207 */
1208 virtual void userAdd(const DOMString &nick,
1209 const DOMString &jid);
1210 /**
1211 *
1212 */
1213 virtual void userShow(const DOMString &nick,
1214 const DOMString &show);
1216 /**
1217 *
1218 */
1219 virtual void userDelete(const DOMString &nick);
1221 /**
1222 *
1223 */
1224 virtual std::vector<XmppUser> getUserList() const;
1227 private:
1229 DOMString groupJid;
1231 std::vector<XmppUser>userList;
1233 };
1244 } //namespace Pedro
1246 #endif /* __XMPP_H__ */
1248 //########################################################################
1249 //# E N D O F F I L E
1250 //########################################################################