2021-06-24 16:05:19 +08:00
|
|
|
#ifndef ICONSMANAGER_H
|
|
|
|
#define ICONSMANAGER_H
|
|
|
|
|
2021-12-21 07:38:49 +08:00
|
|
|
#include <QMap>
|
2021-06-24 16:05:19 +08:00
|
|
|
#include <QObject>
|
|
|
|
#include <QPixmap>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
class IconsManager : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-12-21 07:38:49 +08:00
|
|
|
using PIcon = std::shared_ptr<QPixmap>;
|
|
|
|
enum IconName {
|
|
|
|
GUTTER_SYNTAX_ERROR,
|
|
|
|
GUTTER_SYNTAX_WARNING,
|
|
|
|
GUTTER_BREAKPOINT,
|
|
|
|
GUTTER_ACTIVEBREAKPOINT,
|
|
|
|
GUTTER_BOOKMARK,
|
|
|
|
PARSER_TYPE, //":/icons/images/classparser/type.svg"
|
|
|
|
PARSER_CLASS, //":/icons/images/classparser/class.svg"
|
|
|
|
PARSER_NAMESPACE, //":/icons/images/classparser/namespace.svg"
|
|
|
|
PARSER_DEFINE, // ":/icons/images/classparser/define.svg"
|
|
|
|
PARSER_ENUM, // ":/icons/images/classparser/enum.svg";
|
|
|
|
PARSER_GLOBAL_METHOD, // ":/icons/images/classparser/global_method.svg"
|
|
|
|
PARSER_INHERITED_PROTECTED_METHOD, //":/icons/images/classparser/method_inherited_protected.svg"
|
|
|
|
PARSER_INHERITED_METHOD, // ":/icons/images/classparser/method_inherited.svg"
|
|
|
|
PARSER_PROTECTED_METHOD, // ":/icons/images/classparser/method_protected.svg"
|
|
|
|
PARSER_PUBLIC_METHOD, //":/icons/images/classparser/method_public.svg")
|
|
|
|
PARSER_PRIVATE_METHOD, //":/icons/images/classparser/method_private.svg"
|
|
|
|
PARSER_GLOBAL_VAR, // ":/icons/images/classparser/global.svg"
|
|
|
|
PARSER_INHERITED_PROTECTD_VAR, //":/icons/images/classparser/var_inherited_protected.svg"
|
|
|
|
PARSER_INHERITED_VAR, //":/icons/images/classparser/var_inherited.svg"
|
|
|
|
PARSER_PROTECTED_VAR, //":/icons/images/classparser/var_protected.svg"
|
|
|
|
PARSER_PUBLIC_VAR, //":/icons/images/classparser/var_public.svg"
|
|
|
|
PARSER_PRIVATE_VAR //":/icons/images/classparser/var_private.svg"
|
|
|
|
};
|
2021-06-24 16:05:19 +08:00
|
|
|
explicit IconsManager(QObject *parent = nullptr);
|
|
|
|
|
2021-12-21 07:38:49 +08:00
|
|
|
void updateEditorGuttorIcons(const QString& iconSet, int size);
|
|
|
|
void updateParserIcons(const QString& iconSet, int size);
|
2021-12-20 09:36:18 +08:00
|
|
|
|
2021-12-21 07:38:49 +08:00
|
|
|
PIcon getIcon(IconName iconName) const;
|
2021-10-21 17:31:25 +08:00
|
|
|
|
2021-10-23 23:10:34 +08:00
|
|
|
const PIcon &folder() const;
|
2021-12-20 12:53:35 +08:00
|
|
|
|
|
|
|
PIcon createSVGIcon(const QString& filename, int width, int height);
|
2021-06-24 16:05:19 +08:00
|
|
|
private:
|
2021-12-21 07:38:49 +08:00
|
|
|
QMap<IconName,PIcon> mIcons;
|
|
|
|
PIcon mDefaultIcon;
|
2021-10-23 23:10:34 +08:00
|
|
|
PIcon mFolder;
|
2021-06-24 16:05:19 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
extern IconsManager* pIconsManager;
|
|
|
|
#endif // ICONSMANAGER_H
|