File indexing completed on 2024-04-21 04:04:40

0001  /*
0002 
0003     Copyright (c) 2006      by Olivier Goffart  <ogoffart at kde.org>
0004 
0005     Kopete    (c) 2006 by the Kopete developers <kopete-devel@kde.org>
0006 
0007 
0008     *************************************************************************
0009     *                                                                       *
0010     * This program is free software; you can redistribute it and/or modify  *
0011     * it under the terms of the GNU General Public License as published by  *
0012     * the Free Software Foundation; either either version 2
0013    of the License, or (at your option) any later version.of the License, or     *
0014     * (at your option) any later version.                                   *
0015     *                                                                       *
0016     *************************************************************************
0017  */
0018 
0019 #ifndef JABBERBOOKMARKS_H
0020 #define JABBERBOOKMARKS_H
0021 
0022 #include <QObject>
0023 #include <qdom.h>
0024 #include <QStringList>
0025 
0026 namespace XMPP { class Jid; }
0027 class JabberAccount;
0028 
0029 class QAction;
0030 
0031 /**
0032  * This is a class that hanlde the bookmark collection  (JEP-0048)
0033  * There is one instance of that class by accounts.
0034  * @author Olivier Goffart 
0035  */
0036 class JabberBookmarks : public QObject
0037 {
0038     Q_OBJECT
0039     public:
0040         /**
0041          * Constructor
0042          */
0043         JabberBookmarks(JabberAccount *parent);
0044         ~JabberBookmarks(){}
0045         
0046         /**
0047          * update or create en entry with the given jid.
0048          * the jid resource is the nickname
0049          */
0050         void insertGroupChat(const XMPP::Jid &jid);
0051         
0052         /**
0053          * return an action that will be added in the jabber popup menu
0054          */
0055         QAction *bookmarksAction(QObject * parent);
0056     private slots:
0057         void accountConnected();
0058         void slotReceivedBookmarks();
0059         void slotJoinChatBookmark(const QString&);
0060         
0061 
0062     private:
0063         JabberAccount *m_account;
0064         QDomDocument m_storage;
0065         QStringList m_conferencesJID;
0066 };
0067 
0068 #endif