2017-09-13 17:01:23 +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-13 17:01:23 +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-13 17:01:23 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ui/rp_widget.h"
|
2017-11-06 10:00:37 +00:00
|
|
|
#include "ui/widgets/scroll_area.h"
|
2017-10-31 18:25:22 +00:00
|
|
|
#include "base/unique_qptr.h"
|
2017-09-30 18:26:45 +00:00
|
|
|
#include "info/media/info_media_widget.h"
|
2017-10-30 19:24:20 +00:00
|
|
|
#include "info/media/info_media_list_widget.h"
|
2017-09-13 17:01:23 +00:00
|
|
|
|
2017-10-04 12:39:59 +00:00
|
|
|
namespace Ui {
|
|
|
|
class SettingsSlider;
|
|
|
|
class VerticalLayout;
|
2017-10-30 19:24:20 +00:00
|
|
|
class SearchFieldController;
|
2017-10-04 12:39:59 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
namespace Info {
|
2017-10-31 18:25:22 +00:00
|
|
|
|
|
|
|
class Controller;
|
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
namespace Media {
|
|
|
|
|
2017-10-04 12:39:59 +00:00
|
|
|
class Memento;
|
|
|
|
class ListWidget;
|
2017-11-14 17:22:44 +00:00
|
|
|
class EmptyWidget;
|
2017-10-04 12:39:59 +00:00
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
class InnerWidget final : public Ui::RpWidget {
|
|
|
|
public:
|
|
|
|
InnerWidget(
|
|
|
|
QWidget *parent,
|
2017-10-31 18:25:22 +00:00
|
|
|
not_null<Controller*> controller);
|
2017-10-04 12:39:59 +00:00
|
|
|
|
|
|
|
bool showInternal(not_null<Memento*> memento);
|
2017-12-05 12:23:08 +00:00
|
|
|
void setIsStackBottom(bool isStackBottom) {
|
|
|
|
_isStackBottom = isStackBottom;
|
|
|
|
setupOtherTypes();
|
|
|
|
}
|
2017-09-13 17:01:23 +00:00
|
|
|
|
|
|
|
void saveState(not_null<Memento*> memento);
|
|
|
|
void restoreState(not_null<Memento*> memento);
|
|
|
|
|
2017-11-14 17:22:44 +00:00
|
|
|
void setScrollHeightValue(rpl::producer<int> value);
|
|
|
|
|
2017-11-21 09:20:56 +00:00
|
|
|
rpl::producer<Ui::ScrollToRequest> scrollToRequests() const;
|
2017-10-20 16:19:42 +00:00
|
|
|
rpl::producer<SelectedItems> selectedListValue() const;
|
2022-02-27 11:14:39 +00:00
|
|
|
void selectionAction(SelectionAction action);
|
2017-10-05 17:32:34 +00:00
|
|
|
|
2017-10-30 19:24:20 +00:00
|
|
|
~InnerWidget();
|
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
protected:
|
|
|
|
int resizeGetHeight(int newWidth) override;
|
|
|
|
void visibleTopBottomUpdated(
|
|
|
|
int visibleTop,
|
|
|
|
int visibleBottom) override;
|
|
|
|
|
|
|
|
private:
|
2017-10-04 12:39:59 +00:00
|
|
|
int recountHeight();
|
|
|
|
void refreshHeight();
|
2017-11-16 09:13:17 +00:00
|
|
|
// Allows showing additional shared media links and tabs.
|
2022-10-12 12:57:17 +00:00
|
|
|
// Used for shared media in Saved Messages.
|
2017-12-05 12:23:08 +00:00
|
|
|
void setupOtherTypes();
|
|
|
|
void createOtherTypes();
|
|
|
|
void createTypeButtons();
|
2017-10-04 12:39:59 +00:00
|
|
|
|
2017-10-31 18:25:22 +00:00
|
|
|
Type type() const;
|
2017-10-04 12:39:59 +00:00
|
|
|
|
2017-10-31 18:25:22 +00:00
|
|
|
object_ptr<ListWidget> setupList();
|
2017-10-04 12:39:59 +00:00
|
|
|
|
2017-10-31 18:25:22 +00:00
|
|
|
const not_null<Controller*> _controller;
|
2017-10-04 12:39:59 +00:00
|
|
|
|
2017-12-05 12:23:08 +00:00
|
|
|
object_ptr<Ui::VerticalLayout> _otherTypes = { nullptr };
|
2017-10-04 12:39:59 +00:00
|
|
|
object_ptr<ListWidget> _list = { nullptr };
|
2017-11-14 17:22:44 +00:00
|
|
|
object_ptr<EmptyWidget> _empty;
|
2017-09-13 17:01:23 +00:00
|
|
|
|
2017-10-31 18:25:22 +00:00
|
|
|
bool _inResize = false;
|
2017-12-05 12:23:08 +00:00
|
|
|
bool _isStackBottom = false;
|
2017-10-31 18:25:22 +00:00
|
|
|
|
2017-11-06 10:00:37 +00:00
|
|
|
rpl::event_stream<Ui::ScrollToRequest> _scrollToRequests;
|
2017-10-20 16:19:42 +00:00
|
|
|
rpl::event_stream<rpl::producer<SelectedItems>> _selectedLists;
|
2017-11-14 17:22:44 +00:00
|
|
|
rpl::event_stream<rpl::producer<int>> _listTops;
|
2017-10-05 17:32:34 +00:00
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Media
|
|
|
|
} // namespace Info
|