qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Slots | Signals | Public Member Functions | Public Attributes | Protected Member Functions | Private Slots | List of all members
FriendWidget Class Reference

#include <friendwidget.h>

Inheritance diagram for FriendWidget:
Inheritance graph
Collaboration diagram for FriendWidget:
Collaboration graph

Public Slots

void onAvatarSet (const ToxPk &friendPk, const QPixmap &pic)
 
void onAvatarRemoved (const ToxPk &friendPk)
 
void onContextMenuCalled (QContextMenuEvent *event)
 FriendWidget::onContextMenuCalled. More...
 
void setActive (bool active)
 
- Public Slots inherited from GenericChatroomWidget
virtual GroupgetGroup () const
 
bool eventFilter (QObject *, QEvent *) final
 
bool isActive ()
 
void setName (const QString &name)
 
void setStatusMsg (const QString &status)
 
QString getStatusMsg () const
 
QString getTitle () const
 
void activate ()
 
void compactChange (bool compact)
 
void reloadTheme () override
 
- Public Slots inherited from GenericChatItemWidget
virtual void reloadTheme ()
 

Signals

void friendWidgetClicked (FriendWidget *widget)
 
void removeFriend (const ToxPk &friendPk)
 
void copyFriendIdToClipboard (const ToxPk &friendPk)
 
void contextMenuCalled (QContextMenuEvent *event)
 
void friendHistoryRemoved ()
 
void updateFriendActivity (Friend &frnd)
 
- Signals inherited from GenericChatroomWidget
void chatroomWidgetClicked (GenericChatroomWidget *widget)
 
void newWindowOpened (GenericChatroomWidget *widget)
 
void middleMouseClicked ()
 

Public Member Functions

 FriendWidget (std::shared_ptr< FriendChatroom > chatform, bool compact)
 
void contextMenuEvent (QContextMenuEvent *event) final
 FriendWidget::contextMenuEvent. More...
 
void setAsActiveChatroom () final
 
void setAsInactiveChatroom () final
 
void updateStatusLight () final
 
void resetEventFlags () final
 
QString getStatusString () const final
 
const FriendgetFriend () const final
 
const ContactgetContact () const final
 
bool isFriend () const final
 
bool isGroup () const final
 
bool isOnline () const final
 
bool widgetIsVisible () const final
 
QString getNameItem () const final
 
QDateTime getLastActivity () const final
 
int getCircleId () const final
 
QWidget * getWidget () final
 
void setWidgetVisible (bool visible) final
 
- Public Member Functions inherited from GenericChatroomWidget
 GenericChatroomWidget (bool compact, QWidget *parent=nullptr)
 
- Public Member Functions inherited from GenericChatItemWidget
 GenericChatItemWidget (bool compact, QWidget *parent=nullptr)
 
bool isCompact () const
 
void setCompact (bool compact)
 
QString getName () const
 
void searchName (const QString &searchString, bool hideAll)
 
- Public Member Functions inherited from IFriendListItem
 IFriendListItem ()=default
 
virtual ~IFriendListItem ()
 
 IFriendListItem (const IFriendListItem &)=default
 
IFriendListItemoperator= (const IFriendListItem &)=default
 
 IFriendListItem (IFriendListItem &&)=default
 
IFriendListItemoperator= (IFriendListItem &&)=default
 
int getNameSortedPos () const
 
void setNameSortedPos (int pos)
 

Public Attributes

std::shared_ptr< FriendChatroomchatroom
 
bool isDefaultAvatar
 

Protected Member Functions

void mousePressEvent (QMouseEvent *ev) override
 
void mouseMoveEvent (QMouseEvent *ev) override
 
void setFriendAlias ()
 
- Protected Member Functions inherited from GenericChatroomWidget
void mouseReleaseEvent (QMouseEvent *event) override
 
void enterEvent (QEvent *e) override
 
void leaveEvent (QEvent *e) override
 
void setActive (bool active)
 

Private Slots

void removeChatWindow ()
 
