LibrePCB Developers Documentation
PackageEditorState_DrawTextBase Class Reference

The PackageEditorState_DrawTextBase class. More...

#include <packageeditorstate_drawtextbase.h>

+ Inheritance diagram for PackageEditorState_DrawTextBase:
+ Collaboration diagram for PackageEditorState_DrawTextBase:

Public Types

enum class  Mode
 
- Public Types inherited from PackageEditorState
using Context = PackageEditorFsm::Context
 

Public Member Functions

 PackageEditorState_DrawTextBase ()=delete
 
 PackageEditorState_DrawTextBase (const PackageEditorState_DrawTextBase &other)=delete
 
 PackageEditorState_DrawTextBase (Context &context, Mode mode) noexcept
 
virtual ~PackageEditorState_DrawTextBase () noexcept
 
bool entry () noexcept override
 
bool exit () noexcept override
 
QSet< EditorWidgetBase::FeaturegetAvailableFeatures () const noexcept override
 
bool processGraphicsSceneMouseMoved (QGraphicsSceneMouseEvent &e) noexcept override
 
bool processGraphicsSceneLeftMouseButtonPressed (QGraphicsSceneMouseEvent &e) noexcept override
 
bool processGraphicsSceneRightMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept override
 
bool processRotate (const Angle &rotation) noexcept override
 
bool processMirror (Qt::Orientation orientation) noexcept override
 
bool processFlip (Qt::Orientation orientation) noexcept override
 
PackageEditorState_DrawTextBaseoperator= (const PackageEditorState_DrawTextBase &rhs)=delete
 
- Public Member Functions inherited from PackageEditorState
 PackageEditorState ()=delete
 
 PackageEditorState (const PackageEditorState &other)=delete
 
 PackageEditorState (Context &context) noexcept
 
virtual ~PackageEditorState () noexcept
 
virtual bool entry () noexcept
 
virtual bool exit () noexcept
 
virtual QSet< EditorWidgetBase::FeaturegetAvailableFeatures () const noexcept=0
 
virtual bool processKeyPressed (const QKeyEvent &e) noexcept
 
virtual bool processKeyReleased (const QKeyEvent &e) noexcept
 
virtual bool processGraphicsSceneMouseMoved (QGraphicsSceneMouseEvent &e) noexcept
 
virtual bool processGraphicsSceneLeftMouseButtonPressed (QGraphicsSceneMouseEvent &e) noexcept
 
virtual bool processGraphicsSceneLeftMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept
 
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked (QGraphicsSceneMouseEvent &e) noexcept
 
virtual bool processGraphicsSceneRightMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept
 
virtual bool processSelectAll () noexcept
 
virtual bool processCut () noexcept
 
virtual bool processCopy () noexcept
 
virtual bool processPaste () noexcept
 
virtual bool processMove (Qt::ArrowType direction)
 
virtual bool processRotate (const Angle &rotation) noexcept
 
virtual bool processMirror (Qt::Orientation orientation) noexcept
 
virtual bool processSnapToGrid () noexcept
 
virtual bool processFlip (Qt::Orientation orientation) noexcept
 
virtual bool processRemove () noexcept
 
virtual bool processEditProperties () noexcept
 
virtual bool processGenerateOutline () noexcept
 
virtual bool processGenerateCourtyard () noexcept
 
virtual bool processImportDxf () noexcept
 
virtual bool processAbortCommand () noexcept
 
PackageEditorStateoperator= (const PackageEditorState &rhs)=delete
 

Private Member Functions

bool startAddText (const Point &pos) noexcept
 
bool finishAddText (const Point &pos) noexcept
 
bool abortAddText () noexcept
 
void resetToDefaultParameters () noexcept
 
void layerComboBoxValueChanged (const Layer &layer) noexcept
 
void heightEditValueChanged (const PositiveLength &value) noexcept
 
void strokeWidthEditValueChanged (const UnsignedLength &value) noexcept
 
void textComboBoxValueChanged (const QString &value) noexcept
 
void hAlignActionGroupValueChanged (const HAlign &value) noexcept
 
void vAlignActionGroupValueChanged (const VAlign &value) noexcept
 

Private Attributes

Mode mMode
 
Point mStartPos
 
QScopedPointer< CmdStrokeTextEditmEditCmd
 
std::shared_ptr< StrokeTextmCurrentText
 
std::shared_ptr< StrokeTextGraphicsItemmCurrentGraphicsItem
 
QPointer< LayerComboBoxmLayerComboBox
 
QPointer< HAlignActionGroupmHAlignActionGroup
 
QPointer< VAlignActionGroupmVAlignActionGroup
 
const LayermLastLayer
 
Angle mLastRotation
 
PositiveLength mLastHeight
 
