LeechCraft Monocle 0.6.70-19424-g027e980fd1
Modular document viewer for LeechCraft
Loading...
Searching...
No Matches
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 <QObject>
12#include "coordsbase.h"
13
14class QString;
15
16namespace LC::Monocle
17{
18 enum class NextSpaceKind : std::uint8_t
19 {
24 };
25
26 struct TextBox
27 {
28 QString Text_;
31
37 std::optional<QVector<PageRelativeRectBase>> Letters_ {};
38 };
39
46 {
47 protected:
48 virtual ~IHaveTextContent () = default;
49 public:
61 virtual QString GetTextContent (int page, const PageRelativeRectBase& rect) = 0;
62
63 virtual QVector<TextBox> GetTextBoxes (int page) = 0;
64 };
65}
66
67
68Q_DECLARE_INTERFACE (LC::Monocle::IHaveTextContent,
69 "org.LeechCraft.Monocle.IHaveTextContent/1.0")
Interface for documents supporting querying text contents.
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
NextSpaceKind NextSpaceKind_
PageRelativeRectBase Rect_
std::optional< QVector< PageRelativeRectBase > > Letters_
One rect per QChar of Text_.