void moveToNewCircle ()
 
void removeFromCircle ()
 
void moveToCircle (int circleId)
 
void changeAutoAccept (bool enable)
 
void showDetails ()
 

Additional Inherited Members

- Public Types inherited from GenericChatItemWidget
enum  ItemType { GroupItem, FriendOfflineItem, FriendOnlineItem }
 
- Protected Attributes inherited from GenericChatroomWidget
QPoint dragStartPos
 
QColor lastColor
 
QHBoxLayout * mainLayout = nullptr
 
QVBoxLayout * textLayout = nullptr
 
MaskablePixmapWidgetavatar
 
CroppingLabelstatusMessageLabel
 
bool active
 
- Protected Attributes inherited from GenericChatItemWidget
CroppingLabelnameLabel
 
QLabel statusPic
 
- Properties inherited from GenericChatItemWidget
bool compact
 

Detailed Description

Widget, which displays brief information about friend. For example, used on friend list. When you click should open the chat with friend. Widget has a context menu.

Definition at line 33 of file friendwidget.h.

Constructor & Destructor Documentation

◆ FriendWidget()

FriendWidget::FriendWidget ( std::shared_ptr< FriendChatroom chatform,
bool  compact 
)

Definition at line 59 of file friendwidget.cpp.

Member Function Documentation

◆ changeAutoAccept

void FriendWidget::changeAutoAccept ( bool  enable)
privateslot

Definition at line 266 of file friendwidget.cpp.

Here is the caller graph for this function:

◆ contextMenuCalled

void FriendWidget::contextMenuCalled ( QContextMenuEvent *  event)
signal
Here is the caller graph for this function:

◆ contextMenuEvent()

void FriendWidget::contextMenuEvent ( QContextMenuEvent *  event)
final

FriendWidget::contextMenuEvent.

Parameters
eventDescribe a context menu event

Default context menu event handler. Redirect all event information to the signal.

Definition at line 85 of file friendwidget.cpp.

◆ copyFriendIdToClipboard

void FriendWidget::copyFriendIdToClipboard ( const ToxPk friendPk)
signal
Here is the caller graph for this function:

◆ friendHistoryRemoved

void FriendWidget::friendHistoryRemoved ( )
signal
Here is the caller graph for this function:

◆ friendWidgetClicked

void FriendWidget::friendWidgetClicked ( FriendWidget widget)
signal

◆ getCircleId()

int FriendWidget::getCircleId ( ) const
finalvirtual

Reimplemented from IFriendListItem.

Definition at line 399 of file friendwidget.cpp.

◆ getContact()

const Contact * FriendWidget::getContact ( ) const
finalvirtual

Implements GenericChatroomWidget.

Definition at line 352 of file friendwidget.cpp.

Here is the call graph for this function:

◆ getFriend()

const Friend * FriendWidget::getFriend ( ) const
finalvirtual

Reimplemented from GenericChatroomWidget.

Definition at line 347 of file friendwidget.cpp.

Here is the caller graph for this function:

◆ getLastActivity()

QDateTime FriendWidget::getLastActivity ( ) const
finalvirtual

Implements IFriendListItem.

Definition at line 383 of file friendwidget.cpp.

Here is the call graph for this function:

◆ getNameItem()

QString FriendWidget::getNameItem ( ) const
finalvirtual

Implements IFriendListItem.

Definition at line 378 of file friendwidget.cpp.

Here is the call graph for this function:

◆ getStatusString()

QString FriendWidget::getStatusString ( ) const
finalvirtual

Implements GenericChatroomWidget.

Definition at line 329 of file friendwidget.cpp.

Here is the call graph for this function:

◆ getWidget()

QWidget * FriendWidget::getWidget ( )
finalvirtual

Implements IFriendListItem.

Definition at line 389 of file friendwidget.cpp.

◆ isFriend()

bool FriendWidget::isFriend ( ) const
finalvirtual

Implements IFriendListItem.

Definition at line 357 of file friendwidget.cpp.

◆ isGroup()

