mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-24 22:30:42 -04:00
finished status service
- can be called use rs interface rstatus - does not save last rs session status yet git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2715 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2eb3d560e0
commit
300952d2a6
11 changed files with 560 additions and 19 deletions
93
libretroshare/src/services/p3statusservice.h
Normal file
93
libretroshare/src/services/p3statusservice.h
Normal file
|
@ -0,0 +1,93 @@
|
|||
#ifndef RS_P3_STATUS_INTERFACE_H
|
||||
#define RS_P3_STATUS_INTERFACE_H
|
||||
|
||||
/*
|
||||
* libretroshare/src/services: p3statusService.h
|
||||
*
|
||||
* RetroShare C++
|
||||
*
|
||||
* Copyright 2008 by Vinny Do, Chris Evi-Parker.
|
||||
*
|
||||
* 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 "serialiser/rsstatusitems.h"
|
||||
#include "rsiface/rsstatus.h"
|
||||
#include "services/p3service.h"
|
||||
#include "pqi/p3connmgr.h"
|
||||
|
||||
//! handles standard status messages (busy, away, online, offline) set by user
|
||||
/*!
|
||||
* The is a retroshare service which allows peers
|
||||
* to inform each other about their status in a standard way, as opposed to
|
||||
* custom string.
|
||||
* @see rsiface/rsstatus.h for status constants
|
||||
*/
|
||||
class p3StatusService: public p3Service, public p3Config
|
||||
{
|
||||
public:
|
||||
|
||||
p3StatusService(p3ConnectMgr* );
|
||||
virtual ~p3StatusService();
|
||||
|
||||
/***** overloaded from p3Service *****/
|
||||
virtual int tick();
|
||||
virtual int status();
|
||||
|
||||
/********* RsStatus ***********/
|
||||
|
||||
virtual bool getStatus(std::list<StatusInfo>& statusInfo);
|
||||
virtual bool sendStatus(StatusInfo& statusInfo);
|
||||
virtual bool statusAvailable();
|
||||
|
||||
/******************************/
|
||||
|
||||
|
||||
/** implemented from p3Config **/
|
||||
|
||||
/*!
|
||||
* @return The serialiser the enables storage of save info
|
||||
*/
|
||||
virtual RsSerialiser *setupSerialiser();
|
||||
|
||||
/*!
|
||||
* This stores information on what your status was before you exited rs
|
||||
*/
|
||||
virtual std::list<RsItem*> saveList(bool& cleanup);
|
||||
|
||||
/*!
|
||||
* @param load Should contain a single item which is clients status from last rs session
|
||||
*/
|
||||
virtual bool loadList(std::list<RsItem*> load);
|
||||
|
||||
private:
|
||||
|
||||
virtual std::list<RsStatusItem* > getStatusQueue();
|
||||
|
||||
p3ConnectMgr *mConnMgr;
|
||||
|
||||
std::map<std::string, StatusInfo> mStatusInfoMap;
|
||||
|
||||
RsMutex mStatusMtx;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue