LibrePCB Developers Documentation
Loading...
Searching...
No Matches
ComponentTab Class Referencefinal

The ComponentTab class. More...

#include <componenttab.h>

+ Inheritance diagram for ComponentTab:
+ Collaboration diagram for ComponentTab:

Public Types

enum class  Mode
 

Public Member Functions

 ComponentTab ()=delete
 
 ComponentTab (const ComponentTab &other)=delete
 
 ComponentTab (LibraryEditor &editor, std::unique_ptr< Component > cmp, Mode mode, QObject *parent=nullptr) noexcept
 
 ~ComponentTab () noexcept
 
FilePath getDirectoryPath () const noexcept override
 
ui::TabData getUiData () const noexcept override
 
ui::ComponentTabData getDerivedUiData () const noexcept
 
void setDerivedUiData (const ui::ComponentTabData &data) noexcept
 
void trigger (ui::TabAction a) noexcept override
 
slint::Image renderScene (float width, float height, int scene) noexcept override
 
bool requestClose () noexcept override
 Request to close the tab.
 
ComponentTaboperator= (const ComponentTab &rhs)=delete
 
template<>
bool autoFix (const MsgNameNotTitleCase &msg)
 
template<>
bool autoFix (const MsgMissingAuthor &msg)
 
template<>
bool autoFix (const MsgMissingCategories &msg)
 
template<>
bool autoFix (const MsgMissingComponentDefaultValue &msg)
 
template<>
bool autoFix (const MsgMissingSymbolVariant &msg)
 
template<>
bool autoFix (const MsgNonFunctionalComponentSignalInversionSign &msg)
 
- Public Member Functions inherited from LibraryEditorTab
 LibraryEditorTab ()=delete
 
 LibraryEditorTab (const LibraryEditorTab &other)=delete
 
 LibraryEditorTab (LibraryEditor &editor, QObject *parent=nullptr) noexcept
 
virtual ~LibraryEditorTab () noexcept
 
LibraryEditorTaboperator= (const LibraryEditorTab &rhs)=delete
 
- Public Member Functions inherited from WindowTab
 WindowTab ()=delete
 
 WindowTab (const WindowTab &other)=delete
 
 WindowTab (GuiApplication &app, QObject *parent=nullptr) noexcept
 
virtual ~WindowTab () noexcept
 
virtual void setWindow (MainWindow *w) noexcept
 
virtual void setUiData (const ui::TabData &data) noexcept
 
virtual void activate () noexcept
 
virtual void deactivate () noexcept
 
virtual bool processScenePointerEvent (const QPointF &pos, slint::private_api::PointerEvent e) noexcept
 
virtual bool processSceneScrolled (const QPointF &pos, slint::private_api::PointerScrollEvent e) noexcept
 
virtual bool processSceneKeyEvent (const slint::private_api::KeyEvent &e) noexcept
 
WindowTaboperator= (const WindowTab &rhs)=delete
 

Public Attributes

Signal< ComponentTabonDerivedUiDataChanged
 
- Public Attributes inherited from WindowTab
Signal< WindowTabonUiDataChanged
 

Protected Member Functions

std::optional< std::pair< RuleCheckMessageList, QSet< SExpression > > > runChecksImpl () override
 
bool autoFixImpl (const std::shared_ptr< const RuleCheckMessage > &msg, bool checkOnly) override
 
template<typename MessageType >
bool autoFixHelper (const std::shared_ptr< const RuleCheckMessage > &msg, bool checkOnly)
 
template<typename MessageType >
bool autoFix (const MessageType &msg)
 
void messageApprovalChanged (const SExpression &approval, bool approved) noexcept override
 
void notifyDerivedUiDataChanged () noexcept override
 
- Protected Member Functions inherited from LibraryEditorTab
bool isPathOutsideLibDir () const noexcept
 
bool hasUnsavedChanges () const noexcept
 
void setWatchedFiles (const TransactionalDirectory &dir, const QSet< QString > &filenames) noexcept
 
virtual void watchedFilesModifiedChanged () noexcept
 
virtual void reloadFromDisk ()
 
void scheduleChecks () noexcept
 
void runChecks () noexcept
 
QString getWorkspaceSettingsUserName () const noexcept
 
- Protected Member Functions inherited from WindowTab
QWidget * getWindow () const noexcept
 

Private Member Functions

bool isWritable () const noexcept
 
bool isInterfaceBroken () const noexcept
 
void refreshUiData () noexcept
 
void commitUiData () noexcept
 
bool save () noexcept
 

Private Attributes

std::unique_ptr< ComponentmComponent
 
const bool mIsNewElement
 
bool mWizardMode
 
int mCurrentPageIndex
 
bool mChooseCategory
 
slint::SharedString mName
 
slint::SharedString mNameError
 
ElementName mNameParsed
 
slint::SharedString mDescription
 
slint::SharedString mKeywords
 
slint::SharedString mAuthor
 
