1 /*
2  *  Copyright (c) 2017 Dmitry Kazakov <dimula73@gmail.com>
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 #ifndef DEFAULTTOOLTABBEDWIDGET_H
20 #define DEFAULTTOOLTABBEDWIDGET_H
21 
22 #include <KoTitledTabWidget.h>
23 #include "KoShapeMeshGradientHandles.h"
24 
25 class KoInteractionTool;
26 class KoFillConfigWidget;
27 class KoStrokeConfigWidget;
28 class DefaultToolGeometryWidget;
29 
30 class DefaultToolTabbedWidget : public KoTitledTabWidget
31 {
32     Q_OBJECT
33 
34 public:
35     explicit DefaultToolTabbedWidget(KoInteractionTool *tool, QWidget *parent = 0);
36     ~DefaultToolTabbedWidget() override;
37 
38     enum TabType {
39         GeometryTab,
40         StrokeTab,
41         FillTab
42     };
43 
44     void activate();
45     void deactivate();
46 
47     bool useUniformScaling() const;
48 
49 Q_SIGNALS:
50     void sigSwitchModeEditFillGradient(bool value);
51     void sigSwitchModeEditStrokeGradient(bool value);
52     void sigMeshGradientResetted();
53 
54 public Q_SLOTS:
55     void slotMeshGradientHandleSelected(KoShapeMeshGradientHandles::Handle h);
56 
57 private Q_SLOTS:
58     void slotCurrentIndexChanged(int current);
59 
60 private:
61     int m_oldTabIndex;
62 
63     DefaultToolGeometryWidget *m_geometryWidget;
64     KoFillConfigWidget *m_fillWidget;
65     KoStrokeConfigWidget *m_strokeWidget;
66 };
67 
68 
69 #endif // DEFAULTTOOLTABBEDWIDGET_H
70