UnsignedLength mLastStrokeWidth
 
Alignment mLastAlignment
 
QString mLastText
 
bool mLastMirrored
 

Additional Inherited Members

- Signals inherited from PackageEditorState
void availableFeaturesChanged ()
 
void statusBarMessageChanged (const QString &message, int timeoutMs=-1)
 
- Protected Member Functions inherited from PackageEditorState
const PositiveLengthgetGridInterval () const noexcept
 
const LengthUnitgetLengthUnit () const noexcept
 
- Static Protected Member Functions inherited from PackageEditorState
static const QSet< const Layer * > & getAllowedTextLayers () noexcept
 
static const QSet< const Layer * > & getAllowedCircleAndPolygonLayers () noexcept
 
- Protected Attributes inherited from PackageEditorState
ContextmContext
 

Detailed Description

Member Enumeration Documentation

◆ Mode

enum class Mode
strong
Enumerator
NAME 
VALUE 
TEXT 

Constructor & Destructor Documentation

◆ PackageEditorState_DrawTextBase() [1/3]

◆ PackageEditorState_DrawTextBase() [2/3]

◆ PackageEditorState_DrawTextBase() [3/3]

PackageEditorState_DrawTextBase ( Context context,
Mode  mode 
)
explicitnoexcept

◆ ~PackageEditorState_DrawTextBase()

~PackageEditorState_DrawTextBase ( )
virtualnoexcept

Member Function Documentation

◆ entry()

bool entry ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ exit()

bool exit ( )
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ getAvailableFeatures()

QSet< EditorWidgetBase::Feature > getAvailableFeatures ( ) const
overridevirtualnoexcept

Implements PackageEditorState.

◆ processGraphicsSceneMouseMoved()

bool processGraphicsSceneMouseMoved ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneLeftMouseButtonPressed()

bool processGraphicsSceneLeftMouseButtonPressed ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processGraphicsSceneRightMouseButtonReleased()

bool processGraphicsSceneRightMouseButtonReleased ( QGraphicsSceneMouseEvent &  e)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

+ Here is the call graph for this function:

◆ processRotate()

bool processRotate ( const Angle rotation)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

◆ processMirror()

bool processMirror ( Qt::Orientation  orientation)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

◆ processFlip()

bool processFlip ( Qt::Orientation  orientation)
overridevirtualnoexcept

Reimplemented from PackageEditorState.

◆ operator=()

◆ startAddText()

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

◆ finishAddText()

bool finishAddText ( const Point pos)
privatenoexcept
+ Here is the call graph for this function:

◆ abortAddText()

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

◆ resetToDefaultParameters()

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

◆ layerComboBoxValueChanged()

void layerComboBoxValueChanged ( const Layer layer)
privatenoexcept
+ Here is the caller graph for this function:

◆ heightEditValueChanged()

void heightEditValueChanged ( const PositiveLength value)
privatenoexcept
+ Here is the caller graph for this function:

◆ strokeWidthEditValueChanged()

void strokeWidthEditValueChanged ( const UnsignedLength value)
privatenoexcept
+ Here is the caller graph for this function:

◆ textComboBoxValueChanged()

void textComboBoxValueChanged ( const QString &  value)
privatenoexcept
+ Here is the caller graph for this function:

◆ hAlignActionGroupValueChanged()

void hAlignActionGroupValueChanged ( const HAlign value)
privatenoexcept
+ Here is the caller graph for this function:

◆ vAlignActionGroupValueChanged()

void vAlignActionGroupValueChanged ( const VAlign value)
privatenoexcept
+ Here is the caller graph for this function:

Member Data Documentation

◆ mMode

Mode mMode
private

◆ mStartPos

Point mStartPos
private

◆ mEditCmd

QScopedPointer<CmdStrokeTextEdit> mEditCmd
private

◆ mCurrentText

std::shared_ptr<StrokeText> mCurrentText
private

◆ mCurrentGraphicsItem

std::shared_ptr<StrokeTextGraphicsItem> mCurrentGraphicsItem
private

◆ mLayerComboBox

QPointer<LayerComboBox> mLayerComboBox
private

◆ mHAlignActionGroup

QPointer<HAlignActionGroup> mHAlignActionGroup
private

◆ mVAlignActionGroup

QPointer<VAlignActionGroup> mVAlignActionGroup
private

◆ mLastLayer

const Layer* mLastLayer
private

◆ mLastRotation

Angle mLastRotation
private

◆ mLastHeight

PositiveLength mLastHeight
private

◆ mLastStrokeWidth

UnsignedLength mLastStrokeWidth
private

◆ mLastAlignment

Alignment mLastAlignment
private

◆ mLastText

QString mLastText
private

◆ mLastMirrored

bool mLastMirrored
private

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