Krita Source Code Documentation
Loading...
Searching...
No Matches
StoryboardItem.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 Saurabh Kumar <saurabhk660@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef STORYBOARD_ITEM
8#define STORYBOARD_ITEM
9
10#include <QVariant>
11#include <QVector>
12#include <QPixmap>
13
14#include "kritaui_export.h"
15#include "kis_types.h"
16
17//each storyboardItem contains pointer to child data
18class StoryboardItem;
19class QDomDocument;
20class QDomElement;
21
29{
30public:
31 StoryboardComment() = default;
32
33 QString name;
34 bool visibility = true;
35};
36
44{
45public:
47 : content("")
48 , scrollValue(0)
49 {}
50 CommentBox(const CommentBox& other)
51 : content(other.content)
53 {}
55 {}
56
60 QVariant content;
64 QVariant scrollValue;
65};
66
67
75{
76public:
78 : frameNum("")
79 , pixmap(QPixmap())
80 {}
82 : frameNum(other.frameNum)
83 , pixmap(other.pixmap)
84 {}
87
92 QVariant frameNum;
93
97 QVariant pixmap;
98};
99
102
103
110{
111public:
112 StoryboardChild(QVariant data)
113 : m_data(data)
114 {}
115
117 : m_data(rhs.m_data)
118 {}
119
121 {
122 return m_parentItem.toStrongRef();
123 }
124
126 {
127 m_parentItem = parent;
128 }
129
130 QVariant data()
131 {
132 return m_data;
133 }
134 void setData(QVariant value)
135 {
136 m_data = value;
137 }
138
139private:
140 QVariant m_data;
142};
143
151class KRITAUI_EXPORT StoryboardItem : public QEnableSharedFromThis<StoryboardItem>
152{
153public:
154 explicit StoryboardItem();
155 StoryboardItem(const StoryboardItem& other);
157
158 void appendChild(QVariant data);
159 void cloneChildrenFrom(const StoryboardItem &other);
160 void insertChild(int row, QVariant data = QVariant());
161 void removeChild(int row);
162 void moveChild(int from, int to);
163 int childCount() const;
164 QSharedPointer<StoryboardChild> child(int row) const;
165
166 QDomElement toXML(QDomDocument doc);
167 void loadXML(const QDomElement &itemNode);
168
169 static StoryboardItemList cloneStoryboardItemList(const StoryboardItemList &list);
170
171
204
205private:
207};
208
209#endif
float value(const T *src, size_t ch)
This class is a simple combination of two QVariants. It can be converted to and from QVariant type an...
CommentBox(const CommentBox &other)
QVariant scrollValue
the value of the scroll bar of the comment scrollbar
QVariant content
the text content of the Comment
This class makes up the StoryboardItem class. It consists of pointer to its parent item and the data ...
void setData(QVariant value)
QWeakPointer< StoryboardItem > m_parentItem
void setParent(StoryboardItemSP parent)
StoryboardItemSP parent()
StoryboardChild(QVariant data)
StoryboardChild(const StoryboardChild &rhs)
StoryboardComment()=default
This class stores a list of StoryboardChild objects and provides functionality to manipulate the list...
QVector< QSharedPointer< StoryboardChild > > m_childData
childType
This enum defines the data type to be stored at particular indices.
@ DurationFrame
Store the duration in frame at index 3. Data type stored here should be int.
@ FrameNumber
Store the frame number at index 0. Data type stored here should be ThumbnailData.
@ DurationSecond
Store the duration in second at index 2. Data type stored here should be int.
@ ItemName
Store the item name at index 1. Data type stored here should be string.
This class is a simple combination of two QVariants. It can be converted to and from QVariant type an...
ThumbnailData(const ThumbnailData &other)
QVariant frameNum
the frame number corresponding to this item in the timeline docker
QVariant pixmap
a scaled down thumbnail version of the frame
Q_DECLARE_METATYPE(KisPaintopLodLimitations)