0e07013e6f47f810f8e7f68777edb21eff6b7c76
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 begun speaking to the server in SSL. This is usually
137 * emitted just before EVENT_CONNECTED, since authorization has not
138 * yet taken place.
139 */
140 static const int EVENT_SSL_STARTED = 12;
142 /**
143 * Client has successfully registered a new account on a server.
144 * The server is in getFrom(), the user in getTo()
145 */
146 static const int EVENT_REGISTRATION_NEW = 20;
148 /**
149 * Client has successfully changed the password of an existing account on a server.
150 * The server is in getFrom(), the user in getTo()
151 */
152 static const int EVENT_REGISTRATION_CHANGE_PASS = 21;
154 /**
155 * Client has successfully cancelled an existing account on a server.
156 * The server is in getFrom(), the user in getTo()
157 */
158 static const int EVENT_REGISTRATION_CANCEL = 22;
160 /**
161 * A <presence> packet has been received.
162 * getFrom() returns the full jabber id
163 * getPresence() returns the available/unavailable boolean
164 * getShow() returns the jabber 'show' string: 'show', 'away', 'xa', etc
165 * getStatus() returns a status message, sent from a client
166 * Note: if a presence packet is determined to be MUC, it is
167 * rather sent as an EVENT_MUC_JOIN, LEAVE, or PRESENCE
168 */
169 static const int EVENT_PRESENCE = 30;
171 /**
172 * Client has just received a complete roster. The collected information
173 * can be found at client.getRoster(), and is a std::vector of XmppUser
174 * records.
175 */
176 static const int EVENT_ROSTER = 31;
178 /**
179 * Client has just received a message packet.
180 * getFrom() returns the full jabber id of the sender
181 * getData() returns the text of the message
182 * getDom() returns the DOM treelet for this stanza. This is provided
183 * to make message extension easier.
184 * Note: if a message packet is determined to be MUC, it is
185 * rather sent as an EVENT_MUC_MESSAGE
186 */
187 static const int EVENT_MESSAGE = 32;
189 /**
190 * THIS user has just joined a multi-user chat group.
191 * getGroup() returns the group name
192 * getFrom() returns the nick of the user in the group
193 * getPresence() returns the available/unavailable boolean
194 * getShow() returns the jabber 'show' string: 'show', 'away', 'xa', etc
195 * getStatus() returns a status message, sent from a client
196 */
197 static const int EVENT_MUC_JOIN = 40;
199 /**
200 * THIS user has just left a multi-user chat group.
201 * getGroup() returns the group name
202 * getFrom() returns the nick of the user in the group
203 * getPresence() returns the available/unavailable boolean
204 * getShow() returns the jabber 'show' string: 'show', 'away', 'xa', etc
205 * getStatus() returns a status message, sent from a client
206 */
207 static const int EVENT_MUC_LEAVE = 41;
209 /**
210 * Presence for another user in a multi-user chat room.
211 * getGroup() returns the group name
212 * getFrom() returns the nick of the user in the group
213 * getPresence() returns the available/unavailable boolean
214 * getShow() returns the jabber 'show' string: 'show', 'away', 'xa', etc
215 * getStatus() returns a status message, sent from a client
216 */
217 static const int EVENT_MUC_PRESENCE = 42;
219 /**
220 * Client has just received a message packet from a multi-user chat room
221 * getGroup() returns the group name
222 * getFrom() returns the full jabber id of the sender
223 * getData() returns the text of the message
224 * getDom() returns the DOM treelet for this stanza. This is provided
225 * to make message extension easier.
226 */
227 static const int EVENT_MUC_MESSAGE = 43;
229 /**
230 * Client has begun receiving a stream
231 */
232 static const int EVENT_STREAM_RECEIVE_INIT = 50;
234 /**
235 * Client receives another stream packet.
236 */
237 static const int EVENT_STREAM_RECEIVE = 51;
239 /**
240 * Client has received the end of a stream
241 */
242 static const int EVENT_STREAM_RECEIVE_CLOSE = 52;
244 /**
245 * Other client has accepted a file.
246 */
247 static const int EVENT_FILE_ACCEPTED = 60;
249 /**
250 * This client has just received a file.
251 */
252 static const int EVENT_FILE_RECEIVE = 61;
254 /**
255 * Constructs an event with one of the types above.
256 */
257 XmppEvent(int type);
259 /**
260 * Copy constructor
261 */
262 XmppEvent(const XmppEvent &other);
264 /**
265 * Assignment
266 */
267 virtual XmppEvent &operator=(const XmppEvent &other);
269 /**
270 * Destructor
271 */
272 virtual ~XmppEvent();
274 /**
275 * Assignment
276 */
277 virtual void assign(const XmppEvent &other);
279 /**
280 * Return the event type.
281 */
282 virtual int getType() const;
285 /**
286 *
287 */
288 virtual DOMString getIqId() const;
291 /**
292 *
293 */
294 virtual void setIqId(const DOMString &val);
296 /**
297 *
298 */
299 virtual DOMString getStreamId() const;
302 /**
303 *
304 */
305 virtual void setStreamId(const DOMString &val);
307 /**
308 *
309 */
310 virtual bool getPresence() const;
313 /**
314 *
315 */
316 virtual void setPresence(bool val);
318 /**
319 *
320 */
321 virtual DOMString getShow() const;
324 /**
325 *
326 */
327 virtual void setShow(const DOMString &val);
329 /**
330 *
331 */
332 virtual DOMString getStatus() const;
334 /**
335 *
336 */
337 virtual void setStatus(const DOMString &val);
339 /**
340 *
341 */
342 virtual DOMString getTo() const;
344 /**
345 *
346 */
347 virtual void setTo(const DOMString &val);
349 /**
350 *
351 */
352 virtual DOMString getFrom() const;
354 /**
355 *
356 */
357 virtual void setFrom(const DOMString &val);
359 /**
360 *
361 */
362 virtual DOMString getGroup() const;
364 /**
365 *
366 */
367 virtual void setGroup(const DOMString &val);
369 /**
370 *
371 */
372 virtual Element *getDOM() const;
375 /**
376 *
377 */
378 virtual void setDOM(const Element *val);
380 /**
381 *
382 */
383 virtual std::vector<XmppUser> getUserList() const;
385 /**
386 *
387 */
388 virtual void setUserList(const std::vector<XmppUser> &userList);
390 /**
391 *
392 */
393 virtual DOMString getFileName() const;
396 /**
397 *
398 */
399 virtual void setFileName(const DOMString &val);
402 /**
403 *
404 */
405 virtual DOMString getFileDesc() const;
408 /**
409 *
410 */
411 virtual void setFileDesc(const DOMString &val);
414 /**
415 *
416 */
417 virtual long getFileSize() const;
420 /**
421 *
422 */
423 virtual void setFileSize(long val);
425 /**
426 *
427 */
428 virtual DOMString getFileHash() const;
430 /**
431 *
432 */
433 virtual void setFileHash(const DOMString &val);
435 /**
436 *
437 */
438 virtual DOMString getData() const;
441 /**
442 *
443 */
444 virtual void setData(const DOMString &val);
446 private:
448 int eventType;
450 DOMString iqId;
452 DOMString streamId;
454 bool presence;
456 DOMString show;
458 DOMString status;
460 DOMString to;
462 DOMString from;
464 DOMString group;
466 DOMString data;
468 DOMString fileName;
469 DOMString fileDesc;
470 long fileSize;
471 DOMString fileHash;
473 Element *dom;
475 std::vector<XmppUser>userList;
477 };
484 //########################################################################
485 //# X M P P E V E N T L I S T E N E R
486 //########################################################################
488 /**
489 * Class that receives and processes an XmppEvent. Users should inherit
490 * from this class, and overload processXmppEvent() to perform their event
491 * handling
492 */
493 class XmppEventListener
494 {
495 public:
497 /**
498 * Constructor
499 */
500 XmppEventListener()
501 {}
503 /**
504 * Assignment
505 */
506 XmppEventListener(const XmppEventListener &other)
507 {}
510 /**
511 * Destructor
512 */
513 virtual ~XmppEventListener()
514 {}
516 /**
517 * Overload this method to provide your application-specific
518 * event handling. Use event.getType() to decide what to do
519 * with the event.
520 */
521 virtual void processXmppEvent(const XmppEvent &event)
522 {}
524 };
528 //########################################################################
529 //# X M P P E V E N T T A R G E T
530 //########################################################################
532 /**
533 * A base class for classes that emit XmppEvents.
534 *
535 * Note: terminology: 'target' is the common term for this, although it
536 * seems odd that a 'target' is the source of the events. It is clearer
537 * if you consider that the greater system targets this class with events,
538 * and this class delegates the handling to its listeners.
539 */
540 class XmppEventTarget
541 {
542 public:
544 /**
545 * Constructor
546 */
547 XmppEventTarget();
549 /**
550 * Copy constructor
551 */
552 XmppEventTarget(const XmppEventTarget &other);
554 /**
555 * Destructor
556 */
557 virtual ~XmppEventTarget();
560 //###########################
561 //# M E S S A G E S
562 //###########################
565 /**
566 * Send an error message to all subscribers
567 */
568 void error(char *fmt, ...);
571 /**
572 * Send a status message to all subscribers
573 */
574 void status(char *fmt, ...);
576 //###########################
577 //# LISTENERS
578 //###########################
580 /**
581 * Subscribe a subclass of XmppEventListener to this target's events.
582 */
583 virtual void addXmppEventListener(const XmppEventListener &listener);
585 /**
586 * Unsubscribe a subclass of XmppEventListener from this target's events.
587 */
588 virtual void removeXmppEventListener(const XmppEventListener &listener);
590 /**
591 * Remove all event subscribers
592 */
593 virtual void clearXmppEventListeners();
595 /**
596 * This sends an event to all registered listeners.
597 */
598 virtual void dispatchXmppEvent(const XmppEvent &event);
600 /**
601 * By enabling this, you provide an alternate way to get XmppEvents.
602 * Any event sent to dispatchXmppEvent() is also sent to this queue,
603 * so that it can be later be picked up by eventQueuePop();
604 * This can sometimes be good for GUI's which can't always respond
605 * repidly or asynchronously.
606 */
607 void eventQueueEnable(bool val);
609 /**
610 * Return true if there is one or more XmppEvents waiting in the event
611 * queue. This is used to avoid calling eventQueuePop() when there is
612 * nothing in the queue.
613 */
614 int eventQueueAvailable();
616 /**
617 * Return the next XmppEvent in the queue. Users should check that
618 * eventQueueAvailable() is greater than 0 before calling this. If
619 * people forget to do this, an event of type XmppEvent::EVENT_NONE
620 * is generated and returned.
621 */
622 XmppEvent eventQueuePop();
625 private:
627 std::vector<XmppEventListener *> listeners;
629 std::vector<XmppEvent> eventQueue;
630 bool eventQueueEnabled;
632 static const int targetWriteBufLen = 2048;
634 char targetWriteBuf[targetWriteBufLen];
635 };
641 //########################################################################
642 //# X M P P C L I E N T
643 //########################################################################
645 //forward declarations
646 class TcpSocket;
647 class XmppChat;
648 class XmppGroupChat;
649 class XmppStream;
652 /**
653 * This is the actual XMPP (Jabber) client.
654 */
655 class XmppClient : public XmppEventTarget
656 {
658 public:
660 //###########################
661 //# CONSTRUCTORS
662 //###########################
664 /**
665 * Constructor
666 */
667 XmppClient();
669 /**
670 * Copy constructor
671 */
672 XmppClient(const XmppClient &other);
674 /**
675 * Assignment
676 */
677 void assign(const XmppClient &other);
679 /**
680 * Destructor
681 */
682 virtual ~XmppClient();
685 //###########################
686 //# UTILITY
687 //###########################
689 /**
690 * Pause execution of the app for a given number of
691 * milliseconds. Use this rarely, only when really needed.
692 */
693 virtual bool pause(unsigned long millis);
695 /**
696 * Process a string so that it can safely be
697 * placed in XML as PCDATA
698 */
699 DOMString toXml(const DOMString &str);
701 //###########################
702 //# CONNECTION
703 //###########################
705 /**
706 *
707 */
708 virtual bool connect();
710 /**
711 *
712 */
713 virtual bool connect(DOMString host, int port,
714 DOMString userName,
715 DOMString password,
716 DOMString resource);
718 /**
719 *
720 */
721 virtual bool disconnect();
724 /**
725 *
726 */
727 virtual bool write(char *fmt, ...);
729 //#######################
730 //# V A R I A B L E S
731 //#######################
733 /**
734 *
735 */
736 virtual bool isConnected()
737 { return connected; }
739 /**
740 *
741 */
742 virtual DOMString getHost()
743 { return host; }
745 /**
746 *
747 */
748 virtual void setHost(const DOMString &val)
749 { host = val; }
751 /**
752 *
753 */
754 virtual DOMString getRealm()
755 { return realm; }
757 /**
758 *
759 */
760 virtual void setRealm(const DOMString &val)
761 { realm = val; }
763 /**
764 *
765 */
766 virtual int getPort()
767 { return port; }
769 /**
770 *
771 */
772 virtual void setPort(int val)
773 { port = val; }
775 /**
776 *
777 */
778 virtual DOMString getUsername();
780 /**
781 *
782 */
783 virtual void setUsername(const DOMString &val);
785 /**
786 *
787 */
788 virtual DOMString getPassword()
789 { return password; }
791 /**
792 *
793 */
794 virtual void setPassword(const DOMString &val)
795 { password = val; }
797 /**
798 *
799 */
800 virtual DOMString getResource()
801 { return resource; }
803 /**
804 *
805 */
806 virtual void setResource(const DOMString &val)
807 { resource = val; }
809 /**
810 *
811 */
812 virtual DOMString getJid()
813 { return jid; }
815 /**
816 *
817 */
818 virtual int getMsgId()
819 { return msgId++; }
823 //#######################
824 //# P R O C E S S I N G
825 //#######################
828 /**
829 *
830 */
831 bool processMessage(Element *root);
833 /**
834 *
835 */
836 bool processPresence(Element *root);
838 /**
839 *
840 */
841 bool processIq(Element *root);
843 /**
844 *
845 */
846 virtual bool receiveAndProcess();
848 /**
849 *
850 */
851 virtual bool receiveAndProcessLoop();
853 //#######################
854 //# ROSTER
855 //#######################
857 /**
858 *
859 */
860 bool rosterAdd(const DOMString &rosterGroup,
861 const DOMString &otherJid,
862 const DOMString &name);
864 /**
865 *
866 */
867 bool rosterDelete(const DOMString &otherJid);
869 /**
870 *
871 */
872 std::vector<XmppUser> getRoster();
874 /**
875 *
876 */
877 virtual void rosterShow(const DOMString &jid, const DOMString &show);
879 //#######################
880 //# REGISTRATION
881 //#######################
883 /**
884 * Set whether the client should to in-band registration
885 * before authentication. Causes inBandRegistrationNew() to be called
886 * synchronously, before async is started.
887 */
888 virtual void setDoRegister(bool val)
889 { doRegister = val; }
891 /**
892 * Change the password of an existing account with a server
893 */
894 bool inBandRegistrationChangePassword(const DOMString &newPassword);
896 /**
897 * Cancel an existing account with a server
898 */
899 bool inBandRegistrationCancel();
902 //#######################
903 //# CHAT (individual)
904 //#######################
906 /**
907 *
908 */
909 virtual bool message(const DOMString &user, const DOMString &subj,
910 const DOMString &text);
912 /**
913 *
914 */
915 virtual bool message(const DOMString &user, const DOMString &text);
917 /**
918 *
919 */
920 virtual bool presence(const DOMString &presence);
922 //#######################
923 //# GROUP CHAT
924 //#######################
926 /**
927 *
928 */
929 virtual bool groupChatCreate(const DOMString &groupJid);
931 /**
932 *
933 */
934 virtual void groupChatDelete(const DOMString &groupJid);
936 /**
937 *
938 */
939 bool groupChatExists(const DOMString &groupJid);
941 /**
942 *
943 */
944 virtual void groupChatsClear();
946 /**
947 *
948 */
949 virtual void groupChatUserAdd(const DOMString &groupJid,
950 const DOMString &nick,
951 const DOMString &jid);
952 /**
953 *
954 */
955 virtual void groupChatUserShow(const DOMString &groupJid,
956 const DOMString &nick,
957 const DOMString &show);
959 /**
960 *
961 */
962 virtual void groupChatUserDelete(const DOMString &groupJid,
963 const DOMString &nick);
965 /**
966 *
967 */
968 virtual std::vector<XmppUser>
969 groupChatGetUserList(const DOMString &groupJid);
971 /**
972 *
973 */
974 virtual bool groupChatJoin(const DOMString &groupJid,
975 const DOMString &nick,
976 const DOMString &pass);
978 /**
979 *
980 */
981 virtual bool groupChatLeave(const DOMString &groupJid,
982 const DOMString &nick);
984 /**
985 *
986 */
987 virtual bool groupChatMessage(const DOMString &groupJid,
988 const DOMString &msg);
990 /**
991 *
992 */
993 virtual bool groupChatPrivateMessage(const DOMString &groupJid,
994 const DOMString &toNick,
995 const DOMString &msg);
997 /**
998 *
999 */
1000 virtual bool groupChatPresence(const DOMString &groupJid,
1001 const DOMString &nick,
1002 const DOMString &presence);
1005 //#######################
1006 //# STREAMS
1007 //#######################
1009 typedef enum
1010 {
1011 STREAM_AVAILABLE,
1012 STREAM_OPENING,
1013 STREAM_OPEN,
1014 STREAM_CLOSING,
1015 STREAM_CLOSED,
1016 STREAM_ERROR
1017 } StreamStates;
1019 /**
1020 *
1021 */
1022 virtual int outputStreamOpen(const DOMString &jid,
1023 const DOMString &streamId);
1025 /**
1026 *
1027 */
1028 virtual int outputStreamWrite(int streamId,
1029 const unsigned char *buf, unsigned long len);
1031 /**
1032 *
1033 */
1034 virtual int outputStreamClose(int streamId);
1036 /**
1037 *
1038 */
1039 virtual int inputStreamOpen(const DOMString &jid,
1040 const DOMString &streamId,
1041 const DOMString &iqId);
1043 /**
1044 *
1045 */
1046 virtual int inputStreamAvailable(int streamId);
1048 /**
1049 *
1050 */
1051 virtual std::vector<unsigned char> inputStreamRead(int streamId);
1053 /**
1054 *
1055 */
1056 virtual bool inputStreamClosing(int streamId);
1058 /**
1059 *
1060 */
1061 virtual int inputStreamClose(int streamId);
1064 //#######################
1065 //# FILE TRANSFERS
1066 //#######################
1068 /**
1069 *
1070 */
1071 virtual bool fileSend(const DOMString &destJid,
1072 const DOMString &offeredName,
1073 const DOMString &fileName,
1074 const DOMString &description);
1076 /**
1077 *
1078 */
1079 virtual bool fileSendBackground(const DOMString &destJid,
1080 const DOMString &offeredName,
1081 const DOMString &fileName,
1082 const DOMString &description);
1084 /**
1085 *
1086 */
1087 virtual bool fileReceive(const DOMString &fromJid,
1088 const DOMString &iqId,
1089 const DOMString &streamId,
1090 const DOMString &fileName,
1091 long fileSize,
1092 const DOMString &fileHash);
1093 /**
1094 *
1095 */
1096 virtual bool fileReceiveBackground(const DOMString &fromJid,
1097 const DOMString &iqId,
1098 const DOMString &streamId,
1099 const DOMString &fileName,
1100 long fileSize,
1101 const DOMString &fileHash);
1104 private:
1106 void init();
1108 DOMString host;
1110 /**
1111 * will be same as host, unless username is
1112 * user@realm
1113 */
1114 DOMString realm;
1116 int port;
1118 DOMString username;
1120 DOMString password;
1122 DOMString resource;
1124 DOMString jid;
1126 int msgId;
1128 TcpSocket *sock;
1130 bool connected;
1132 bool createSession();
1134 bool checkConnect();
1136 DOMString readStanza();
1138 bool saslMd5Authenticate();
1140 bool saslPlainAuthenticate();
1142 bool saslAuthenticate();
1144 bool iqAuthenticate(const DOMString &streamId);
1146 /**
1147 * Register a new account with a server. Not done by user
1148 */
1149 bool inBandRegistrationNew();
1151 bool keepGoing;
1153 bool doRegister;
1155 static const int writeBufLen = 2048;
1157 unsigned char writeBuf[writeBufLen];
1159 std::vector<XmppGroupChat *>groupChats;
1161 static const int outputStreamCount = 16;
1163 XmppStream *outputStreams[outputStreamCount];
1165 static const int inputStreamCount = 16;
1167 XmppStream *inputStreams[inputStreamCount];
1169 static const int fileSendCount = 16;
1171 XmppStream *fileSends[fileSendCount];
1173 std::vector<XmppUser>roster;
1174 };
1179 //########################################################################
1180 //# X M P P G R O U P C H A T
1181 //########################################################################
1183 /**
1184 *
1185 */
1186 class XmppGroupChat
1187 {
1188 public:
1190 /**
1191 *
1192 */
1193 XmppGroupChat(const DOMString &groupJid);
1195 /**
1196 *
1197 */
1198 XmppGroupChat(const XmppGroupChat &other);
1200 /**
1201 *
1202 */
1203 virtual ~XmppGroupChat();
1205 /**
1206 *
1207 */
1208 virtual DOMString getGroupJid();
1210 /**
1211 *
1212 */
1213 virtual void userAdd(const DOMString &nick,
1214 const DOMString &jid);
1215 /**
1216 *
1217 */
1218 virtual void userShow(const DOMString &nick,
1219 const DOMString &show);
1221 /**
1222 *
1223 */
1224 virtual void userDelete(const DOMString &nick);
1226 /**
1227 *
1228 */
1229 virtual std::vector<XmppUser> getUserList() const;
1232 private:
1234 DOMString groupJid;
1236 std::vector<XmppUser>userList;
1238 };
1249 } //namespace Pedro
1251 #endif /* __XMPP_H__ */
1253 //########################################################################
1254 //# E N D O F F I L E
1255 //########################################################################