qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
friendlistlayout.h
Go to the documentation of this file.
1 /*
2  Copyright © 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 "genericchatitemlayout.h"
23 #include "src/model/status.h"
24 #include "src/core/core.h"
25 #include <QBoxLayout>
26 
27 class FriendWidget;
28 class FriendListWidget;
29 
30 class FriendListLayout : public QVBoxLayout
31 {
32  Q_OBJECT
33 public:
34  explicit FriendListLayout();
35  explicit FriendListLayout(QWidget* parent);
36 
39  int indexOfFriendWidget(GenericChatItemWidget* widget, bool online) const;
40  void moveFriendWidgets(FriendListWidget* listWidget);
41  int friendOnlineCount() const;
42  int friendTotalCount() const;
43 
44  bool hasChatrooms() const;
45  void searchChatrooms(const QString& searchString, bool hideOnline = false,
46  bool hideOffline = false);
47 
48  QLayout* getLayoutOnline() const;
49  QLayout* getLayoutOffline() const;
50 
51 private:
52  void init();
53  QLayout* getFriendLayout(Status::Status s) const;
54 
57 };
Status::Status
Status
Definition: status.h:28
FriendListLayout::addFriendWidget
void addFriendWidget(FriendWidget *widget, Status::Status s)
Definition: friendlistlayout.cpp:55
FriendListLayout::friendTotalCount
int friendTotalCount() const
Definition: friendlistlayout.cpp:106
FriendListLayout::removeFriendWidget
void removeFriendWidget(FriendWidget *widget, Status::Status s)
Definition: friendlistlayout.cpp:68
FriendListLayout::FriendListLayout
FriendListLayout()
Definition: friendlistlayout.cpp:28
FriendListLayout::indexOfFriendWidget
int indexOfFriendWidget(GenericChatItemWidget *widget, bool online) const
Definition: friendlistlayout.cpp:76
GenericChatItemWidget
Definition: genericchatitemwidget.h:27
FriendListLayout::friendOnlineLayout
GenericChatItemLayout friendOnlineLayout
Definition: friendlistlayout.h:55
GenericChatItemLayout
Definition: genericchatitemlayout.h:28
FriendListLayout::getFriendLayout
QLayout * getFriendLayout(Status::Status s) const
Definition: friendlistlayout.cpp:132
FriendListLayout::getLayoutOnline
QLayout * getLayoutOnline() const
Definition: friendlistlayout.cpp:122
FriendListLayout::searchChatrooms
void searchChatrooms(const QString &searchString, bool hideOnline=false, bool hideOffline=false)
Definition: friendlistlayout.cpp:116
FriendListLayout::init
void init()
Definition: friendlistlayout.cpp:40
FriendListLayout::moveFriendWidgets
void moveFriendWidgets(FriendListWidget *listWidget)
Definition: friendlistlayout.cpp:83
FriendListLayout
Definition: friendlistlayout.h:30
FriendListWidget
Definition: friendlistwidget.h:42
FriendListLayout::getLayoutOffline
QLayout * getLayoutOffline() const
Definition: friendlistlayout.cpp:127
FriendListLayout::friendOfflineLayout
GenericChatItemLayout friendOfflineLayout
Definition: friendlistlayout.h:56
core.h
FriendListLayout::hasChatrooms
bool hasChatrooms() const
Definition: friendlistlayout.cpp:111
genericchatitemlayout.h
FriendListLayout::friendOnlineCount
int friendOnlineCount() const
Definition: friendlistlayout.cpp:101
status.h
FriendWidget
Definition: friendwidget.h:33