Krita Source Code Documentation
Loading...
Searching...
No Matches
KisUndoView.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2010 Matus Talcik <matus.talcik@gmail.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6/****************************************************************************
7**
8** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
9** All rights reserved.
10** Contact: Nokia Corporation (qt-info@nokia.com)
11**
12** This file is part of the QtGui module of the Qt Toolkit.
13**
14** $QT_BEGIN_LICENSE:LGPL$
15** No Commercial Usage
16** This file contains pre-release code and may not be distributed.
17** You may use this file in accordance with the terms and conditions
18** contained in the Technology Preview License Agreement accompanying
19** this package.
20**
21** GNU Lesser General Public License Usage
22** Alternatively, this file may be used under the terms of the GNU Lesser
23** General Public License version 2.1 as published by the Free Software
24** Foundation and appearing in the file LICENSE.LGPL included in the
25** packaging of this file. Please review the following information to
26** ensure the GNU Lesser General Public License version 2.1 requirements
27** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
28**
29** In addition, as a special exception, Nokia gives you certain additional
30** rights. These rights are described in the Nokia Qt LGPL Exception
31** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
32**
33** If you have questions regarding the use of this file, please contact
34** Nokia at qt-info@nokia.com.
35**
36**
37**
38**
39**
40**
41**
42**
43** $QT_END_LICENSE$
44**
45****************************************************************************/
46#ifndef KisUndoView_H
47#define KisUndoView_H
48
49#include <QListView>
50#include <QString>
51#include <QAction>
52#include <kis_types.h>
53#include <klocalizedstring.h>
54#include <KisKineticScroller.h>
55#include <kis_icon.h>
56#include "kis_canvas2.h"
57
58#ifndef QT_NO_UNDOVIEW
59
61class KUndo2QStack;
62class KUndo2Group;
63class QIcon;
64
65class KisUndoView : public QListView
66{
67 Q_OBJECT
68 Q_PROPERTY(QString emptyLabel READ emptyLabel WRITE setEmptyLabel)
69 Q_PROPERTY(QIcon cleanIcon READ cleanIcon WRITE setCleanIcon)
70
71public:
72 explicit KisUndoView(QWidget *parent = 0);
73 explicit KisUndoView(KUndo2QStack *stack, QWidget *parent = 0);
74#ifndef QT_NO_UNDOGROUP
75 explicit KisUndoView(KUndo2Group *group, QWidget *parent = 0);
76#endif
77 ~KisUndoView() override;
78
79 KUndo2QStack *stack() const;
80#ifndef QT_NO_UNDOGROUP
81 KUndo2Group *group() const;
82#endif
83
84 void setEmptyLabel(const QString &label);
85 QString emptyLabel() const;
86
87 void setCleanIcon(const QIcon &icon);
88 QIcon cleanIcon() const;
89
90 void setCanvas(KisCanvas2* canvas);
91
92public Q_SLOTS:
94#ifndef QT_NO_UNDOGROUP
96#endif
97
98 void slotScrollerStateChanged(QScroller::State state){KisKineticScroller::updateCursor(this, state);}
99
100
101private:
103 Q_DISABLE_COPY(KisUndoView)
104};
105
106#endif // QT_NO_UNDOVIEW
107#endif // KisUndoView_H
The KUndo2Group class is a group of KUndo2QStack objects.
Definition kundo2group.h:57
The KUndo2QStack class is a stack of KUndo2Command objects.
The KisUndoView class displays the contents of a KUndo2QStack.
Definition KisUndoView.h:66
void setEmptyLabel(const QString &label)
KisUndoView(QWidget *parent=0)
KUndo2QStack * stack() const
QString emptyLabel
the label used for the empty state.
Definition KisUndoView.h:68
void setCleanIcon(const QIcon &icon)
void setCanvas(KisCanvas2 *canvas)
KisUndoViewPrivate *const d
void slotScrollerStateChanged(QScroller::State state)
Definition KisUndoView.h:98
KUndo2Group * group() const
void setStack(KUndo2QStack *stack)
void setGroup(KUndo2Group *group)
QIcon cleanIcon
the icon used to represent the clean state.
Definition KisUndoView.h:69
~KisUndoView() override
KRITAWIDGETUTILS_EXPORT void updateCursor(QWidget *source, QScroller::State state)