2017-09-26 17:57:01 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2017-09-26 17:57:01 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2017-09-26 17:57:01 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-11-07 17:53:00 +00:00
|
|
|
#include "boxes/peer_list_box.h"
|
2017-09-26 17:57:01 +00:00
|
|
|
|
2017-10-03 13:05:58 +00:00
|
|
|
namespace Window {
|
2017-12-04 07:33:33 +00:00
|
|
|
class Navigation;
|
2017-10-03 13:05:58 +00:00
|
|
|
} // namespace Window
|
|
|
|
|
2017-09-26 17:57:01 +00:00
|
|
|
namespace Info {
|
|
|
|
namespace Profile {
|
|
|
|
|
2017-11-07 17:53:00 +00:00
|
|
|
class MemberListRow final : public PeerListRow {
|
|
|
|
public:
|
|
|
|
enum class Rights {
|
|
|
|
Normal,
|
|
|
|
Admin,
|
|
|
|
Creator,
|
|
|
|
};
|
|
|
|
struct Type {
|
|
|
|
Rights rights;
|
|
|
|
bool canRemove = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
MemberListRow(not_null<UserData*> user, Type type);
|
|
|
|
|
|
|
|
void setType(Type type);
|
|
|
|
QSize actionSize() const override;
|
|
|
|
void paintAction(
|
|
|
|
Painter &p,
|
2019-02-19 06:57:53 +00:00
|
|
|
crl::time ms,
|
2017-11-07 17:53:00 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
bool selected,
|
|
|
|
bool actionSelected) override;
|
|
|
|
int nameIconWidth() const override;
|
|
|
|
void paintNameIcon(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
2017-11-08 16:45:30 +00:00
|
|
|
int outerWidth,
|
|
|
|
bool selected) override;
|
2017-11-07 17:53:00 +00:00
|
|
|
|
2019-01-04 11:09:48 +00:00
|
|
|
not_null<UserData*> user() const;
|
2017-11-07 17:53:00 +00:00
|
|
|
bool canRemove() const {
|
|
|
|
return _type.canRemove;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Type _type;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-09-26 17:57:01 +00:00
|
|
|
std::unique_ptr<PeerListController> CreateMembersController(
|
2017-12-04 07:33:33 +00:00
|
|
|
not_null<Window::Navigation*> navigation,
|
2017-09-26 17:57:01 +00:00
|
|
|
not_null<PeerData*> peer);
|
|
|
|
|
|
|
|
} // namespace Profile
|
|
|
|
} // namespace Info
|