|
|
|
@ -1,43 +1,43 @@
|
|
|
|
|
#ifndef TAGDATA_H
|
|
|
|
|
#define TAGDATA_H
|
|
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
#include <QMetaClassInfo>
|
|
|
|
|
#include <QString> // 包含QString类的头文件,QString是Qt中用于处理字符串的类
|
|
|
|
|
#include <QMetaClassInfo> // 包含QMetaClassInfo类的头文件,用于元信息支持
|
|
|
|
|
|
|
|
|
|
namespace SpecialTagID {
|
|
|
|
|
namespace SpecialTagID {// 定义SpecialTagID命名空间,用于特定的标签ID值
|
|
|
|
|
enum Value {
|
|
|
|
|
InvalidTagId = -1,
|
|
|
|
|
InvalidTagId = -1, // 无效的标签ID值
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class TagData
|
|
|
|
|
class TagData// 定义TagData类,用于表示标签的数据
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
TagData();
|
|
|
|
|
TagData();// 构造函数
|
|
|
|
|
|
|
|
|
|
int id() const;
|
|
|
|
|
void setId(int newId);
|
|
|
|
|
int id() const;// 获取标签ID
|
|
|
|
|
void setId(int newId); // 设置标签ID
|
|
|
|
|
|
|
|
|
|
const QString &name() const;
|
|
|
|
|
void setName(const QString &newName);
|
|
|
|
|
const QString &name() const;// 获取标签名称
|
|
|
|
|
void setName(const QString &newName); // 设置标签名称
|
|
|
|
|
|
|
|
|
|
const QString &color() const;
|
|
|
|
|
void setColor(const QString &newColor);
|
|
|
|
|
const QString &color() const;// 获取标签颜色
|
|
|
|
|
void setColor(const QString &newColor); // 设置标签颜色
|
|
|
|
|
|
|
|
|
|
int relativePosition() const;
|
|
|
|
|
void setRelativePosition(int newRelativePosition);
|
|
|
|
|
int relativePosition() const; // 获取标签的相对位置
|
|
|
|
|
void setRelativePosition(int newRelativePosition); // 设置标签的相对位置
|
|
|
|
|
|
|
|
|
|
int childNotesCount() const;
|
|
|
|
|
void setChildNotesCount(int newChildCount);
|
|
|
|
|
int childNotesCount() const; // 获取标签下的子笔记数量
|
|
|
|
|
void setChildNotesCount(int newChildCount); // 设置标签下的子笔记数量
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int m_id;
|
|
|
|
|
QString m_name;
|
|
|
|
|
QString m_color;
|
|
|
|
|
int m_relativePosition;
|
|
|
|
|
int m_childNotesCount;
|
|
|
|
|
int m_id; // 私有成员变量,存储标签ID
|
|
|
|
|
QString m_name; // 私有成员变量,存储标签名称
|
|
|
|
|
QString m_color; // 私有成员变量,存储标签颜色
|
|
|
|
|
int m_relativePosition; // 私有成员变量,存储标签的相对位置
|
|
|
|
|
int m_childNotesCount; // 私有成员变量,存储标签下的子笔记数量
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(TagData)
|
|
|
|
|
Q_DECLARE_METATYPE(TagData)// 声明TagData为元类型,以便在信号和槽中使用
|
|
|
|
|
|
|
|
|
|
#endif // TAGDATA_H
|
|
|
|
|