LibrePCB Developers Documentation
stroketextspacing.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_STROKETEXTSPACING_H
21 #define LIBREPCB_CORE_STROKETEXTSPACING_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "ratio.h"
27 
28 #include <optional/tl/optional.hpp>
29 
30 #include <QtCore>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 
37 /*******************************************************************************
38  * Class StrokeTextSpacing
39  ******************************************************************************/
40 
44 class StrokeTextSpacing final {
45  Q_DECLARE_TR_FUNCTIONS(StrokeTextSpacing)
46 
47 public:
48  // Constructors / Destructor
49  StrokeTextSpacing(const tl::optional<Ratio>& ratio = tl::nullopt) noexcept;
50  StrokeTextSpacing(const StrokeTextSpacing& other) noexcept;
51  ~StrokeTextSpacing() noexcept;
52 
53  // Getters
54  const tl::optional<Ratio>& getRatio() const noexcept { return mRatio; }
55 
56  // Operator Overloadings
57  bool operator==(const StrokeTextSpacing& rhs) const noexcept;
58  bool operator!=(const StrokeTextSpacing& rhs) const noexcept {
59  return !(*this == rhs);
60  }
61  StrokeTextSpacing& operator=(const StrokeTextSpacing& rhs) noexcept;
62 
63 private: // Data
64  tl::optional<Ratio> mRatio;
65 };
66 
67 /*******************************************************************************
68  * End of File
69  ******************************************************************************/
70 
71 } // namespace librepcb
72 
73 #endif
Definition: occmodel.cpp:76
const tl::optional< Ratio > & getRatio() const noexcept
Definition: stroketextspacing.h:54
tl::optional< Ratio > mRatio
nullopt means automatic (from font)
Definition: stroketextspacing.h:64
~StrokeTextSpacing() noexcept
Definition: stroketextspacing.cpp:68
Represents the letter- or line spacing configuration of a stroke text.
Definition: stroketextspacing.h:44
StrokeTextSpacing & operator=(const StrokeTextSpacing &rhs) noexcept
Definition: stroketextspacing.cpp:80
bool operator!=(const StrokeTextSpacing &rhs) const noexcept
Definition: stroketextspacing.h:58
bool operator==(const StrokeTextSpacing &rhs) const noexcept
Definition: stroketextspacing.cpp:75
StrokeTextSpacing(const tl::optional< Ratio > &ratio=tl::nullopt) noexcept
Definition: stroketextspacing.cpp:60