more cleaning

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/ammorais_branch@1347 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
ammorais 2009-07-09 23:46:23 +00:00
parent bc49f5b754
commit 804f14acab
14 changed files with 2605 additions and 233 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,20 +1,7 @@
#ifndef NOTIFYBASE_H
#define NOTIFYBASE_H
const int NOTIFY_LIST_NEIGHBOURS = 1;
const int NOTIFY_LIST_FRIENDS = 2;
const int NOTIFY_LIST_DIRLIST = 3;
const int NOTIFY_LIST_SEARCHLIST = 4;
const int NOTIFY_LIST_MESSAGELIST = 5;
const int NOTIFY_LIST_CHANNELLIST = 6;
const int NOTIFY_LIST_TRANSFERLIST = 7;
const int NOTIFY_LIST_CONFIG = 8;
const int NOTIFY_TYPE_SAME = 0x01;
const int NOTIFY_TYPE_MOD = 0x02; /* general purpose, check all */
const int NOTIFY_TYPE_ADD = 0x04; /* flagged additions */
const int NOTIFY_TYPE_DEL = 0x08; /* flagged deletions */
#include "rsdefs.h"
class NotifyBase
{

View file

@ -0,0 +1,81 @@
#ifndef RSEFS_H
#define RSEFS_H
/*
* From rsnotify.h
*/
const uint32_t RS_SYS_ERROR = 0x0001;
const uint32_t RS_SYS_WARNING = 0x0002;
const uint32_t RS_SYS_INFO = 0x0004;
const uint32_t RS_POPUP_MSG = 0x0001;
const uint32_t RS_POPUP_CHAT = 0x0002;
const uint32_t RS_POPUP_CALL = 0x0004;
const uint32_t RS_POPUP_CONNECT = 0x0008;
/* CHAT flags are here - so they are in the same place as
* other Notify flags... not used by libretroshare though
*/
const uint32_t RS_CHAT_OPEN_NEW = 0x0001;
const uint32_t RS_CHAT_REOPEN = 0x0002;
const uint32_t RS_CHAT_FOCUS = 0x0004;
const uint32_t RS_FEED_TYPE_PEER = 0x0010;
const uint32_t RS_FEED_TYPE_CHAN = 0x0020;
const uint32_t RS_FEED_TYPE_FORUM = 0x0040;
const uint32_t RS_FEED_TYPE_BLOG = 0x0080;
const uint32_t RS_FEED_TYPE_CHAT = 0x0100;
const uint32_t RS_FEED_TYPE_MSG = 0x0200;
const uint32_t RS_FEED_TYPE_FILES = 0x0400;
const uint32_t RS_FEED_ITEM_PEER_CONNECT = RS_FEED_TYPE_PEER | 0x0001;
const uint32_t RS_FEED_ITEM_PEER_DISCONNECT = RS_FEED_TYPE_PEER | 0x0002;
const uint32_t RS_FEED_ITEM_PEER_NEW = RS_FEED_TYPE_PEER | 0x0003;
const uint32_t RS_FEED_ITEM_PEER_HELLO = RS_FEED_TYPE_PEER | 0x0004;
const uint32_t RS_FEED_ITEM_CHAN_NEW = RS_FEED_TYPE_CHAN | 0x0001;
const uint32_t RS_FEED_ITEM_CHAN_UPDATE = RS_FEED_TYPE_CHAN | 0x0002;
const uint32_t RS_FEED_ITEM_CHAN_MSG = RS_FEED_TYPE_CHAN | 0x0003;
const uint32_t RS_FEED_ITEM_FORUM_NEW = RS_FEED_TYPE_FORUM | 0x0001;
const uint32_t RS_FEED_ITEM_FORUM_UPDATE = RS_FEED_TYPE_FORUM | 0x0002;
const uint32_t RS_FEED_ITEM_FORUM_MSG = RS_FEED_TYPE_FORUM | 0x0003;
const uint32_t RS_FEED_ITEM_BLOG_MSG = RS_FEED_TYPE_BLOG | 0x0001;
const uint32_t RS_FEED_ITEM_CHAT_NEW = RS_FEED_TYPE_CHAT | 0x0001;
const uint32_t RS_FEED_ITEM_MESSAGE = RS_FEED_TYPE_MSG | 0x0001;
const uint32_t RS_FEED_ITEM_FILES_NEW = RS_FEED_TYPE_FILES | 0x0001;
/*
* From rsnotifybase.h
*/
const int NOTIFY_LIST_NEIGHBOURS = 1;
const int NOTIFY_LIST_FRIENDS = 2;
const int NOTIFY_LIST_DIRLIST = 3;
const int NOTIFY_LIST_SEARCHLIST = 4;
const int NOTIFY_LIST_MESSAGELIST = 5;
const int NOTIFY_LIST_CHANNELLIST = 6;
const int NOTIFY_LIST_TRANSFERLIST = 7;
const int NOTIFY_LIST_CONFIG = 8;
const int NOTIFY_TYPE_SAME = 0x01;
const int NOTIFY_TYPE_MOD = 0x02; /* general purpose, check all */
const int NOTIFY_TYPE_ADD = 0x04; /* flagged additions */
const int NOTIFY_TYPE_DEL = 0x08; /* flagged deletions */
#endif // RSEFS_H

View file

@ -0,0 +1,50 @@
#ifndef RSDISC_H
#define RSDISC_H
/*
* libretroshare/src/rsiface: rsdisc.h
*
* RetroShare C++ Interface.
*
* Copyright 2008-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 <inttypes.h>
#include <string>
#include <list>
#include <map>
/* The Main Interface Class - for information about your Peers */
class RsDisc;
extern RsDisc *rsDisc;
class RsDisc
{
public:
RsDisc() { return; }
virtual ~RsDisc() { return; }
virtual bool getDiscFriends(std::string id, std::list<std::string> &friends) = 0;
virtual bool getDiscVersions(std::map<std::string, std::string> &versions) = 0;
};
#endif /* RSDISC_H */

View file

@ -0,0 +1,46 @@
#ifndef RSDISTRIB_H
#define RSDISTRIB_H
/*
* libretroshare/src/rsiface: rsdistrib.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".
*
*/
#define RS_DISTRIB_PRIVACY_MASK 0x000f /* who can publish & view */
#define RS_DISTRIB_AUTHEN_MASK 0x00f0 /* how to publish */
#define RS_DISTRIB_LISTEN_MASK 0x0f00 /* distribution flags */
#define RS_DISTRIB_PUBLIC 0x0001 /* anyone can publish */
#define RS_DISTRIB_PRIVATE 0x0002 /* anyone with key can publish */
#define RS_DISTRIB_ENCRYPTED 0x0004 /* need publish key to view */
#define RS_DISTRIB_AUTHEN_REQ 0x0010 /* you must sign messages */
#define RS_DISTRIB_AUTHEN_ANON 0x0020 /* you can send anonymous messages */
#define RS_DISTRIB_ADMIN 0x0100
#define RS_DISTRIB_PUBLISH 0x0200
#define RS_DISTRIB_SUBSCRIBED 0x0400
#endif /* RSDISTRIB_H */

View file

@ -0,0 +1,15 @@
#include "rsfeeditem.h"
RsFeedItem::RsFeedItem() : mType(0)
{
}
RsFeedItem::RsFeedItem(uint32_t type, std::string id1, std::string id2, std::string id3):
mType(type),
mId1(id1),
mId2(id2),
mId3(id3)
{
}

View file

@ -0,0 +1,14 @@
#ifndef RSFEEDITEM_H
#define RSFEEDITEM_H
class RsFeedItem
{
public:
RsFeedItem();
RsFeedItem(uint32_t type, std::string id1, std::string id2, std::string id3);
uint32_t mType;
std::string mId1, mId2, mId3;
};
#endif // RSFEEDITEM_H

View file

@ -32,63 +32,15 @@
#include <string>
#include "rstypes.h"
#include "rsdefs.h"
class Expression;
/* These are used mainly by ftController at the moment */
const uint32_t RS_FILE_CTRL_PAUSE = 0x00000100;
const uint32_t RS_FILE_CTRL_START = 0x00000200;
const uint32_t RS_FILE_RATE_TRICKLE = 0x00000001;
const uint32_t RS_FILE_RATE_SLOW = 0x00000002;
const uint32_t RS_FILE_RATE_STANDARD = 0x00000003;
const uint32_t RS_FILE_RATE_FAST = 0x00000004;
const uint32_t RS_FILE_RATE_STREAM_AUDIO = 0x00000005;
const uint32_t RS_FILE_RATE_STREAM_VIDEO = 0x00000006;
const uint32_t RS_FILE_PEER_ONLINE = 0x00001000;
const uint32_t RS_FILE_PEER_OFFLINE = 0x00002000;
/************************************
* Used To indicate where to search.
*
* The Order of these is very important,
* it specifies the search order too.
*
*/
const uint32_t RS_FILE_HINTS_MASK = 0x00ffffff;
const uint32_t RS_FILE_HINTS_CACHE = 0x00000001;
const uint32_t RS_FILE_HINTS_EXTRA = 0x00000002;
const uint32_t RS_FILE_HINTS_LOCAL = 0x00000004;
const uint32_t RS_FILE_HINTS_REMOTE = 0x00000008;
const uint32_t RS_FILE_HINTS_DOWNLOAD= 0x00000010;
const uint32_t RS_FILE_HINTS_UPLOAD = 0x00000020;
const uint32_t RS_FILE_HINTS_TURTLE = 0x00000040;
const uint32_t RS_FILE_HINTS_SPEC_ONLY = 0x01000000;
const uint32_t RS_FILE_HINTS_NO_SEARCH = 0x02000000;
/* Callback Codes */
//const uint32_t RS_FILE_HINTS_CACHE = 0x00000001; // ALREADY EXISTS
const uint32_t RS_FILE_HINTS_MEDIA = 0x00001000;
const uint32_t RS_FILE_HINTS_BACKGROUND = 0x00002000; // To download slowly.
const uint32_t RS_FILE_EXTRA_DELETE = 0x0010;
const uint32_t CB_CODE_CACHE = 0x0001;
const uint32_t CB_CODE_EXTRA = 0x0002;
const uint32_t CB_CODE_MEDIA = 0x0004;
class RsFiles
{
public:
// RsFiles is pure virtual. It deon't need this:
// RsFiles is pure virtual. It doesn't need this:
// RsFiles() { return; }
// virtual ~RsFiles() { return; }
RsFiles();
@ -159,6 +111,6 @@ public:
// Extern
RsFiles *rsFiles;
extern RsFiles *rsFiles;
#endif

View file

@ -29,8 +29,8 @@
#include "rstypes.h"
class RsGameLauncher;
// CHANGE: CLASS_TO_STRUCT
struct RsGameLauncher;
/* declare single RsIface for everyone to use! */
@ -40,72 +40,69 @@ extern RsGameLauncher *rsGameLauncher;
#include <string>
#include <inttypes.h>
class RsGameInfo
// CHANGE: CLASS_TO_STRUCT
struct RsGameInfo
{
public:
std::string gameId;
std::string serverId;
std::string gameType;
std::wstring gameName;
std::string serverName;
std::string status;
uint16_t numPlayers;
std::string gameId;
std::string serverId;
std::string gameType;
std::wstring gameName;
std::string serverName;
std::string status;
uint16_t numPlayers;
};
class RsGamePeer
// CHANGE: CLASS_TO_STRUCT
struct RsGamePeer
{
public:
std::string id;
bool invite;
bool interested;
bool play;
std::string id;
bool invite;
bool interested;
bool play;
};
class RsGameDetail
// CHANGE:CLASS_TO_STRUCT
struct RsGameDetail
{
public:
std::string gameId;
std::string gameType;
std::wstring gameName;
std::string gameId;
std::string gameType;
std::wstring gameName;
bool areServer; /* are we the server? */
std::string serverId; /* if not, who is? */
std::string serverName;
bool areServer; /* are we the server? */
std::string serverId; /* if not, who is? */
std::string serverName;
std::string status;
uint16_t numPlayers;
std::map<std::string, RsGamePeer> gamers;
std::string status;
uint16_t numPlayers;
std::map<std::string, RsGamePeer> gamers;
};
class RsGameLauncher
{
public:
public:
/* server commands */
virtual std::string createGame(uint32_t gameType, std::wstring name) = 0;
virtual bool deleteGame(std::string gameId) = 0;
virtual bool inviteGame(std::string gameId) = 0;
virtual bool playGame(std::string gameId) = 0;
//virtual bool quitGame(std::string gameId) = 0;
/* server commands */
virtual std::string createGame(uint32_t gameType, std::wstring name) = 0;
virtual bool deleteGame(std::string gameId) = 0;
virtual bool inviteGame(std::string gameId) = 0;
virtual bool playGame(std::string gameId) = 0;
//virtual bool quitGame(std::string gameId) = 0;
virtual bool invitePeer(std::string gameId, std::string peerId) = 0;
virtual bool uninvitePeer(std::string gameId, std::string peerId) = 0;
virtual bool confirmPeer(std::string gameId, std::string peerId,
virtual bool invitePeer(std::string gameId, std::string peerId) = 0;
virtual bool uninvitePeer(std::string gameId, std::string peerId) = 0;
virtual bool confirmPeer(std::string gameId, std::string peerId,
int16_t pos = -1) = 0;
virtual bool unconfirmPeer(std::string gameId, std::string peerId) = 0;
virtual bool unconfirmPeer(std::string gameId, std::string peerId) = 0;
/* client commands */
virtual bool interestedPeer(std::string gameId) = 0;
virtual bool uninterestedPeer(std::string gameId) = 0;
/* client commands */
virtual bool interestedPeer(std::string gameId) = 0;
virtual bool uninterestedPeer(std::string gameId) = 0;
/* get details */
virtual bool getGameList(std::list<RsGameInfo> &gameList) = 0;
virtual bool getGameDetail(std::string gameId, RsGameDetail &detail) = 0;
/* get details */
virtual bool getGameList(std::list<RsGameInfo> &gameList) = 0;
virtual bool getGameDetail(std::string gameId, RsGameDetail &detail) = 0;
};

View file

@ -9,7 +9,9 @@ SOURCES = $$PWP/rsinit.cc \
$$PWP/rstypes.cc \
$$PWP/rsexpr.cc \
$$PWP/rsforums.cc \
$$PWP/rschannels.cc
$$PWP/rschannels.cc \
rsmsgs.cc \
rsfeeditem.cc
HEADERS = $$PWP/rsinit.h \
$$PWP/rsiface.h \
$$PWP/rscontrol.h \
@ -21,4 +23,10 @@ HEADERS = $$PWP/rsinit.h \
$$PWP/rsgame.h \
$$PWP/rsforums.h \
$$PWP/rsqblog.h \
$$PWP/rschannels.h
$$PWP/rschannels.h \
$$PWP/rsdisc.h \
$$PWP/rsdistrib.h \
$$PWP/rsmsgs.h \
$$PWP/rsnotify.h \
rsfeeditem.h \
rsdefs.h

View file

@ -9,74 +9,73 @@
class RsInit
{
public:
/* Commandline/Directory options */
public:
/* Commandline/Directory options */
static const char *RsConfigDirectory() ;
static const char *RsConfigDirectory() ;
static bool setStartMinimised() ;
static int InitRetroShare(int argcIgnored, char **argvIgnored) ;
static int LoadCertificates(bool autoLoginNT) ;
static bool ValidateCertificate(std::string &userName) ;
static bool ValidateTrustedUser(std::string fname, std::string &userName) ;
static bool LoadPassword(std::string passwd) ;
static bool RsGenerateCertificate(std::string name, std::string org, std::string loc, std::string country, std::string passwd, std::string &errString);
static void load_check_basedir() ;
static int create_configinit() ;
static bool RsStoreAutoLogin() ;
static bool RsTryAutoLogin() ;
static bool RsClearAutoLogin(std::string basedir) ;
static void InitRsConfig() ;
static bool setStartMinimised() ;
static int InitRetroShare(int argcIgnored, char **argvIgnored) ;
static int LoadCertificates(bool autoLoginNT) ;
static bool ValidateCertificate(std::string &userName) ;
static bool ValidateTrustedUser(std::string fname, std::string &userName) ;
static bool LoadPassword(std::string passwd) ;
static bool RsGenerateCertificate(std::string name, std::string org, std::string loc, std::string country, std::string passwd, std::string &errString);
static void load_check_basedir() ;
static int create_configinit() ;
static bool RsStoreAutoLogin() ;
static bool RsTryAutoLogin() ;
static bool RsClearAutoLogin(std::string basedir) ;
static void InitRsConfig() ;
static std::string getHomePath() ;
static std::string getHomePath() ;
/* PGPSSL init functions */
/* PGPSSL init functions */
#ifdef RS_USE_PGPSSL
static bool LoadGPGPassword(std::string id, std::string passwd);
static int GetLogins(std::list<std::string> &pgpIds);
static int GetLoginDetails(std::string id, std::string &name, std::string &email);
static std::string gpgPasswd;
static bool LoadGPGPassword(std::string id, std::string passwd);
static int GetLogins(std::list<std::string> &pgpIds);
static int GetLoginDetails(std::string id, std::string &name, std::string &email);
static std::string gpgPasswd;
#endif
/* Key Parameters that must be set before
* RetroShare will start up:
*/
static std::string load_cert;
static std::string load_key;
static std::string passwd;
/* Key Parameters that must be set before
* RetroShare will start up:
*/
static std::string load_cert;
static std::string load_key;
static std::string passwd;
static bool havePasswd; /* for Commandline password */
static bool autoLogin; /* autoLogin allowed */
static bool startMinimised; /* Icon or Full Window */
static bool havePasswd; /* for Commandline password */
static bool autoLogin; /* autoLogin allowed */
static bool startMinimised; /* Icon or Full Window */
/* Win/Unix Differences */
static char dirSeperator;
/* Win/Unix Differences */
static char dirSeperator;
/* Directories */
static std::string basedir;
static std::string homePath;
/* Directories */
static std::string basedir;
static std::string homePath;
/* Listening Port */
static bool forceExtPort;
static bool forceLocalAddr;
static unsigned short port;
static char inet[256];
/* Listening Port */
static bool forceExtPort;
static bool forceLocalAddr;
static unsigned short port;
static char inet[256];
/* Logging */
static bool haveLogFile;
static bool outStderr;
static bool haveDebugLevel;
static int debugLevel;
static char logfname[1024];
/* Logging */
static bool haveLogFile;
static bool outStderr;
static bool haveDebugLevel;
static int debugLevel;
static char logfname[1024];
static bool firsttime_run;
static bool load_trustedpeer;
static std::string load_trustedpeer_file;
static bool firsttime_run;
static bool load_trustedpeer;
static std::string load_trustedpeer_file;
static bool udpListenerOnly;
static bool udpListenerOnly;
};
#endif

View file

@ -0,0 +1,2 @@
#include "rsmsgs.h"

View file

@ -0,0 +1,148 @@
#ifndef RSMSGS_H
#define RSMSGS_H
/*
* libretroshare/src/rsiface: rsmsgs.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 <list>
#include <iostream>
#include <string>
#include "rstypes.h"
/********************** For Messages and Channels *****************/
#define RS_MSG_BOXMASK 0x000f /* Mask for determining Box */
#define RS_MSG_OUTGOING 0x0001 /* !Inbox */
#define RS_MSG_PENDING 0x0002 /* OutBox */
#define RS_MSG_DRAFT 0x0004 /* Draft */
/* ORs of above */
#define RS_MSG_INBOX 0x00 /* Inbox */
#define RS_MSG_SENTBOX 0x01 /* Sentbox */
#define RS_MSG_OUTBOX 0x03 /* Outbox */
#define RS_MSG_DRAFTBOX 0x05 /* Draftbox */
#define RS_MSG_NEW 0x0010
//class MessageInfo
struct MessgageInfo
{
public:
MessageInfo() {}
std::string msgId;
std::string srcId;
unsigned int msgflags;
std::list<std::string> msgto;
std::list<std::string> msgcc;
std::list<std::string> msgbcc;
std::wstring title;
std::wstring msg;
std::wstring attach_title;
std::wstring attach_comment;
std::list<FileInfo> files;
int size; /* total of files */
int count; /* file count */
int ts;
};
class MsgInfoSummary
{
public:
MsgInfoSummary() {}
std::string msgId;
std::string srcId;
uint32_t msgflags;
std::wstring title;
int count; /* file count */
time_t ts;
};
#define RS_CHAT_PUBLIC 0x0001
#define RS_CHAT_PRIVATE 0x0002
#define RS_CHAT_AVATAR_AVAILABLE 0x0004
// CHANGE:STRUCT_FROM_CLASS
struct ChatInfo
{
public:
std::string rsid;
unsigned int chatflags;
std::string name;
std::wstring msg;
};
// CHANGE:EXCLUDE
//std::ostream &operator<<(std::ostream &out, const MessageInfo &info);
//std::ostream &operator<<(std::ostream &out, const ChatInfo &info);
class RsMsgs;
extern RsMsgs *rsMsgs;
class RsMsgs
{
public:
RsMsgs() { return; }
virtual ~RsMsgs() { return; }
/****************************************/
/* Message Items */
virtual bool getMessageSummaries(std::list<MsgInfoSummary> &msgList) = 0;
virtual bool getMessage(std::string mId, MessageInfo &msg) = 0;
virtual bool MessageSend(MessageInfo &info) = 0;
virtual bool MessageDelete(std::string mid) = 0;
virtual bool MessageRead(std::string mid)= 0;
/****************************************/
/* Chat */
virtual bool chatAvailable() = 0;
virtual bool ChatSend(ChatInfo &ci) = 0;
virtual bool getNewChat(std::list<ChatInfo> &chats) = 0;
virtual void sendStatusString(const std::string& id,const std::string& status_string) = 0 ;
// get avatar data for peer pid
virtual void getAvatarData(std::string pid,unsigned char *& data,int& size) = 0 ;
// set own avatar data
virtual void setOwnAvatarData(const unsigned char *data,int size) = 0 ;
virtual void getOwnAvatarData(unsigned char *& data,int& size) = 0 ;
/****************************************/
};
#endif /* RSMSGS_H */

View file

@ -0,0 +1,67 @@
#ifndef RSNOTIFY_H
#define RSNOTIFY_H
/*
* libretroshare/src/rsiface: rsnotify.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 <map>
#include <list>
#include <iostream>
#include <string>
#include <stdint.h>
#include "rsdefs.h"
class RsNotify;
extern RsNotify *rsNotify;
class RsNotify
{
public:
RsNotify() { return; }
virtual ~RsNotify() { return; }
/* Output for retroshare-gui */
virtual bool NotifySysMessage(uint32_t &sysid, uint32_t &type,
std::string &title, std::string &msg) = 0;
virtual bool NotifyPopupMessage(uint32_t &ptype, std::string &name, std::string &msg) = 0;
virtual bool NotifyLogMessage(uint32_t &sysid, uint32_t &type,
std::string &title, std::string &msg) = 0;
/* Control over Messages */
virtual bool GetSysMessageList(std::map<uint32_t, std::string> &list) = 0;
virtual bool GetPopupMessageList(std::map<uint32_t, std::string> &list) = 0;
virtual bool SetSysMessageMode(uint32_t sysid, uint32_t mode) = 0;
virtual bool SetPopupMessageMode(uint32_t ptype, uint32_t mode) = 0;
/* Feed Output */
virtual bool GetFeedItem(RsFeedItem &item) = 0;
};
#endif /* RSNOTIFY_H */