LeechCraft Monocle  0.6.70-18450-gabe19ee3b0
Modular document viewer for LeechCraft
ihavetextcontent.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #pragma once
10 
11 #include <QtPlugin>
12 #include "coordsbase.h"
13 
14 class QString;
15 
16 namespace LC::Monocle
17 {
18  enum class NextSpaceKind : std::uint8_t
19  {
20  None,
21  Space,
22  NewLine,
23  NewPara,
24  };
25 
26  struct TextBox
27  {
28  QString Text_;
31 
32  std::optional<QVector<PageRelativeRectBase>> Letters_ {};
33  };
34 
41  {
42  protected:
43  virtual ~IHaveTextContent () = default;
44  public:
56  virtual QString GetTextContent (int page, const PageRelativeRectBase& rect) = 0;
57 
58  virtual QVector<TextBox> GetTextBoxes (int page) = 0;
59  };
60 }
61 
62 
63 Q_DECLARE_INTERFACE (LC::Monocle::IHaveTextContent,
64  "org.LeechCraft.Monocle.IHaveTextContent/1.0")
virtual ~IHaveTextContent()=default
virtual QString GetTextContent(int page, const PageRelativeRectBase &rect)=0
Returns the text in the given rectangle.
virtual QVector< TextBox > GetTextBoxes(int page)=0
Interface for documents supporting querying text contents.
PageRelativeRectBase Rect_
std::optional< QVector< PageRelativeRectBase > > Letters_
NextSpaceKind NextSpaceKind_