2008-03-05 11:32:18 -05:00
|
|
|
#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"
|
2008-03-31 10:06:59 -04:00
|
|
|
#include "pqi/pqinotify.h"
|
2008-03-05 11:32:18 -05:00
|
|
|
|
|
|
|
#include "util/rsthreads.h"
|
|
|
|
|
|
|
|
class p3NotifySysMsg
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
uint32_t sysid;
|
|
|
|
uint32_t type;
|
|
|
|
std::string title;
|
|
|
|
std::string msg;
|
|
|
|
};
|
|
|
|
|
2009-05-05 09:35:36 -04:00
|
|
|
class p3NotifyLogMsg
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
uint32_t sysid;
|
|
|
|
uint32_t type;
|
|
|
|
std::string title;
|
|
|
|
std::string msg;
|
|
|
|
};
|
|
|
|
|
2008-03-05 11:32:18 -05:00
|
|
|
class p3NotifyPopupMsg
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
uint32_t type;
|
|
|
|
std::string name;
|
2010-06-13 06:12:56 -04:00
|
|
|
std::string title;
|
2008-03-05 11:32:18 -05:00
|
|
|
std::string msg;
|
|
|
|
};
|
|
|
|
|
2008-03-31 10:06:59 -04:00
|
|
|
|
|
|
|
class p3Notify: public RsNotify, public pqiNotify
|
2008-03-05 11:32:18 -05:00
|
|
|
{
|
|
|
|
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);
|
2010-06-13 06:12:56 -04:00
|
|
|
virtual bool NotifyPopupMessage(uint32_t &ptype, std::string &name, std::string &title, std::string &msg);
|
2009-05-05 09:35:36 -04:00
|
|
|
virtual bool NotifyLogMessage(uint32_t &sysid, uint32_t &type, std::string &title, std::string &msg);
|
2008-03-05 11:32:18 -05:00
|
|
|
|
|
|
|
/* 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);
|
|
|
|
|
2008-06-20 08:38:11 -04:00
|
|
|
virtual bool GetFeedItem(RsFeedItem &item);
|
2008-03-31 10:06:59 -04:00
|
|
|
|
|
|
|
/* Overloaded from pqiNotify */
|
2010-06-13 06:12:56 -04:00
|
|
|
virtual bool AddPopupMessage(uint32_t ptype, std::string name, std::string title, std::string msg);
|
2008-03-31 10:06:59 -04:00
|
|
|
virtual bool AddSysMessage(uint32_t sysid, uint32_t type, std::string title, std::string msg);
|
2009-05-05 09:35:36 -04:00
|
|
|
virtual bool AddLogMessage(uint32_t sysid, uint32_t type, std::string title, std::string msg);
|
2008-06-20 08:38:11 -04:00
|
|
|
virtual bool AddFeedItem(uint32_t type, std::string id1, std::string id2, std::string id3);
|
2010-05-23 12:35:42 -04:00
|
|
|
virtual bool ClearFeedItems(uint32_t type);
|
2008-03-05 11:32:18 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
RsMutex noteMtx;
|
|
|
|
|
|
|
|
std::list<p3NotifySysMsg> pendingSysMsgs;
|
2009-05-05 09:35:36 -04:00
|
|
|
std::list<p3NotifyLogMsg> pendingLogMsgs;
|
2008-03-05 11:32:18 -05:00
|
|
|
std::list<p3NotifyPopupMsg> pendingPopupMsgs;
|
2008-06-20 08:38:11 -04:00
|
|
|
std::list<RsFeedItem> pendingNewsFeed;
|
2008-03-05 11:32:18 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|