RetroShare/libretroshare/src/pqi/p3notify.h
drbob 9f024eaee7 Changes to support the new NewsFeed.
* added interface to rsnotify/p3notify/pqinotify
 * added getForumInfo() to forum interface.
 * added virtual functions to p3distrib for event feedback.

New NewsFeed Notification.
 * Peer Connection/Disconnection.
 * Failed Certificate connection.
 * New/Updated Forums and Forum Msgs.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@616 b45a01b8-16f6-495d-af2f-9b41ad6348cc
2008-06-20 12:38:11 +00:00

91 lines
2.3 KiB
C++

#ifndef RS_P3_NOTIFY_INTERFACE_H
#define RS_P3_NOTIFY_INTERFACE_H
/*
* libretroshare/src/rsserver: p3notify.h
*
* RetroShare C++ Interface.
*
* Copyright 2007-2008 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "rsiface/rsnotify.h"
#include "pqi/pqinotify.h"
#include "util/rsthreads.h"
class p3NotifySysMsg
{
public:
uint32_t sysid;
uint32_t type;
std::string title;
std::string msg;
};
class p3NotifyPopupMsg
{
public:
uint32_t type;
std::string name;
std::string msg;
};
class p3Notify: public RsNotify, public pqiNotify
{
public:
p3Notify() { return; }
virtual ~p3Notify() { return; }
/* Output for retroshare-gui */
virtual bool NotifySysMessage(uint32_t &sysid, uint32_t &type,
std::string &title, std::string &msg);
virtual bool NotifyPopupMessage(uint32_t &ptype, std::string &name, std::string &msg);
/* Control over Messages */
virtual bool GetSysMessageList(std::map<uint32_t, std::string> &list);
virtual bool GetPopupMessageList(std::map<uint32_t, std::string> &list);
virtual bool SetSysMessageMode(uint32_t sysid, uint32_t mode);
virtual bool SetPopupMessageMode(uint32_t ptype, uint32_t mode);
virtual bool GetFeedItem(RsFeedItem &item);
/* Overloaded from pqiNotify */
virtual bool AddPopupMessage(uint32_t ptype, std::string name, std::string msg);
virtual bool AddSysMessage(uint32_t sysid, uint32_t type, std::string title, std::string msg);
virtual bool AddFeedItem(uint32_t type, std::string id1, std::string id2, std::string id3);
private:
RsMutex noteMtx;
std::list<p3NotifySysMsg> pendingSysMsgs;
std::list<p3NotifyPopupMsg> pendingPopupMsgs;
std::list<RsFeedItem> pendingNewsFeed;
};
#endif