2018-01-11 19:33:26 +00:00
|
|
|
/*
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
#include "history/view/history_view_cursor_state.h"
|
|
|
|
|
|
|
|
#include "history/history_item.h"
|
2018-01-14 16:02:25 +00:00
|
|
|
#include "history/view/history_view_element.h"
|
2018-01-11 19:33:26 +00:00
|
|
|
|
2018-01-27 13:59:24 +00:00
|
|
|
namespace HistoryView {
|
|
|
|
|
|
|
|
TextState::TextState(not_null<const HistoryItem*> item)
|
2018-01-11 19:33:26 +00:00
|
|
|
: itemId(item->fullId()) {
|
|
|
|
}
|
|
|
|
|
2018-01-27 13:59:24 +00:00
|
|
|
TextState::TextState(
|
2018-01-11 19:33:26 +00:00
|
|
|
not_null<const HistoryItem*> item,
|
|
|
|
const Text::StateResult &state)
|
|
|
|
: itemId(item->fullId())
|
|
|
|
, cursor(state.uponSymbol
|
2018-01-27 13:59:24 +00:00
|
|
|
? CursorState::Text
|
|
|
|
: CursorState::None)
|
2018-01-11 19:33:26 +00:00
|
|
|
, link(state.link)
|
|
|
|
, afterSymbol(state.afterSymbol)
|
|
|
|
, symbol(state.symbol) {
|
|
|
|
}
|
|
|
|
|
2018-01-27 13:59:24 +00:00
|
|
|
TextState::TextState(
|
2018-01-11 19:33:26 +00:00
|
|
|
not_null<const HistoryItem*> item,
|
|
|
|
ClickHandlerPtr link)
|
|
|
|
: itemId(item->fullId())
|
|
|
|
, link(link) {
|
|
|
|
}
|
2018-01-14 16:02:25 +00:00
|
|
|
|
2018-01-27 13:59:24 +00:00
|
|
|
TextState::TextState(
|
2018-01-14 16:02:25 +00:00
|
|
|
not_null<const HistoryView::Element*> view)
|
2018-01-27 13:59:24 +00:00
|
|
|
: TextState(view->data()) {
|
2018-01-14 16:02:25 +00:00
|
|
|
}
|
|
|
|
|
2018-01-27 13:59:24 +00:00
|
|
|
TextState::TextState(
|
2018-01-14 16:02:25 +00:00
|
|
|
not_null<const HistoryView::Element*> view,
|
|
|
|
const Text::StateResult &state)
|
2018-01-27 13:59:24 +00:00
|
|
|
: TextState(view->data(), state) {
|
2018-01-14 16:02:25 +00:00
|
|
|
}
|
|
|
|
|
2018-01-27 13:59:24 +00:00
|
|
|
TextState::TextState(
|
2018-01-14 16:02:25 +00:00
|
|
|
not_null<const HistoryView::Element*> view,
|
|
|
|
ClickHandlerPtr link)
|
2018-01-27 13:59:24 +00:00
|
|
|
: TextState(view->data(), link) {
|
2018-01-14 16:02:25 +00:00
|
|
|
}
|
2018-01-27 13:59:24 +00:00
|
|
|
|
|
|
|
TextState::TextState(
|
|
|
|
std::nullptr_t,
|
|
|
|
const Text::StateResult &state)
|
|
|
|
: cursor(state.uponSymbol
|
|
|
|
? CursorState::Text
|
|
|
|
: CursorState::None)
|
|
|
|
, link(state.link)
|
|
|
|
, afterSymbol(state.afterSymbol)
|
|
|
|
, symbol(state.symbol) {
|
|
|
|
}
|
|
|
|
|
|
|
|
TextState::TextState(std::nullptr_t, ClickHandlerPtr link)
|
|
|
|
: link(link) {
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace HistoryView
|