libquentier 0.8.0
The library for rich desktop clients of Evernote service
Loading...
Searching...
No Matches
ResourceRecognitionIndexItem.h
1/*
2 * Copyright 2016-2024 Dmitry Ivanov
3 *
4 * This file is part of libquentier
5 *
6 * libquentier is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, version 3 of the License.
9 *
10 * libquentier is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with libquentier. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#pragma once
20
21#include <quentier/utility/Linkage.h>
22#include <quentier/utility/Printable.h>
23
24#include <QByteArray>
25#include <QList>
26#include <QSharedDataPointer>
27
28#include <memory>
29
30namespace quentier {
31
32class ResourceRecognitionIndexItemData;
33
35{
36public:
38
40
43
46
49
51
52 [[nodiscard]] bool isValid() const;
53
54 [[nodiscard]] int x() const;
55 void setX(int x);
56
57 [[nodiscard]] int y() const;
58 void setY(int y);
59
60 [[nodiscard]] int h() const;
61 void setH(int h);
62
63 [[nodiscard]] int w() const;
64 void setW(int w);
65
66 [[nodiscard]] int offset() const;
67 void setOffset(int offset);
68
69 [[nodiscard]] int duration() const;
70 void setDuration(int duration);
71
72 [[nodiscard]] QList<int> strokes() const;
73 void setStrokes(QList<int> strokes);
74
76 {
77 virtual ~ITextItem();
78
79 [[nodiscard]] virtual QString text() const = 0;
80 [[nodiscard]] virtual int weight() const = 0;
81 };
82
83 using ITextItemPtr = std::shared_ptr<ITextItem>;
84
85 [[nodiscard]] QList<ITextItemPtr> textItems() const;
86 void setTextItems(QList<ITextItemPtr> textItems);
87
89 {
90 virtual ~IObjectItem();
91
92 [[nodiscard]] virtual QString objectType() const = 0;
93 [[nodiscard]] virtual int weight() const = 0;
94 };
95
96 using IObjectItemPtr = std::shared_ptr<IObjectItem>;
97
98 [[nodiscard]] QList<IObjectItemPtr> objectItems() const;
99 void setObjectItems(QList<IObjectItemPtr> objectItems);
100
102 {
103 virtual ~IShapeItem();
104
105 [[nodiscard]] virtual QString shape() const = 0;
106 [[nodiscard]] virtual int weight() const = 0;
107 };
108
109 using IShapeItemPtr = std::shared_ptr<IShapeItem>;
110
111 [[nodiscard]] QList<IShapeItemPtr> shapeItems() const;
112 void setShapeItems(QList<IShapeItemPtr> shapeItems);
113
115 {
116 virtual ~IBarcodeItem();
117
118 [[nodiscard]] virtual QString barcode() const = 0;
119 [[nodiscard]] virtual int weight() const = 0;
120 };
121
122 using IBarcodeItemPtr = std::shared_ptr<IBarcodeItem>;
123
124 [[nodiscard]] QList<IBarcodeItemPtr> barcodeItems() const;
125 void setBarcodeItems(QList<IBarcodeItemPtr> barcodeItems);
126
127 QTextStream & print(QTextStream & strm) const override;
128
129private:
131};
132
133} // namespace quentier
The Printable class is the interface for Quentier's internal classes which should be able to write th...
Definition Printable.h:38
Definition ResourceRecognitionIndexItem.h:35
The Result template class represents the bare bones result monad implementation which either contains...
Definition Result.h:38
bool isValid() const noexcept
Definition Result.h:87
Definition ResourceRecognitionIndexItem.h:115
Definition ResourceRecognitionIndexItem.h:89
Definition ResourceRecognitionIndexItem.h:102
Definition ResourceRecognitionIndexItem.h:76