LeechCraft Monocle 0.6.70-17335-ge406ffdcaf
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 <QtPlugin>
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
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
63Q_DECLARE_INTERFACE (LC::Monocle::IHaveTextContent,
64 "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_