summaryrefslogtreecommitdiff
path: root/components/friendslist.hpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-05-07 01:57:08 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2021-05-07 01:57:08 -0400
commit86ab14e5ec5c6acfcee1d6177c77f5ac9c9dbe31 (patch)
tree7e058e9b0091389d08b15b0fd198662e9fbb59a8 /components/friendslist.hpp
parenta74f66513b123d0d1be6c02f37b9497632509d46 (diff)
downloadabaddon-portaudio-86ab14e5ec5c6acfcee1d6177c77f5ac9c9dbe31.tar.gz
abaddon-portaudio-86ab14e5ec5c6acfcee1d6177c77f5ac9c9dbe31.zip
start friends list
Diffstat (limited to 'components/friendslist.hpp')
-rw-r--r--components/friendslist.hpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/components/friendslist.hpp b/components/friendslist.hpp
new file mode 100644
index 0000000..8d05c1e
--- /dev/null
+++ b/components/friendslist.hpp
@@ -0,0 +1,66 @@
+#pragma once
+#include <gtkmm.h>
+#include "../discord/relationship.hpp"
+
+class FriendsListAddComponent : public Gtk::Box {
+public:
+ FriendsListAddComponent();
+
+private:
+ Gtk::Label m_label;
+ Gtk::Label m_status;
+ Gtk::Entry m_entry;
+ Gtk::Button m_add;
+ Gtk::Box m_box;
+};
+
+class FriendsList : public Gtk::Box {
+public:
+ FriendsList();
+
+private:
+ enum FilterMode {
+ FILTER_FRIENDS,
+ FILTER_ONLINE,
+ FILTER_PENDING,
+ FILTER_BLOCKED,
+ };
+
+ FilterMode m_filter_mode;
+
+ int ListSortFunc(Gtk::ListBoxRow *a, Gtk::ListBoxRow *b);
+ bool ListFilterFunc(Gtk::ListBoxRow *row);
+
+ FriendsListAddComponent m_add;
+ Gtk::RadioButtonGroup m_group;
+ Gtk::ButtonBox m_buttons;
+ Gtk::ScrolledWindow m_scroll;
+ Gtk::ListBox m_list;
+};
+
+class FriendsListFriendRow : public Gtk::ListBoxRow {
+public:
+ FriendsListFriendRow(RelationshipType type, const UserData &str);
+
+ Snowflake ID;
+ RelationshipType Type;
+ Glib::ustring Name;
+
+private:
+ Gtk::Menu m_menu;
+ Gtk::MenuItem m_remove; // or cancel or ignore
+
+ using type_signal_remove = sigc::signal<void>;
+ type_signal_remove m_signal_remove;
+
+public:
+ type_signal_remove signal_action_remove();
+};
+
+class FriendsListWindow : public Gtk::Window {
+public:
+ FriendsListWindow();
+
+private:
+ FriendsList m_friends;
+};