qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
ifriendlistitem.h
Go to the documentation of this file.
1 /*
2  Copyright © 2021 by The qTox Project Contributors
3 
4  This file is part of qTox, a Qt-based graphical interface for Tox.
5 
6  qTox is libre software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  qTox is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with qTox. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include <QDate>
23 
24 class QWidget;
25 
27 {
28 public:
29  IFriendListItem() = default;
30  virtual ~IFriendListItem();
31  IFriendListItem(const IFriendListItem&) = default;
32  IFriendListItem& operator=(const IFriendListItem&) = default;
33  IFriendListItem(IFriendListItem&&) = default;
35 
36  virtual bool isFriend() const = 0;
37  virtual bool isGroup() const = 0;
38  virtual bool isOnline() const = 0;
39  virtual bool widgetIsVisible() const = 0;
40  virtual QString getNameItem() const = 0;
41  virtual QDateTime getLastActivity() const = 0;
42  virtual QWidget* getWidget() = 0;
43  virtual void setWidgetVisible(bool) = 0;
44 
45  virtual int getCircleId() const
46  {
47  return -1;
48  }
49 
50  int getNameSortedPos() const
51  {
52  return nameSortedPos;
53  }
54 
55  void setNameSortedPos(int pos)
56  {
57  nameSortedPos = pos;
58  }
59 
60 private:
61  int nameSortedPos = -1;
62 };
IFriendListItem::getNameSortedPos
int getNameSortedPos() const
Definition: ifriendlistitem.h:50
IFriendListItem::widgetIsVisible
virtual bool widgetIsVisible() const =0
IFriendListItem::getNameItem
virtual QString getNameItem() const =0
IFriendListItem
Definition: ifriendlistitem.h:26
IFriendListItem::getWidget
virtual QWidget * getWidget()=0
IFriendListItem::nameSortedPos
int nameSortedPos
Definition: ifriendlistitem.h:61
IFriendListItem::isGroup
virtual bool isGroup() const =0
IFriendListItem::getCircleId
virtual int getCircleId() const
Definition: ifriendlistitem.h:45
IFriendListItem::setWidgetVisible
virtual void setWidgetVisible(bool)=0
IFriendListItem::IFriendListItem
IFriendListItem()=default
IFriendListItem::~IFriendListItem
virtual ~IFriendListItem()
IFriendListItem::isOnline
virtual bool isOnline() const =0
IFriendListItem::setNameSortedPos
void setNameSortedPos(int pos)
Definition: ifriendlistitem.h:55
IFriendListItem::operator=
IFriendListItem & operator=(const IFriendListItem &)=default
IFriendListItem::isFriend
virtual bool isFriend() const =0
IFriendListItem::getLastActivity
virtual QDateTime getLastActivity() const =0