2015-12-20 17:05:07 +03:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 13:23:14 +03:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2015-12-20 17:05:07 +03:00
|
|
|
|
2018-01-03 13:23:14 +03:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2015-12-20 17:05:07 +03:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2021-07-26 01:01:00 +03:00
|
|
|
#include "layout/abstract_layout_item.h"
|
2016-09-29 14:37:16 +03:00
|
|
|
|
2018-01-27 16:59:24 +03:00
|
|
|
namespace HistoryView {
|
|
|
|
struct TextState;
|
|
|
|
struct StateRequest;
|
|
|
|
} // namespace HistoryView
|
2018-01-11 22:33:26 +03:00
|
|
|
|
2021-07-26 01:01:00 +03:00
|
|
|
class LayoutItemBase : public AbstractLayoutItem {
|
2015-12-20 17:05:07 +03:00
|
|
|
public:
|
2018-01-27 16:59:24 +03:00
|
|
|
using TextState = HistoryView::TextState;
|
|
|
|
using StateRequest = HistoryView::StateRequest;
|
|
|
|
|
2021-07-26 01:01:00 +03:00
|
|
|
using AbstractLayoutItem::AbstractLayoutItem;
|
2015-12-20 17:05:07 +03:00
|
|
|
|
|
|
|
virtual void initDimensions() = 0;
|
|
|
|
|
2018-01-27 16:59:24 +03:00
|
|
|
[[nodiscard]] virtual TextState getState(
|
2018-01-11 22:33:26 +03:00
|
|
|
QPoint point,
|
2018-01-27 16:59:24 +03:00
|
|
|
StateRequest request) const;
|
2017-10-13 22:07:04 +03:00
|
|
|
[[nodiscard]] virtual TextSelection adjustSelection(
|
2018-01-11 22:33:26 +03:00
|
|
|
TextSelection selection,
|
|
|
|
TextSelectType type) const;
|
2015-12-20 17:05:07 +03:00
|
|
|
|
2016-04-05 01:09:46 +04:00
|
|
|
};
|