1 /************************************************************************
2  **
3  **  @file   dialogline.h
4  **  @author Roman Telezhynskyi <dismine(at)gmail.com>
5  **  @date   November 15, 2013
6  **
7  **  @brief
8  **  @copyright
9  **  This source code is part of the Valentina project, a pattern making
10  **  program, whose allow create and modeling patterns of clothing.
11  **  Copyright (C) 2013-2015 Valentina project
12  **  <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
13  **
14  **  Valentina is free software: you can redistribute it and/or modify
15  **  it under the terms of the GNU General Public License as published by
16  **  the Free Software Foundation, either version 3 of the License, or
17  **  (at your option) any later version.
18  **
19  **  Valentina is distributed in the hope that it will be useful,
20  **  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  **  GNU General Public License for more details.
23  **
24  **  You should have received a copy of the GNU General Public License
25  **  along with Valentina.  If not, see <http://www.gnu.org/licenses/>.
26  **
27  *************************************************************************/
28 
29 #ifndef DIALOGLINE_H
30 #define DIALOGLINE_H
31 
32 #include <qcompilerdetection.h>
33 #include <QMetaObject>
34 #include <QObject>
35 #include <QString>
36 #include <QtGlobal>
37 
38 #include "../vmisc/def.h"
39 #include "dialogtool.h"
40 
41 namespace Ui
42 {
43     class DialogLine;
44 }
45 
46 /**
47  * @brief The DialogLine class dialog for ToolLine. Help create line and edit option.
48  */
49 class DialogLine : public DialogTool
50 {
51     Q_OBJECT
52 public:
53     DialogLine(const VContainer *data, quint32 toolId, QWidget *parent = nullptr);
54     virtual ~DialogLine() override;
55 
56     quint32        GetFirstPoint() const;
57     void           SetFirstPoint(quint32 value);
58 
59     quint32        GetSecondPoint() const;
60     void           SetSecondPoint(quint32 value);
61 
62     QString        GetTypeLine() const;
63     void           SetTypeLine(const QString &value);
64 
65     QString        GetLineColor() const;
66     void           SetLineColor(const QString &value);
67 
68     void    SetNotes(const QString &notes);
69     QString GetNotes() const;
70 public slots:
71     virtual void   ChosenObject(quint32 id, const SceneObject &type) override;
72     virtual void   PointNameChanged() override;
73 protected:
74     virtual void   ShowVisualization() override;
75     /**
76      * @brief SaveData Put dialog data in local variables
77      */
78     virtual void   SaveData() override;
79     virtual bool   IsValid() const final;
80 private:
81     Q_DISABLE_COPY(DialogLine)
82 
83     /** @brief ui keeps information about user interface */
84     Ui::DialogLine *ui;
85 
86     bool flagError;
87 };
88 
89 //---------------------------------------------------------------------------------------------------------------------
IsValid()90 inline bool DialogLine::IsValid() const
91 {
92     return flagError;
93 }
94 
95 #endif // DIALOGLINE_H
96