LibrePCB Developers Documentation
overlinemarkupparser.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_CORE_OVERLINEMARKUPPARSER_H
21#define LIBREPCB_CORE_OVERLINEMARKUPPARSER_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include <QtCore>
27#include <QtGui>
28
29/*******************************************************************************
30 * Namespace / Forward Declarations
31 ******************************************************************************/
32namespace librepcb {
33
34/*******************************************************************************
35 * Class OverlineMarkupParser
36 ******************************************************************************/
37
56 Q_DECLARE_TR_FUNCTIONS(OverlineMarkupParser)
57
58public:
59 // Constructors / Destructor
62
63 // General Methods
64 static QVector<std::pair<int, int>> extract(const QString& input,
65 QString& output) noexcept;
66 static QVector<QLineF> calculate(const QString& text, const QFontMetricsF& fm,
67 int flags,
68 const QVector<std::pair<int, int>>& spans,
69 QRectF& boundingRect) noexcept;
70 static void process(const QString& input, const QFontMetricsF& fm, int flags,
71 QString& output, QVector<QLineF>& overlines,
72 QRectF& boundingRect) noexcept;
73 static qreal getLineWidth(qreal heightPx) noexcept;
74
75 // Operator Overloadings
77};
78
79/*******************************************************************************
80 * End of File
81 ******************************************************************************/
82
83} // namespace librepcb
84
85#endif
Extract overlines of text with markup.
Definition: overlinemarkupparser.h:55
static qreal getLineWidth(qreal heightPx) noexcept
Definition: overlinemarkupparser.cpp:120
static void process(const QString &input, const QFontMetricsF &fm, int flags, QString &output, QVector< QLineF > &overlines, QRectF &boundingRect) noexcept
Definition: overlinemarkupparser.cpp:112
static QVector< QLineF > calculate(const QString &text, const QFontMetricsF &fm, int flags, const QVector< std::pair< int, int > > &spans, QRectF &boundingRect) noexcept
Definition: overlinemarkupparser.cpp:92
static QVector< std::pair< int, int > > extract(const QString &input, QString &output) noexcept
Definition: overlinemarkupparser.cpp:36
OverlineMarkupParser & operator=(const OverlineMarkupParser &rhs)=delete
OverlineMarkupParser(const OverlineMarkupParser &other)=delete
Definition: occmodel.cpp:77