20#ifndef LIBREPCB_EDITOR_SYMBOLTAB_H
21#define LIBREPCB_EDITOR_SYMBOLTAB_H
26#include "../../dialogs/graphicsexportdialog.h"
27#include "../../utils/dismissablemessagecontext.h"
28#include "../../utils/lengtheditcontext.h"
29#include "../../widgets/if_graphicsvieweventhandler.h"
30#include "../libraryeditortab.h"
52class CategoryTreeModel;
53class GraphicsLayerList;
55class LibraryElementCategoriesModel;
56class SlintGraphicsView;
58class SymbolGraphicsItem;
83 Mode mode, QObject* parent =
nullptr) noexcept;
88 ui::TabData
getUiData() const noexcept override;
93 void trigger(ui::TabAction a) noexcept override;
95 int scene) noexcept override;
97 const QPointF& pos, slint::private_api::PointerEvent e) noexcept override;
100 slint::private_api::PointerScrollEvent e) noexcept override;
102 const slint::private_api::KeyEvent& e) noexcept override;
126 const
std::optional<Qt::CursorShape>& shape) noexcept override;
132 bool circle) noexcept override;
134 const
Point& pos, qreal multiplier) const noexcept override;
137 int timeoutMs = -1) noexcept override;
168 bool checkOnly) override;
169 template <typename MessageType>
172 template <typename MessageType>
175 bool approved) noexcept override;
182 bool save() noexcept;
185 const QString& settingsKey) noexcept;
238 std::shared_ptr<slint::VectorModel<slint::SharedString>>
The Alignment class.
Definition alignment.h:115
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
This class represents absolute, well-formatted paths to files or directories.
Definition filepath.h:127
The HAlign class.
Definition alignment.h:43
The Layer class provides all supported geometry layers.
Definition layer.h:42
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition lengthunit.h:62
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The RuleCheckMessage class.
Definition rulecheckmessage.h:45
The SExpression class.
Definition sexpression.h:69
The Signal class is used to emit signals on non-QObject derived classes.
Definition signalslot.h:65
The Symbol class represents the part of a component which is added to schematics.
Definition symbol.h:55
Theme class as used by librepcb::WorkspaceSettingsItem_Themes.
Definition theme.h:44
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
The VAlign class.
Definition alignment.h:79
The Version class represents a version number in the format "1.42.7".
Definition version.h:58
The CategoryTreeModel class.
Definition categorytreemodel.h:50
A handle to a optionally dismissable message in the UI.
Definition dismissablemessagecontext.h:53
This class provides a Dialog (GUI) to choose DXF import settings.
Definition graphicsexportdialog.h:61
The GraphicsLayerList class.
Definition graphicslayerlist.h:48
The GraphicsScene class.
Definition graphicsscene.h:64
The IF_GraphicsViewEventHandler class.
Definition if_graphicsvieweventhandler.h:45
Backend configuration for the LengthEdit UI element.
Definition lengtheditcontext.h:49
The LibraryEditor class.
Definition libraryeditor.h:57
Specialized base class for all library editor tabs.
Definition libraryeditortab.h:54
The LibraryElementCategoriesModel class.
Definition libraryelementcategoriesmodel.h:50
The SlintGraphicsView class.
Definition slintgraphicsview.h:51
Interface for the integration of the Symbol editor FSM.
Definition symboleditorfsmadapter.h:61
The SymbolEditorFsm class is the finit state machine (FSM) of the symbol editor.
Definition symboleditorfsm.h:55
The SymbolEditorState_AddNames class.
Definition symboleditorstate_addnames.h:43
The SymbolEditorState_AddPins class.
Definition symboleditorstate_addpins.h:50
The SymbolEditorState_AddValues class.
Definition symboleditorstate_addvalues.h:44
The SymbolEditorState_DrawArc class.
Definition symboleditorstate_drawarc.h:44
The SymbolEditorState_DrawCircle class.
Definition symboleditorstate_drawcircle.h:50
The SymbolEditorState_DrawLine class.
Definition symboleditorstate_drawline.h:44
The SymbolEditorState_DrawPolygon class.
Definition symboleditorstate_drawpolygon.h:44
The SymbolEditorState_DrawRect class.
Definition symboleditorstate_drawrect.h:44
The SymbolEditorState_DrawText class.
Definition symboleditorstate_drawtext.h:43
The SymbolEditorState_Measure class.
Definition symboleditorstate_measure.h:45
The SymbolEditorState_Select class.
Definition symboleditorstate_select.h:56
The SymbolGraphicsItem class.
Definition symbolgraphicsitem.h:56
The SymbolTab class.
Definition symboltab.h:69
slint::Image renderScene(float width, float height, int scene) noexcept override
Definition symboltab.cpp:603
Angle mToolAngle
Definition symboltab.h:234
void autoFix(const MessageType &msg)
PositiveLength fsmGetGridInterval() const noexcept override
Definition symboltab.cpp:702
bool graphicsSceneMouseMoved(const GraphicsSceneMouseEvent &e) noexcept override
Definition symboltab.cpp:664
slint::SharedString mVersionError
Definition symboltab.h:218
std::shared_ptr< LibraryElementCategoriesModel > mCategories
Definition symboltab.h:221
Features mToolFeatures
Definition symboltab.h:225
bool requestClose() noexcept override
Request to close the tab.
Definition symboltab.cpp:627
bool execGraphicsExportDialog(GraphicsExportDialog::Output output, const QString &settingsKey) noexcept
Definition symboltab.cpp:1493
std::optional< std::pair< RuleCheckMessageList, QSet< SExpression > > > runChecksImpl() override
Definition symboltab.cpp:1255
QPointF mSceneImagePos
Definition symboltab.h:207
std::unique_ptr< SlintGraphicsView > mView
Definition symboltab.h:193
PositiveLength mGridInterval
Definition symboltab.h:203
bool save() noexcept
Definition symboltab.cpp:1442
void fsmSetSceneCursor(const Point &pos, bool cross, bool circle) noexcept override
Definition symboltab.cpp:742
void applyTheme() noexcept
Definition symboltab.cpp:1530
bool mToolGrabArea
Definition symboltab.h:236
Alignment mToolAlign
Definition symboltab.h:240
LengthUnit mUnit
Definition symboltab.h:204
bool graphicsSceneRightMouseButtonReleased(const GraphicsSceneMouseEvent &e) noexcept override
Definition symboltab.cpp:685
slint::SharedString mName
Definition symboltab.h:211
void layerRequested(const Layer &layer)
QString mToolValue
Definition symboltab.h:237
int mFrameIndex
Definition symboltab.h:208
bool graphicsSceneLeftMouseButtonDoubleClicked(const GraphicsSceneMouseEvent &e) noexcept override
Definition symboltab.cpp:680
std::unique_ptr< GraphicsLayerList > mLayers
Definition symboltab.h:192
Signal< SymbolTab > onDerivedUiDataChanged
Definition symboltab.h:74
slint::SharedString mDescription
Definition symboltab.h:214
QSet< Uuid > mOriginalSymbolPinUuids
Definition symboltab.h:252
Mode
Definition symboltab.h:77
bool graphicsSceneLeftMouseButtonPressed(const GraphicsSceneMouseEvent &e) noexcept override
Definition symboltab.cpp:670
slint::SharedString mVersion
Definition symboltab.h:217
Theme::GridStyle mGridStyle
Definition symboltab.h:202
std::shared_ptr< slint::VectorModel< slint::SharedString > > mToolValueSuggestions
Definition symboltab.h:239
std::shared_ptr< slint::VectorModel< slint::SharedString > > mToolLayers
Definition symboltab.h:230
GraphicsScene * fsmGetGraphicsScene() noexcept override
Definition symboltab.cpp:694
SymbolGraphicsItem * fsmGetGraphicsItem() noexcept override
Definition symboltab.cpp:698
LengthEditContext mToolSize
Definition symboltab.h:233
bool mWizardMode
Definition symboltab.h:200
bool mDeprecated
Definition symboltab.h:220
ui::SymbolTabData getDerivedUiData() const noexcept
Definition symboltab.cpp:229
void fsmSetViewCursor(const std::optional< Qt::CursorShape > &shape) noexcept override
Definition symboltab.cpp:706
std::unique_ptr< SymbolGraphicsItem > mGraphicsItem
Definition symboltab.h:248
bool processSceneScrolled(const QPointF &pos, slint::private_api::PointerScrollEvent e) noexcept override
Definition symboltab.cpp:617
const bool mIsNewElement
Definition symboltab.h:194
void fsmToolLeave() noexcept override
Definition symboltab.cpp:775
void valueRequested(const QString &value)
void angleRequested(const Angle &angle)
std::unique_ptr< Symbol > mSymbol
Definition symboltab.h:191
void messageApprovalChanged(const SExpression &approval, bool approved) noexcept override
Definition symboltab.cpp:1299
void fsmToolEnter(SymbolEditorState_Select &state) noexcept override
Definition symboltab.cpp:784
bool autoFixImpl(const std::shared_ptr< const RuleCheckMessage > &msg, bool checkOnly) override
Definition symboltab.cpp:1272
bool mCompactLayout
Definition symboltab.h:206
void requestRepaint() noexcept
Definition symboltab.cpp:1525
bool processScenePointerEvent(const QPointF &pos, slint::private_api::PointerEvent e) noexcept override
Definition symboltab.cpp:612
void vAlignRequested(const VAlign &align)
bool graphicsSceneKeyPressed(const GraphicsSceneKeyEvent &e) noexcept override
Definition symboltab.cpp:654
QPainterPath fsmCalcPosWithTolerance(const Point &pos, qreal multiplier) const noexcept override
Definition symboltab.cpp:749
FilePath getDirectoryPath() const noexcept override
Definition symboltab.cpp:186
void hAlignRequested(const HAlign &align)
bool autoFixHelper(const std::shared_ptr< const RuleCheckMessage > &msg, bool checkOnly)
Definition symboltab.cpp:1288
QVector< QMetaObject::Connection > mFsmStateConnections
Editor state machine.
Definition symboltab.h:243
bool processSceneKeyEvent(const slint::private_api::KeyEvent &e) noexcept override
Definition symboltab.cpp:622
Version mVersionParsed
Definition symboltab.h:219
void grabAreaRequested(bool grabArea)
void fsmSetViewGrayOut(bool grayOut) noexcept override
Definition symboltab.cpp:716
std::unique_ptr< SymbolEditorFsm > mFsm
Definition symboltab.h:244
void fsmSetViewRuler(const std::optional< std::pair< Point, Point > > &pos) noexcept override
Definition symboltab.cpp:735
void commitUiData() noexcept
Definition symboltab.cpp:1417
void fsmSetViewInfoBoxText(const QString &text) noexcept override
Definition symboltab.cpp:722
const Layer * mToolLayer
Definition symboltab.h:231
std::unique_ptr< GraphicsScene > mScene
Definition symboltab.h:247
SymbolTab(const SymbolTab &other)=delete
DismissableMessageContext mMsgImportPins
Definition symboltab.h:197
slint::SharedString mNameError
Definition symboltab.h:212
slint::SharedString mKeywords
Definition symboltab.h:215
Qt::CursorShape mToolCursorShape
Definition symboltab.h:227
void fsmSetStatusBarMessage(const QString &message, int timeoutMs=-1) noexcept override
Definition symboltab.cpp:763
Point fsmMapGlobalPosToScenePos(const QPoint &pos) const noexcept override
Definition symboltab.cpp:754
void trigger(ui::TabAction a) noexcept override
Definition symboltab.cpp:392
std::shared_ptr< CategoryTreeModel > mCategoriesTree
Definition symboltab.h:222
void deactivate() noexcept override
Definition symboltab.cpp:387
bool mAddCategoryRequested
Definition symboltab.h:205
void notifyDerivedUiDataChanged() noexcept override
Definition symboltab.cpp:1309
ElementName mNameParsed
Definition symboltab.h:213
slint::SharedString mAuthor
Definition symboltab.h:216
bool isWritable() const noexcept
Definition symboltab.cpp:1387
QString mToolOverlayText
Definition symboltab.h:228
ui::TabData getUiData() const noexcept override
Definition symboltab.cpp:190
bool graphicsSceneKeyReleased(const GraphicsSceneKeyEvent &e) noexcept override
Definition symboltab.cpp:659
bool mToolFilled
Definition symboltab.h:235
int mCurrentPageIndex
Definition symboltab.h:201
void setDerivedUiData(const ui::SymbolTabData &data) noexcept
Definition symboltab.cpp:305
void filledRequested(bool filled)
ui::EditorTool mTool
Definition symboltab.h:226
void fsmSetFeatures(Features features) noexcept override
Definition symboltab.cpp:768
LengthEditContext mToolLineWidth
Definition symboltab.h:232
void setGridInterval(const PositiveLength &interval) noexcept
Definition symboltab.cpp:1482
void refreshUiData() noexcept
Definition symboltab.cpp:1391
bool graphicsSceneLeftMouseButtonReleased(const GraphicsSceneMouseEvent &e) noexcept override
Definition symboltab.cpp:675
QVector< const Layer * > mToolLayersQt
Definition symboltab.h:229
void activate() noexcept override
Definition symboltab.cpp:374
bool mIsInterfaceBroken
Broken interface detection.
Definition symboltab.h:251
Definition occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810
QVector< std::shared_ptr< const RuleCheckMessage > > RuleCheckMessageList
Definition rulecheckmessage.h:104
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition elementname.h:84
Definition graphicsscene.h:52
Definition graphicsscene.h:45