slint::SharedString mVersion
 
slint::SharedString mVersionError
 
Version mVersionParsed
 
bool mDeprecated
 
std::shared_ptr< LibraryElementCategoriesModelmCategories
 
std::shared_ptr< CategoryTreeModelmCategoriesTree
 
slint::SharedString mDatasheetUrl
 
slint::SharedString mDatasheetUrlError
 
bool mSchematicOnly
 
slint::SharedString mPrefix
 
slint::SharedString mPrefixError
 
ComponentPrefix mPrefixParsed
 
slint::SharedString mDefaultValue
 
slint::SharedString mDefaultValueError
 
std::shared_ptr< AttributeListModelmAttributes
 
std::shared_ptr< ComponentSignalListModelmSignals
 
std::shared_ptr< slint::SortModel< ui::ComponentSignalData > > mSignalsSorted
 
std::shared_ptr< ComponentSignalNameListModelmSignalNames
 
slint::SharedString mNewSignalName
 
slint::SharedString mNewSignalNameError
 
std::shared_ptr< ComponentVariantListModelmVariants
 
bool mIsInterfaceBroken
 Broken interface detection.
 
bool mOriginalIsSchematicOnly
 
QSet< UuidmOriginalSignalUuids
 
ComponentSymbolVariantList mOriginalSymbolVariants
 

Additional Inherited Members

- Signals inherited from WindowTab
void panelPageRequested (ui::PanelPage p)
 
void closeRequested ()
 
void closeEnforced ()
 
void statusBarMessageChanged (const QString &message, int timeoutMs)
 
void cursorCoordinatesChanged (const Point &pos, const LengthUnit &unit)
 
- Protected Attributes inherited from LibraryEditorTab
LibraryEditormEditor
 
std::unique_ptr< UndoStackmUndoStack
 
bool mManualModificationsMade
 
QSet< SExpressionmSupportedApprovals
 
QSet< SExpressionmDisappearedApprovals
 
std::shared_ptr< RuleCheckMessagesModelmCheckMessages
 
slint::SharedString mCheckError
 
QTimer mRuleCheckDelayTimer
 
QFileSystemWatcher mFileSystemWatcher
 
QHash< FilePath, QByteArray > mWatchedFileHashes
 To detect modifications.
 
QSet< FilePathmModifiedWatchedFiles
 Modified, but not reloaded yet.
 
bool mAutoReloadOnFileModifications
 Set by derived classes.
 
QTimer mWatchedFilesTimer
 To delay/aggregate the notification & reload.
 
- Protected Attributes inherited from WindowTab
GuiApplicationmApp
 
MainWindowmWindow
 

Detailed Description

The ComponentTab class.

Member Enumeration Documentation

◆ Mode

enum class Mode
strong
Enumerator
Open 
New 
Duplicate 

Constructor & Destructor Documentation

◆ ComponentTab() [1/3]

ComponentTab ( )
delete

◆ ComponentTab() [2/3]

ComponentTab ( const ComponentTab other)
delete

◆ ComponentTab() [3/3]

ComponentTab ( LibraryEditor editor,
std::unique_ptr< Component cmp,
Mode  mode,
QObject *  parent = nullptr 
)
explicitnoexcept

◆ ~ComponentTab()

~ComponentTab ( )
noexcept
+ Here is the call graph for this function:

Member Function Documentation

◆ getDirectoryPath()

FilePath getDirectoryPath ( ) const
overridevirtualnoexcept

Implements LibraryEditorTab.

◆ getUiData()

ui::TabData getUiData ( ) const
overridevirtualnoexcept

Implements WindowTab.

+ Here is the call graph for this function:

◆ getDerivedUiData()

ui::ComponentTabData getDerivedUiData ( ) const
noexcept
+ Here is the call graph for this function:

◆ setDerivedUiData()

void setDerivedUiData ( const ui::ComponentTabData &  data)
noexcept
+ Here is the call graph for this function:

◆ trigger()

void trigger ( ui::TabAction  a)
overridevirtualnoexcept

Reimplemented from WindowTab.

+ Here is the call graph for this function:

◆ renderScene()

slint::Image renderScene ( float  width,
float  height,
int  scene 
)
overridevirtualnoexcept

Reimplemented from WindowTab.

◆ requestClose()

bool requestClose ( )
overridevirtualnoexcept

Request to close the tab.

If there are unsaved changes to the tab, this method will ask the user whether the changes should be saved or not. If the user clicks on "cancel" or the changes could not be saved successfully, this method will return false. If there were no unsaved changes or they were successfully saved, the method returns true.

Return values
trueTab is safe to be closed.
falseTab still has unsaved changes.

Reimplemented from WindowTab.

+ Here is the call graph for this function:

◆ operator=()

ComponentTab & operator= ( const ComponentTab rhs)
delete

◆ runChecksImpl()

std::optional< std::pair< RuleCheckMessageList, QSet< SExpression > > > runChecksImpl ( )
overrideprotectedvirtual

