Significant changes to the GUI to introduce new display style.

* Completed much of General Msg Dialog.
 * Completed much of ChannelFeed.
 * Added Channel Messages to News Feed.
 * Connected Blog/Channels to GeneralMsgDialog.
 * Improved SubFileItem display.
 * Completed ChanGroup/Menu/MsgItems.
 * Added SubDestItem for use in GeneralMsgDialog.
 * Generalise CreateForum to cover Channels as well.
 * Restricted CreateForum to public forums/private channels.
 * Demo of Drag-N-Drop Files for Linux (filesystem->GenMsgDialog)
 * Updates to rsiface stuff (blog/channels/types)



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@621 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-06-24 04:36:45 +00:00
parent b9ccbd54e8
commit c6a595c7db
26 changed files with 1489 additions and 206 deletions

View file

@ -47,17 +47,6 @@ extern RsQblog *rsQblog;
RsQblog() { return; }
virtual ~RsQblog() { return; }
/**
* allows user to set his status
* @param status The status of the user
*/
virtual bool setStatus(const std::string &status) = 0;
/**
* returns reference to map of usrs and their status
* @param usrStatus returns map to usr and their status
*/
virtual bool getStatus(std::map<std::string, std::string> &usrStatus) = 0;
/**
* choose whether to filter or not
@ -82,31 +71,30 @@ extern RsQblog *rsQblog;
* @param id The user's frined's id
*/
virtual bool removeFiltFriend(std::string &usrId) = 0;
/**
* get users fav song
* @param usrId the usr whose fav song you want
* @param favSong puts ref for fav song here
*/
virtual bool getProfile(std::map<std::string, std::string> &profile) = 0;
/**
* for now just fav song, TODO: must find way to link to rs profile
*/
virtual bool setProfile(const std::string &favSong) = 0;
/**
* send blog info, will send to a data structure for transmission
* @param msg The msg the usr wants to send
*/
virtual bool sendBlog(const std::string &msg) = 0;
virtual bool sendBlog(const std::wstring &msg) = 0;
/**
* retrieve blog of a usr
* @param blogs contains the blog msgs of usr along with time posted for sorting
*/
virtual bool getBlogs(std::map< std::string, std::multimap<long int, std:: string> > &blogs) = 0;
virtual bool getBlogs(std::map< std::string, std::multimap<long int, std::wstring> > &blogs) = 0;
/**
* set usr profile, send an empty second pair to delete entry
* @param entry profile entry
*/
virtual bool setProfile(std::pair<std::wstring, std::wstring> entry) = 0;
/**
* add fav file, send file info with only name to delete that entry
* @param entry file info entry
*/
virtual bool setFavorites(FileInfo favFile) = 0;
/**
@ -134,8 +122,7 @@ extern RsQblog *rsQblog;
* @param favs list of Files
*/
virtual bool getPeerFavourites(std::string id, std::list<FileInfo> &favs) = 0;
};
#endif /*RSQBLOG_H_*/

View file

@ -0,0 +1,120 @@
#ifndef RS_CHANNEL_GUI_INTERFACE_H
#define RS_CHANNEL_GUI_INTERFACE_H
/*
* libretroshare/src/rsiface: rschannels.h
*
* RetroShare C++ Interface.
*
* Copyright 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 "rsiface/rstypes.h"
#include "rsiface/rsdistrib.h" /* For FLAGS */
class ChannelInfo
{
public:
ChannelInfo() {}
std::string channelId;
std::wstring channelName;
std::wstring channelDesc;
uint32_t channelFlags;
uint32_t pop;
time_t lastPost;
};
class ChannelMsgInfo
{
public:
ChannelMsgInfo() {}
std::string channelId;
std::string msgId;
unsigned int msgflags;
std::wstring subject;
std::wstring msg;
time_t ts;
std::list<FileInfo> files;
uint32_t count;
uint64_t size;
};
class ChannelMsgSummary
{
public:
ChannelMsgSummary() {}
std::string channelId;
std::string msgId;
uint32_t msgflags;
std::wstring subject;
std::wstring msg;
uint32_t count; /* file count */
time_t ts;
};
std::ostream &operator<<(std::ostream &out, const ChannelInfo &info);
std::ostream &operator<<(std::ostream &out, const ChannelMsgSummary &info);
std::ostream &operator<<(std::ostream &out, const ChannelMsgInfo &info);
class RsChannels;
extern RsChannels *rsChannels;
class RsChannels
{
public:
RsChannels() { return; }
virtual ~RsChannels() { return; }
/****************************************/
virtual bool channelsChanged(std::list<std::string> &chanIds) = 0;
virtual std::string createChannel(std::wstring chanName, std::wstring chanDesc, uint32_t chanFlags) = 0;
virtual bool getChannelInfo(std::string cId, ChannelInfo &ci) = 0;
virtual bool getChannelList(std::list<ChannelInfo> &chanList) = 0;
virtual bool getChannelMsgList(std::string cId, std::list<ChannelMsgSummary> &msgs) = 0;
virtual bool getChannelMessage(std::string cId, std::string mId, ChannelMsgInfo &msg) = 0;
virtual bool ChannelMessageSend(ChannelMsgInfo &info) = 0;
virtual bool channelSubscribe(std::string cId, bool subscribe) = 0;
/****************************************/
};
#endif

View file

@ -100,21 +100,6 @@ virtual void unlockData() = 0;
const PersonInfo *getPerson(std::string id);
const DirInfo *getDirectory(std::string id, std::string path);
const std::map<RsChanId, ChannelInfo> &getChannels()
{ return mChannelMap; }
const std::map<RsChanId, ChannelInfo> &getOurChannels()
{ return mChannelOwnMap; }
//const MessageInfo *getChannelMsg(std::string chId, std::string mId);
//std::list<ChatInfo> getChatNew()
// {
// std::list<ChatInfo> newList = mChatList;
// mChatList.clear();
// return newList;
// }
const std::list<FileInfo> &getRecommendList()
{ return mRecommendList; }
@ -160,10 +145,6 @@ void fillLists(); /* create some dummy data to display */
std::list<PersonInfo> mRemoteDirList;
std::list<PersonInfo> mLocalDirList;
std::list<FileTransferInfo> mTransferList;
//std::list<MessageInfo> mMessageList;
std::map<RsChanId, ChannelInfo> mChannelMap;
std::map<RsChanId, ChannelInfo> mChannelOwnMap;
//std::list<ChatInfo> mChatList;
std::list<FileInfo> mRecommendList;
bool mChanged[NumOfFlags];
@ -218,20 +199,6 @@ virtual int FileCancel(std::string fname, std::string hash, uint32_t size) = 0;
virtual int FileClearCompleted() = 0;
virtual int FileSetBandwidthTotals(float outkB, float inkB) = 0;
/****************************************/
/* Message Items */
//virtual int MessageSend(MessageInfo &info) = 0;
//virtual int MessageDelete(std::string mid) = 0;
//virtual int MessageRead(std::string mid) = 0;
/* Channel Items */
virtual int ChannelCreateNew(ChannelInfo &info) = 0;
virtual int ChannelSendMsg(ChannelInfo &info) = 0;
/****************************************/
/* Chat */
//virtual int ChatSend(ChatInfo &ci) = 0;
/****************************************/
/* Flagging Persons / Channels / Files in or out of a set (CheckLists) */

View file

@ -75,8 +75,8 @@ static const int kRsFiStatusDone = 2;
std::string hash;
std::string ext;
int size;
int avail; /* how much we have */
uint64_t size;
uint64_t avail; /* how much we have */
int status;
bool inRecommend;
@ -138,26 +138,6 @@ class FileTransferInfo: public FileInfo
int downloadStatus; /* 0 = Err, 1 = Ok, 2 = Done */
};
class ChannelInfo: public BaseInfo
{
public:
ChannelInfo() :publisher(false) {}
RsChanId chanId;
bool publisher;
std::string chanName;
//std::list<MessageInfo> msglist;
/* details */
int mode;
float rank;
bool inBroadcast;
bool inSubscribe;
int size; /* total of msgs */
int count; /* msg count */
};
/* matched to the uPnP states */
#define UPNP_STATE_UNINITIALISED 0
#define UPNP_STATE_UNAVAILABILE 1
@ -230,7 +210,6 @@ class SearchRequest
};
std::ostream &operator<<(std::ostream &out, const ChannelInfo &info);
std::ostream &operator<<(std::ostream &out, const PersonInfo &info);
std::ostream &print(std::ostream &out, const DirInfo &info, int indentLvl);