/* This file is part of Telegram Desktop, the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once class History; class Painter; namespace Dialogs { class Row; class CommunityRowsView final { public: CommunityRowsView(); ~CommunityRowsView(); void setRepaint(Fn repaint); void clear(); void add(not_null history, float64 narrowRatio); void finalize(); void recountHeights(float64 narrowRatio); [[nodiscard]] bool empty() const { return _rows.empty(); } [[nodiscard]] int size() const { return int(_rows.size()); } [[nodiscard]] int height() const; [[nodiscard]] int indexByY(int y) const; [[nodiscard]] int rowTop(int index) const; [[nodiscard]] Row *rowAt(int index) const; [[nodiscard]] bool contains(not_null history) const; void paint( Painter &p, QRect clip, Fn, int index, int top)> paintRow) const; private: Fn _repaint; std::vector> _rows; std::vector _tops; rpl::lifetime _forumsLifetime; }; } // namespace Dialogs