qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
genericchatitemwidget.h
Go to the documentation of this file.
1 /*
2  Copyright © 2015-2019 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 <QFrame>
23 #include <QLabel>
24 
25 class CroppingLabel;
26 
27 class GenericChatItemWidget : public QFrame
28 {
29  Q_OBJECT
30 public:
31  enum ItemType
32  {
36  };
37 
38  explicit GenericChatItemWidget(bool compact, QWidget* parent = nullptr);
39 
40  bool isCompact() const;
41  void setCompact(bool compact);
42 
43  QString getName() const;
44 
45  void searchName(const QString& searchString, bool hideAll);
46 
47  Q_PROPERTY(bool compact READ isCompact WRITE setCompact)
48 
49 public slots:
50  virtual void reloadTheme() {}
51 
52 protected:
54  QLabel statusPic;
55 
56 private:
57  bool compact;
58 };
GenericChatItemWidget::reloadTheme
virtual void reloadTheme()
Definition: genericchatitemwidget.h:50
GenericChatItemWidget::getName
QString getName() const
Definition: genericchatitemwidget.cpp:49
GenericChatItemWidget::compact
bool compact
Definition: genericchatitemwidget.h:47
GenericChatItemWidget::FriendOnlineItem
@ FriendOnlineItem
Definition: genericchatitemwidget.h:35
CroppingLabel
Definition: croppinglabel.h:26
GenericChatItemWidget::FriendOfflineItem
@ FriendOfflineItem
Definition: genericchatitemwidget.h:34
GenericChatItemWidget::searchName
void searchName(const QString &searchString, bool hideAll)
Definition: genericchatitemwidget.cpp:54
GenericChatItemWidget
Definition: genericchatitemwidget.h:27
GenericChatItemWidget::ItemType
ItemType
Definition: genericchatitemwidget.h:31
GenericChatItemWidget::statusPic
QLabel statusPic
Definition: genericchatitemwidget.h:54
GenericChatItemWidget::nameLabel
CroppingLabel * nameLabel
Definition: genericchatitemwidget.h:53
GenericChatItemWidget::GenericChatItemWidget
GenericChatItemWidget(bool compact, QWidget *parent=nullptr)
Definition: genericchatitemwidget.cpp:26
GenericChatItemWidget::GroupItem
@ GroupItem
Definition: genericchatitemwidget.h:33
GenericChatItemWidget::setCompact
void setCompact(bool compact)
Definition: genericchatitemwidget.cpp:44
GenericChatItemWidget::isCompact
bool isCompact() const
Definition: genericchatitemwidget.cpp:39