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;
127 const
std::optional<Qt::CursorShape>& shape) noexcept override;
133 bool circle) noexcept override;
135 const
Point& pos, qreal multiplier) const noexcept override;
138 int timeoutMs = -1) noexcept override;
172 bool checkOnly) override;
173 template <typename MessageType>
176 template <typename MessageType>
179 bool approved) noexcept override;
186 bool save() noexcept;
191 const QString& settingsKey) noexcept;
243 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 Image class.
Definition image.h:49
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:56
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:56
Specialized base class for all library editor tabs.
Definition libraryeditortab.h:55
The LibraryElementCategoriesModel class.
Definition libraryelementcategoriesmodel.h:50
The SlintGraphicsView class.
Definition slintgraphicsview.h:52
Interface for the integration of the Symbol editor FSM.
Definition symboleditorfsmadapter.h:62
The SymbolEditorFsm class is the finit state machine (FSM) of the symbol editor.
Definition symboleditorfsm.h:58
The SymbolEditorState_AddImage class.
Definition symboleditorstate_addimage.h:50
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:58
The SymbolGraphicsItem class.
Definition symbolgraphicsitem.h:55
The SymbolTab class.
Definition symboltab.h:69
slint::Image renderScene(float width, float height, int scene) noexcept override
Definition symboltab.cpp:639
Angle mToolAngle
Definition symboltab.h:239
PositiveLength fsmGetGridInterval() const noexcept override
Definition symboltab.cpp:742
bool graphicsSceneMouseMoved(const GraphicsSceneMouseEvent &e) noexcept override
Definition symboltab.cpp:700
slint::SharedString mVersionError
Definition symboltab.h:223
std::shared_ptr< LibraryElementCategoriesModel > mCategories
Definition symboltab.h:226
Features mToolFeatures
Definition symboltab.h:230
bool requestClose() noexcept override
Request to close the tab.
Definition symboltab.cpp:663
bool execGraphicsExportDialog(GraphicsExportDialog::Output output, const QString &settingsKey) noexcept
Definition symboltab.cpp:1595
std::optional< std::pair< RuleCheckMessageList, QSet< SExpression > > > runChecksImpl() override
Definition symboltab.cpp:1323
QPointF mSceneImagePos
Definition symboltab.h:212
std::unique_ptr< SlintGraphicsView > mView
Definition symboltab.h:199
bool save() noexcept
Definition symboltab.cpp:1529
void fsmSetSceneCursor(const Point &pos, bool cross, bool circle) noexcept override
Definition symboltab.cpp:782
void applyTheme() noexcept
Definition symboltab.cpp:1632
bool mToolGrabArea
Definition symboltab.h:241
Alignment mToolAlign
Definition symboltab.h:245
LengthUnit mUnit
Definition symboltab.h:209
bool graphicsSceneRightMouseButtonReleased(const GraphicsSceneMouseEvent &e) noexcept override
Definition symboltab.cpp:721
slint::SharedString mName
Definition symboltab.h:216
void layerRequested(const Layer &layer)
void memorizeInterface() noexcept
Definition symboltab.cpp:1570
QString mToolValue
Definition symboltab.h:242
int mFrameIndex
Definition symboltab.h:213
bool graphicsSceneLeftMouseButtonDoubleClicked(const GraphicsSceneMouseEvent &e) noexcept override
Definition symboltab.cpp:716
std::unique_ptr< GraphicsLayerList > mLayers
Definition symboltab.h:198
Signal< SymbolTab > onDerivedUiDataChanged
Definition symboltab.h:74
slint::SharedString mDescription
Definition symboltab.h:219
QSet< Uuid > mOriginalSymbolPinUuids
Definition symboltab.h:257
Mode
Definition symboltab.h:77
bool graphicsSceneLeftMouseButtonPressed(const GraphicsSceneMouseEvent &e) noexcept override
Definition symboltab.cpp:706
QWidget * fsmGetParentWidget() noexcept override
Definition symboltab.cpp:730
slint::SharedString mVersion
Definition symboltab.h:222
Theme::GridStyle mGridStyle
Definition symboltab.h:208
std::shared_ptr< slint::VectorModel< slint::SharedString > > mToolValueSuggestions
Definition symboltab.h:244
void watchedFilesModifiedChanged() noexcept override
Definition symboltab.cpp:1302
std::shared_ptr< slint::VectorModel< slint::SharedString > > mToolLayers
Definition symboltab.h:235
GraphicsScene * fsmGetGraphicsScene() noexcept override
Definition symboltab.cpp:734
SymbolGraphicsItem * fsmGetGraphicsItem() noexcept override
Definition symboltab.cpp:738
LengthEditContext mToolSize
Definition symboltab.h:238
bool mWizardMode
Definition symboltab.h:206
bool mDeprecated
Definition symboltab.h:225
ui::SymbolTabData getDerivedUiData() const noexcept
Definition symboltab.cpp:243
void fsmSetViewCursor(const std::optional< Qt::CursorShape > &shape) noexcept override
Definition symboltab.cpp:746
std::unique_ptr< SymbolGraphicsItem > mGraphicsItem
Definition symboltab.h:253
bool processSceneScrolled(const QPointF &pos, slint::private_api::PointerScrollEvent e) noexcept override
Definition symboltab.cpp:653
const bool mIsNewElement
Definition symboltab.h:200
void fsmToolLeave() noexcept override
Definition symboltab.cpp:816
void valueRequested(const QString &value)
void angleRequested(const Angle &angle)
std::unique_ptr< Symbol > mSymbol
Definition symboltab.h:197
void messageApprovalChanged(const SExpression &approval, bool approved) noexcept override
Definition symboltab.cpp:1370
void fsmToolEnter(SymbolEditorState_Select &state) noexcept override
Definition symboltab.cpp:825
void reloadFromDisk() override
Definition symboltab.cpp:1306
bool autoFixImpl(const std::shared_ptr< const RuleCheckMessage > &msg, bool checkOnly) override
Definition symboltab.cpp:1340
bool mCompactLayout
Definition symboltab.h:211
void requestRepaint() noexcept
Definition symboltab.cpp:1627
bool processScenePointerEvent(const QPointF &pos, slint::private_api::PointerEvent e) noexcept override
Definition symboltab.cpp:648
void vAlignRequested(const VAlign &align)
bool graphicsSceneKeyPressed(const GraphicsSceneKeyEvent &e) noexcept override
Definition symboltab.cpp:690
QPainterPath fsmCalcPosWithTolerance(const Point &pos, qreal multiplier) const noexcept override
Definition symboltab.cpp:789
FilePath getDirectoryPath() const noexcept override
Definition symboltab.cpp:200
void hAlignRequested(const HAlign &align)
bool autoFixHelper(const std::shared_ptr< const RuleCheckMessage > &msg, bool checkOnly)
Definition symboltab.cpp:1356
QVector< QMetaObject::Connection > mFsmStateConnections
Editor state machine.
Definition symboltab.h:248
bool processSceneKeyEvent(const slint::private_api::KeyEvent &e) noexcept override
Definition symboltab.cpp:658
Version mVersionParsed
Definition symboltab.h:224
void grabAreaRequested(bool grabArea)
void fsmSetViewGrayOut(bool grayOut) noexcept override
Definition symboltab.cpp:756
std::unique_ptr< SymbolEditorFsm > mFsm
Definition symboltab.h:249
void fsmSetViewRuler(const std::optional< std::pair< Point, Point > > &pos) noexcept override
Definition symboltab.cpp:775
void commitUiData() noexcept
Definition symboltab.cpp:1498
bool autoFix(const MessageType &msg)
void fsmSetViewInfoBoxText(const QString &text) noexcept override
Definition symboltab.cpp:762
const Layer * mToolLayer
Definition symboltab.h:236
std::unique_ptr< GraphicsScene > mScene
Definition symboltab.h:252
SymbolTab(const SymbolTab &other)=delete
DismissableMessageContext mMsgImportPins
Definition symboltab.h:203
slint::SharedString mNameError
Definition symboltab.h:217
slint::SharedString mKeywords
Definition symboltab.h:220
Qt::CursorShape mToolCursorShape
Definition symboltab.h:232
void fsmSetStatusBarMessage(const QString &message, int timeoutMs=-1) noexcept override
Definition symboltab.cpp:804
Point fsmMapGlobalPosToScenePos(const QPoint &pos) const noexcept override
Definition symboltab.cpp:794
void trigger(ui::TabAction a) noexcept override
Definition symboltab.cpp:409
std::shared_ptr< CategoryTreeModel > mCategoriesTree
Definition symboltab.h:227
void deactivate() noexcept override
Definition symboltab.cpp:404
void notifyDerivedUiDataChanged() noexcept override
Definition symboltab.cpp:1380
bool mChooseCategory
Definition symboltab.h:210
ElementName mNameParsed
Definition symboltab.h:218
slint::SharedString mAuthor
Definition symboltab.h:221
bool isWritable() const noexcept
Definition symboltab.cpp:1468
QString mToolOverlayText
Definition symboltab.h:233
ui::TabData getUiData() const noexcept override
Definition symboltab.cpp:204
bool graphicsSceneKeyReleased(const GraphicsSceneKeyEvent &e) noexcept override
Definition symboltab.cpp:695
void updateWatchedFiles() noexcept
Definition symboltab.cpp:1574
bool mToolFilled
Definition symboltab.h:240
int mCurrentPageIndex
Definition symboltab.h:207
void setDerivedUiData(const ui::SymbolTabData &data) noexcept
Definition symboltab.cpp:321
void filledRequested(bool filled)
ui::EditorTool mTool
Definition symboltab.h:231
void fsmSetFeatures(Features features) noexcept override
Definition symboltab.cpp:809
LengthEditContext mToolLineWidth
Definition symboltab.h:237
void setGridInterval(const PositiveLength &interval) noexcept
Definition symboltab.cpp:1582
void refreshUiData() noexcept
Definition symboltab.cpp:1472
bool graphicsSceneLeftMouseButtonReleased(const GraphicsSceneMouseEvent &e) noexcept override
Definition symboltab.cpp:711
QVector< const Layer * > mToolLayersQt
Definition symboltab.h:234
void activate() noexcept override
Definition symboltab.cpp:390
bool mIsInterfaceBroken
Broken interface detection.
Definition symboltab.h:256
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