Debian Codegraph @

src/gui/imageAnnotator/IImageAnnotator.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2020 Damir Porobic <[email protected]>
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,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef KSNIP_IIMAGEANNOTATOR_H
21 #define KSNIP_IIMAGEANNOTATOR_H
22
23 #include <QObject>
24
25 class QAction;
26
27 class IImageAnnotator : public QObject
28 {
29 Q_OBJECT
30 public:
31 explicit IImageAnnotator() = default;
32 ~IImageAnnotator() override = default;
33 virtual QImage image() const = 0;
34 virtual QImage imageAt(int index) const = 0;
35 virtual QAction *undoAction() = 0;
36 virtual QAction *redoAction() = 0;
37 virtual QSize sizeHint() const = 0;
38 virtual void showAnnotator() = 0;
39 virtual void showCropper() = 0;
40 virtual void showScaler() = 0;
41 virtual void showCanvasModifier() = 0;
42 virtual void showRotator() = 0;
43 virtual void showCutter() = 0;
44 virtual void setSettingsCollapsed(bool isCollapsed) = 0;
45 virtual void hide() = 0;
46 virtual void close() = 0;
47 virtual bool isVisible() const = 0;
48 virtual QWidget* widget() const = 0;
49
50 public slots:
51 virtual void loadImage(const QPixmap &pixmap) = 0;
52 virtual int addTab(const QPixmap &pixmap, const QString &title, const QString &toolTip) = 0;
53 virtual void updateTabInfo(int index, const QString &title, const QString &toolTip) = 0;
54 virtual void insertImageItem(const QPointF &position, const QPixmap &pixmap) = 0;
55 virtual void setSmoothPathEnabled(bool enabled) = 0;
56 virtual void setSaveToolSelection(bool enabled) = 0;
57 virtual void setSmoothFactor(int factor) = 0;
58 virtual void setSwitchToSelectToolAfterDrawingItem(bool enabled) = 0;
59 virtual void setSelectItemAfterDrawing(bool enabled) = 0;
60 virtual void setNumberToolSeedChangeUpdatesAllItems(bool enabled) = 0;
61 virtual void setTabBarAutoHide(bool enabled) = 0;
62 virtual void removeTab(int index) = 0;
63 virtual void setStickers(const QStringList &stickerPaths, bool keepDefault) = 0;
64 virtual void addTabContextMenuActions(const QList<QAction*> & actions) = 0;
65 virtual void setCanvasColor(const QColor &color) = 0;
66 virtual void setControlsWidgetVisible(bool isVisible) = 0;
67
68 signals:
69 void imageChanged() const;
70 void currentTabChanged(int index) const;
71 void tabCloseRequested(int index) const;
72 void tabMoved(int fromIndex, int toIndex);
73 void tabContextMenuOpened(int index) const;
74 };
75
76
77 #endif //KSNIP_IIMAGEANNOTATOR_H