layout_item_base.h 829 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "layout/abstract_layout_item.h"
  9. namespace HistoryView {
  10. struct TextState;
  11. struct StateRequest;
  12. } // namespace HistoryView
  13. class LayoutItemBase : public AbstractLayoutItem {
  14. public:
  15. using TextState = HistoryView::TextState;
  16. using StateRequest = HistoryView::StateRequest;
  17. using AbstractLayoutItem::AbstractLayoutItem;
  18. virtual void initDimensions() = 0;
  19. [[nodiscard]] virtual TextState getState(
  20. QPoint point,
  21. StateRequest request) const;
  22. [[nodiscard]] virtual TextSelection adjustSelection(
  23. TextSelection selection,
  24. TextSelectType type) const;
  25. };