Implements LibraryEditorTab.

◆ autoFixImpl()

bool autoFixImpl ( const std::shared_ptr< const RuleCheckMessage > &  msg,
bool  checkOnly 
)
overrideprotectedvirtual

Implements LibraryEditorTab.

◆ autoFixHelper()

template<typename MessageType >
bool autoFixHelper ( const std::shared_ptr< const RuleCheckMessage > &  msg,
bool  checkOnly 
)
protected
+ Here is the call graph for this function:

◆ autoFix() [1/7]

template<typename MessageType >
bool autoFix ( const MessageType &  msg)
protected
+ Here is the caller graph for this function:

◆ messageApprovalChanged()

void messageApprovalChanged ( const SExpression approval,
bool  approved 
)
overrideprotectedvirtualnoexcept

Implements LibraryEditorTab.

◆ notifyDerivedUiDataChanged()

void notifyDerivedUiDataChanged ( )
overrideprotectedvirtualnoexcept

Implements LibraryEditorTab.

◆ isWritable()

bool isWritable ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ isInterfaceBroken()

bool isInterfaceBroken ( ) const
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refreshUiData()

void refreshUiData ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ commitUiData()

void commitUiData ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

bool save ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ autoFix() [2/7]

template<>
bool autoFix ( const MsgNameNotTitleCase msg)
+ Here is the call graph for this function:

◆ autoFix() [3/7]

template<>
bool autoFix ( const MsgMissingAuthor msg)
+ Here is the call graph for this function:

◆ autoFix() [4/7]

template<>
bool autoFix ( const MsgMissingCategories msg)

◆ autoFix() [5/7]

template<>
bool autoFix ( const MsgMissingComponentDefaultValue msg)
+ Here is the call graph for this function:

◆ autoFix() [6/7]

template<>
bool autoFix ( const MsgMissingSymbolVariant msg)
+ Here is the call graph for this function:

◆ autoFix() [7/7]

template<>
bool autoFix ( const MsgNonFunctionalComponentSignalInversionSign msg)
+ Here is the call graph for this function:

Member Data Documentation

◆ onDerivedUiDataChanged

Signal<ComponentTab> onDerivedUiDataChanged

◆ mComponent

std::unique_ptr<Component> mComponent
private

◆ mIsNewElement

const bool mIsNewElement
private

◆ mWizardMode

bool mWizardMode
private

◆ mCurrentPageIndex

int mCurrentPageIndex
private

◆ mChooseCategory

bool mChooseCategory
private

◆ mName

slint::SharedString mName
private

◆ mNameError

slint::SharedString mNameError
private

◆ mNameParsed

ElementName mNameParsed
private

◆ mDescription

slint::SharedString mDescription
private

◆ mKeywords

slint::SharedString mKeywords
private

◆ mAuthor

slint::SharedString mAuthor
private

◆ mVersion

slint::SharedString mVersion
private

◆ mVersionError

slint::SharedString mVersionError
private

◆ mVersionParsed

Version mVersionParsed
private

◆ mDeprecated

bool mDeprecated
private

◆ mCategories

std::shared_ptr<LibraryElementCategoriesModel> mCategories
private

◆ mCategoriesTree

std::shared_ptr<CategoryTreeModel> mCategoriesTree
private

◆ mDatasheetUrl

slint::SharedString mDatasheetUrl
private

◆ mDatasheetUrlError

slint::SharedString mDatasheetUrlError
private

◆ mSchematicOnly

bool mSchematicOnly
private

◆ mPrefix

slint::SharedString mPrefix
private

◆ mPrefixError

slint::SharedString mPrefixError
private

◆ mPrefixParsed

ComponentPrefix mPrefixParsed
private

◆ mDefaultValue

slint::SharedString mDefaultValue
private

◆ mDefaultValueError

slint::SharedString mDefaultValueError
private

◆ mAttributes

std::shared_ptr<AttributeListModel> mAttributes
private

◆ mSignals

std::shared_ptr<ComponentSignalListModel> mSignals
private

◆ mSignalsSorted

std::shared_ptr<slint::SortModel<ui::ComponentSignalData> > mSignalsSorted
private

◆ mSignalNames

std::shared_ptr<ComponentSignalNameListModel> mSignalNames
private

◆ mNewSignalName

slint::SharedString mNewSignalName
private

◆ mNewSignalNameError

slint::SharedString mNewSignalNameError
private

◆ mVariants

std::shared_ptr<ComponentVariantListModel> mVariants
private

◆ mIsInterfaceBroken

bool mIsInterfaceBroken
private

Broken interface detection.

◆ mOriginalIsSchematicOnly

bool mOriginalIsSchematicOnly
private

◆ mOriginalSignalUuids

QSet<Uuid> mOriginalSignalUuids
private

◆ mOriginalSymbolVariants

ComponentSymbolVariantList mOriginalSymbolVariants
private

The documentation for this class was generated from the following files: