QElectroTech  0.8-dev
elementitemeditor.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef ELEMENT_ITEM_EDITOR_H
19 #define ELEMENT_ITEM_EDITOR_H
20 
21 #include <QWidget>
22 
23 class QETElementEditor;
24 class ElementScene;
25 class CustomElementPart;
26 class QUndoStack;
27 
33 class ElementItemEditor : public QWidget
34 {
35  Q_OBJECT
36  // constructors, destructor
37  public:
38  ElementItemEditor(QETElementEditor *, QWidget * = nullptr);
39  ~ElementItemEditor() override {};
40  private:
42 
43  // methods
44  public:
45  virtual QETElementEditor *elementEditor() const;
46  virtual ElementScene *elementScene() const;
47  virtual QUndoStack &undoStack() const;
48 
49  virtual QString elementTypeName() const;
50  virtual void setElementTypeName(const QString &);
51  virtual void detach();
52 
53  virtual bool setPart(CustomElementPart *) = 0;
54  virtual bool setParts(QList <CustomElementPart *>) {return false;}
55 
56  virtual CustomElementPart *currentPart() const = 0;
57  virtual QList<CustomElementPart*> currentParts() const = 0;
58  virtual void updateForm() = 0;
59 
60  // attributes
61  private:
64 };
65 #endif
elementitemeditor.h
ElementItemEditor::element_type_name
QString element_type_name
Definition: elementitemeditor.h:63
ElementItemEditor::ElementItemEditor
ElementItemEditor(const ElementItemEditor &)
ElementItemEditor::setParts
virtual bool setParts(QList< CustomElementPart * >)
Definition: elementitemeditor.h:54
ElementItemEditor::setElementTypeName
virtual void setElementTypeName(const QString &)
Definition: elementitemeditor.cpp:54
ElementItemEditor::currentParts
virtual QList< CustomElementPart * > currentParts() const =0
ElementItemEditor::currentPart
virtual CustomElementPart * currentPart() const =0
qetelementeditor.h
ElementItemEditor::ElementItemEditor
ElementItemEditor(QETElementEditor *, QWidget *=nullptr)
Definition: elementitemeditor.cpp:27
ElementItemEditor
Definition: elementitemeditor.h:34
ElementItemEditor::elementScene
virtual ElementScene * elementScene() const
Definition: elementitemeditor.cpp:39
ElementItemEditor::elementEditor
virtual QETElementEditor * elementEditor() const
Definition: elementitemeditor.cpp:34
ElementItemEditor::updateForm
virtual void updateForm()=0
editorcommands.h
ElementItemEditor::setPart
virtual bool setPart(CustomElementPart *)=0
ElementItemEditor::detach
virtual void detach()
Definition: elementitemeditor.cpp:63
ElementItemEditor::~ElementItemEditor
~ElementItemEditor() override
Definition: elementitemeditor.h:39
CustomElementPart
The CustomElementPart class This abstract class represents a primitive of the visual representation o...
Definition: customelementpart.h:40
ElementItemEditor::element_editor
QETElementEditor * element_editor
Definition: elementitemeditor.h:62
ElementItemEditor::elementTypeName
virtual QString elementTypeName() const
Definition: elementitemeditor.cpp:49
ElementScene
The ElementScene class This class is the canvas allowing the visual edition of an electrial element....
Definition: elementscene.h:40
QETElementEditor
Definition: qetelementeditor.h:33
ElementItemEditor::undoStack
virtual QUndoStack & undoStack() const
Definition: elementitemeditor.cpp:44