File indexing completed on 2024-06-23 04:03:38
0001 /* 0002 * im.h - XMPP "IM" library API 0003 * Copyright (C) 2003 Justin Karneges 0004 * 0005 * This library is free software; you can redistribute it and/or 0006 * modify it under the terms of the GNU Lesser General Public 0007 * License as published by the Free Software Foundation; either 0008 * either version 2 0009 of the License, or (at your option) any later version.1 of the License, or (at your option) any later version. 0010 * 0011 * This library is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 * Lesser General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU Lesser General Public 0017 * License along with this library; if not, write to the Free Software 0018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 0019 * 0020 */ 0021 0022 #ifndef XMPP_IM_H 0023 #define XMPP_IM_H 0024 0025 #include <QDateTime> 0026 //Added by qt3to4: 0027 #include <QList> 0028 0029 #include "xmpp.h" 0030 #include "xmpp/jid/jid.h" 0031 #include "xmpp_muc.h" 0032 #include "xmpp_message.h" 0033 #include "xmpp_chatstate.h" 0034 #include "xmpp_status.h" 0035 #include "xmpp_htmlelement.h" 0036 #include "xmpp_features.h" 0037 #include "xmpp_httpauthrequest.h" 0038 #include "xmpp_url.h" 0039 #include "xmpp_task.h" 0040 #include "xmpp_resource.h" 0041 #include "xmpp_resourcelist.h" 0042 #include "xmpp_roster.h" 0043 #include "xmpp_rosteritem.h" 0044 #include "xmpp_liverosteritem.h" 0045 #include "xmpp_liveroster.h" 0046 #include "xmpp_rosterx.h" 0047 #include "xmpp_xdata.h" 0048 #include "xmpp_discoitem.h" 0049 #include "xmpp_agentitem.h" 0050 #include "xmpp_client.h" 0051 #include "xmpp_address.h" 0052 #include "xmpp_pubsubitem.h" 0053 #include "xmpp_pubsubretraction.h" 0054 0055 namespace XMPP 0056 { 0057 typedef QMap<QString, QString> StringMap; 0058 0059 typedef QList<AgentItem> AgentList; 0060 typedef QList<DiscoItem> DiscoList; 0061 0062 class FormField 0063 { 0064 public: 0065 enum { username, nick, password, name, first, last, email, address, city, state, zip, phone, url, date, misc }; 0066 FormField(const QString &type="", const QString &value=""); 0067 ~FormField(); 0068 0069 int type() const; 0070 QString fieldName() const; 0071 QString realName() const; 0072 bool isSecret() const; 0073 const QString & value() const; 0074 void setType(int); 0075 bool setType(const QString &); 0076 void setValue(const QString &); 0077 0078 private: 0079 int tagNameToType(const QString &) const; 0080 QString typeToTagName(int) const; 0081 0082 int v_type; 0083 QString v_value; 0084 0085 class Private; 0086 Private *d; 0087 }; 0088 0089 class Form : public QList<FormField> 0090 { 0091 public: 0092 Form(const Jid &j=""); 0093 ~Form(); 0094 0095 Jid jid() const; 0096 QString instructions() const; 0097 QString key() const; 0098 void setJid(const Jid &); 0099 void setInstructions(const QString &); 0100 void setKey(const QString &); 0101 0102 private: 0103 Jid v_jid; 0104 QString v_instructions, v_key; 0105 0106 class Private; 0107 Private *d; 0108 }; 0109 0110 class SearchResult 0111 { 0112 public: 0113 SearchResult(const Jid &jid=""); 0114 ~SearchResult(); 0115 0116 const Jid & jid() const; 0117 const QString & nick() const; 0118 const QString & first() const; 0119 const QString & last() const; 0120 const QString & email() const; 0121 0122 void setJid(const Jid &); 0123 void setNick(const QString &); 0124 void setFirst(const QString &); 0125 void setLast(const QString &); 0126 void setEmail(const QString &); 0127 0128 private: 0129 Jid v_jid; 0130 QString v_nick, v_first, v_last, v_email; 0131 }; 0132 } 0133 0134 #endif