2008-06-20 08:43:23 -04:00
|
|
|
/****************************************************************
|
|
|
|
* RetroShare is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008 Robert Fernie
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#ifndef _PEER_ITEM_DIALOG_H
|
|
|
|
#define _PEER_ITEM_DIALOG_H
|
|
|
|
|
|
|
|
#include "ui_PeerItem.h"
|
2014-11-15 12:24:49 -05:00
|
|
|
#include "FeedItem.h"
|
2009-05-11 10:33:32 -04:00
|
|
|
#include <stdint.h>
|
2008-06-20 08:43:23 -04:00
|
|
|
|
2012-02-01 07:21:14 -05:00
|
|
|
const uint32_t PEER_TYPE_STD = 0x0001;
|
2008-06-20 08:43:23 -04:00
|
|
|
const uint32_t PEER_TYPE_CONNECT = 0x0002;
|
|
|
|
const uint32_t PEER_TYPE_HELLO = 0x0003; /* failed Connect Attempt */
|
|
|
|
const uint32_t PEER_TYPE_NEW_FOF = 0x0004; /* new Friend of Friend */
|
|
|
|
|
|
|
|
class FeedHolder;
|
|
|
|
|
2014-11-15 12:24:49 -05:00
|
|
|
class PeerItem : public FeedItem, private Ui::PeerItem
|
2008-06-20 08:43:23 -04:00
|
|
|
{
|
2012-02-01 07:21:14 -05:00
|
|
|
Q_OBJECT
|
2008-06-20 08:43:23 -04:00
|
|
|
|
|
|
|
public:
|
2012-02-01 07:21:14 -05:00
|
|
|
/** Default Constructor */
|
2014-11-15 12:24:49 -05:00
|
|
|
PeerItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &peerId, uint32_t type, bool isHome);
|
2008-06-20 08:43:23 -04:00
|
|
|
|
|
|
|
void updateItemStatic();
|
|
|
|
|
2015-06-17 14:59:12 -04:00
|
|
|
protected:
|
2014-11-15 12:24:49 -05:00
|
|
|
/* FeedItem */
|
2015-06-17 14:59:12 -04:00
|
|
|
virtual void doExpand(bool open);
|
2014-11-15 12:24:49 -05:00
|
|
|
|
2008-06-20 08:43:23 -04:00
|
|
|
private slots:
|
|
|
|
/* default stuff */
|
2012-02-01 07:21:14 -05:00
|
|
|
void removeItem();
|
2008-06-20 08:43:23 -04:00
|
|
|
void toggle();
|
|
|
|
|
|
|
|
void addFriend();
|
|
|
|
void removeFriend();
|
|
|
|
void sendMsg();
|
|
|
|
void openChat();
|
|
|
|
|
|
|
|
void updateItem();
|
2010-09-08 18:46:26 -04:00
|
|
|
|
|
|
|
|
2008-06-20 08:43:23 -04:00
|
|
|
private:
|
|
|
|
FeedHolder *mParent;
|
|
|
|
uint32_t mFeedId;
|
|
|
|
|
2014-03-17 16:56:06 -04:00
|
|
|
RsPeerId mPeerId;
|
2008-06-20 08:43:23 -04:00
|
|
|
uint32_t mType;
|
|
|
|
bool mIsHome;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|