LibrePCB Developers Documentation
circuitidentifierimportdialog.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_EDITOR_CIRCUITIDENTIFIERIMPORTDIALOG_H
21#define LIBREPCB_EDITOR_CIRCUITIDENTIFIERIMPORTDIALOG_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29#include <QtWidgets>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35namespace editor {
36
37namespace Ui {
38class CircuitIdentifierImportDialog;
39}
40
41/*******************************************************************************
42 * Class CircuitIdentifierImportDialog
43 ******************************************************************************/
44
48class CircuitIdentifierImportDialog final : public QDialog {
49 Q_OBJECT
50
51public:
52 // Constructors / Destructor
55 delete;
56 CircuitIdentifierImportDialog(const QString& settingsPrefix,
57 QWidget* parent = nullptr) noexcept;
59
60 // Getters
61 const QList<CircuitIdentifier>& getValues() const noexcept { return mValues; }
62
63 // Operator Overloadings
65 const CircuitIdentifierImportDialog& rhs) = delete;
66
67private: // Methods
68 void updatePlaceholder() noexcept;
69 void checkClipboard() noexcept;
70 void parseInput() noexcept;
71 void autoDetectFilterColumn(const QStringList& lines) noexcept;
72 bool columnContainsOnlyNumbers(const QList<QStringList>& data,
73 int col) const noexcept;
74
75private: // Data
77 const QString mSettingsPrefix;
78 const QRegularExpression mSpaceRegex;
82};
83
84/*******************************************************************************
85 * End of File
86 ******************************************************************************/
87
88} // namespace editor
89} // namespace librepcb
90
91#endif
The CircuitIdentifierImportDialog class.
Definition: circuitidentifierimportdialog.h:48
void updatePlaceholder() noexcept
Definition: circuitidentifierimportdialog.cpp:118
CircuitIdentifierImportDialog(const CircuitIdentifierImportDialog &other)=delete
const QList< CircuitIdentifier > & getValues() const noexcept
Definition: circuitidentifierimportdialog.h:61
void autoDetectFilterColumn(const QStringList &lines) noexcept
Definition: circuitidentifierimportdialog.cpp:250
const QRegularExpression mSpaceRegex
Definition: circuitidentifierimportdialog.h:78
bool columnContainsOnlyNumbers(const QList< QStringList > &data, int col) const noexcept
Definition: circuitidentifierimportdialog.cpp:276
CircuitIdentifierImportDialog & operator=(const CircuitIdentifierImportDialog &rhs)=delete
QList< CircuitIdentifier > mValues
Definition: circuitidentifierimportdialog.h:79
int mFilterColumnIndex
Definition: circuitidentifierimportdialog.h:81
const QString mSettingsPrefix
Definition: circuitidentifierimportdialog.h:77
QScopedPointer< Ui::CircuitIdentifierImportDialog > mUi
Definition: circuitidentifierimportdialog.h:76
QString mLastClipboardValue
Definition: circuitidentifierimportdialog.h:80
void parseInput() noexcept
Definition: circuitidentifierimportdialog.cpp:160
void checkClipboard() noexcept
Definition: circuitidentifierimportdialog.cpp:148
Definition: occmodel.cpp:77
type_safe::constrained_type< QString, CircuitIdentifierConstraint, CircuitIdentifierVerifier > CircuitIdentifier
Definition: circuitidentifier.h:96