Seamly2D
Code documentation
toggle_piecelock.h
Go to the documentation of this file.
1 /***************************************************************************
2  ** @file toggle_piecelock.h
3  ** @author Douglas S Caskey
4  ** @date Jan 1, 2023
5  **
6  ** @copyright
7  ** Copyright (C) 2017 - 2023 Seamly, LLC
8  ** https://github.com/fashionfreedom/seamly2d
9  **
10  ** @brief
11  ** Seamly2D is free software: you can redistribute it and/or modify
12  ** it under the terms of the GNU General Public License as published by
13  ** the Free Software Foundation, either version 3 of the License, or
14  ** (at your option) any later version.
15  **
16  ** Seamly2D is distributed in the hope that it will be useful,
17  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  ** GNU General Public License for more details.
20  **
21  ** You should have received a copy of the GNU General Public License
22  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
23  **************************************************************************/
24 
25 #ifndef TOGGLE_PIECELOCK_H
26 #define TOGGLE_PIECELOCK_H
27 
28 #include <qcompilerdetection.h>
29 #include <QMetaObject>
30 #include <QObject>
31 #include <QString>
32 #include <QtGlobal>
33 
34 #include "vundocommand.h"
35 
37 {
38  Q_OBJECT
39 public:
40  TogglePieceLock(quint32 id, bool lock, VContainer *data, VAbstractPattern *doc, QUndoCommand *parent = nullptr);
41  virtual ~TogglePieceLock();
42  virtual void undo() Q_DECL_OVERRIDE;
43  virtual void redo() Q_DECL_OVERRIDE;
44  virtual int id() const Q_DECL_OVERRIDE;
45  quint32 getpieceId() const;
46  bool getNewLock() const;
47 
48 signals:
49  void updateList(quint32 m_id);
50 
51 private:
52  Q_DISABLE_COPY(TogglePieceLock)
53  quint32 m_id;
55  bool m_oldLock;
56  bool m_newLock;
57 
58  void doCmd(bool lock);
59 };
60 
61 #endif // TOGGLE_PIECELOCK_H
TogglePieceLock(quint32 id, bool lock, VContainer *data, VAbstractPattern *doc, QUndoCommand *parent=nullptr)
virtual int id() const Q_DECL_OVERRIDE
virtual void undo() Q_DECL_OVERRIDE
quint32 getpieceId() const
void updateList(quint32 m_id)
bool getNewLock() const
void doCmd(bool lock)
VContainer * m_data
virtual void redo() Q_DECL_OVERRIDE
virtual ~TogglePieceLock()
The VContainer class container of all variables.
Definition: vcontainer.h:141
VAbstractPattern * doc
Definition: vundocommand.h:106