bool FriendWidget::isGroup ( ) const
finalvirtual

Implements IFriendListItem.

Definition at line 362 of file friendwidget.cpp.

◆ isOnline()

bool FriendWidget::isOnline ( ) const
finalvirtual

Implements IFriendListItem.

Definition at line 367 of file friendwidget.cpp.

Here is the call graph for this function:

◆ mouseMoveEvent()

void FriendWidget::mouseMoveEvent ( QMouseEvent *  ev)
overrideprotected

Definition at line 442 of file friendwidget.cpp.

Here is the call graph for this function:

◆ mousePressEvent()

void FriendWidget::mousePressEvent ( QMouseEvent *  ev)
overrideprotected

Definition at line 433 of file friendwidget.cpp.

◆ moveToCircle

void FriendWidget::moveToCircle ( int  circleId)
privateslot

Definition at line 244 of file friendwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ moveToNewCircle

void FriendWidget::moveToNewCircle ( )
privateslot

Definition at line 203 of file friendwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onAvatarRemoved

void FriendWidget::onAvatarRemoved ( const ToxPk friendPk)
slot

Definition at line 420 of file friendwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onAvatarSet

void FriendWidget::onAvatarSet ( const ToxPk friendPk,
const QPixmap &  pic 
)
slot

Definition at line 409 of file friendwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onContextMenuCalled

void FriendWidget::onContextMenuCalled ( QContextMenuEvent *  event)
slot

FriendWidget::onContextMenuCalled.

Parameters
eventRedirected from native contextMenuEvent

Context menu handler. Always should be called to FriendWidget from FriendList

Definition at line 96 of file friendwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeChatWindow

void FriendWidget::removeChatWindow ( )
privateslot

Definition at line 184 of file friendwidget.cpp.

Here is the caller graph for this function:

◆ removeFriend

void FriendWidget::removeFriend ( const ToxPk friendPk)
signal
Here is the caller graph for this function:

◆ removeFromCircle

void FriendWidget::removeFromCircle ( )
privateslot

Definition at line 224 of file friendwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetEventFlags()

void FriendWidget::resetEventFlags ( )
finalvirtual

Implements GenericChatroomWidget.

Definition at line 404 of file friendwidget.cpp.

◆ setActive

void FriendWidget::setActive ( bool  active)
slot

Definition at line 299 of file friendwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAsActiveChatroom()

void FriendWidget::setAsActiveChatroom ( )
finalvirtual

Implements GenericChatroomWidget.

Definition at line 289 of file friendwidget.cpp.

Here is the call graph for this function:

◆ setAsInactiveChatroom()

void FriendWidget::setAsInactiveChatroom ( )
finalvirtual

Implements GenericChatroomWidget.

Definition at line 294 of file friendwidget.cpp.

Here is the call graph for this function:

◆ setFriendAlias()

void FriendWidget::setFriendAlias ( )
protected

◆ setWidgetVisible()

void FriendWidget::setWidgetVisible ( bool  visible)
finalvirtual

Implements IFriendListItem.

Definition at line 394 of file friendwidget.cpp.

◆ showDetails

void FriendWidget::showDetails ( )
privateslot

Definition at line 279 of file friendwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateFriendActivity

void FriendWidget::updateFriendActivity ( Friend frnd)
signal
Here is the caller graph for this function:

◆ updateStatusLight()

void FriendWidget::updateStatusLight ( )
finalvirtual

Implements GenericChatroomWidget.

Definition at line 309 of file friendwidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ widgetIsVisible()

bool FriendWidget::widgetIsVisible ( ) const
finalvirtual

Implements IFriendListItem.

Definition at line 373 of file friendwidget.cpp.

Member Data Documentation

◆ chatroom

std::shared_ptr<FriendChatroom> FriendWidget::chatroom

Definition at line 86 of file friendwidget.h.

◆ isDefaultAvatar

bool FriendWidget::isDefaultAvatar

Definition at line 87 of file friendwidget.h.


The documentation for this class was generated from the following files: