跳转至

ui/core/theme_factory.h

Abstract factory for creating and serializing CF UI themes. More...

Namespaces

Name
cf
cf::ui
cf::ui::core

Classes

Name
class cf::ui::core::ThemeFactory
Abstract factory for creating and serializing CF UI themes.

Detailed Description

Abstract factory for creating and serializing CF UI themes.

Author: N/A

Version: N/A

Since: N/A

Date: N/A

Defines the ThemeFactory interface for creating ICFTheme instances from names or JSON data, and for serializing themes to JSON format.

Source code

#pragma once

#include "export.h"
#include "theme.h"
#include <QByteArray>
#include <memory>

namespace cf::ui::core {

class CF_UI_EXPORT ThemeFactory {
  public:
    virtual ~ThemeFactory() = default;

    virtual std::unique_ptr<ICFTheme> fromName(const char* name) = 0;

    virtual std::unique_ptr<ICFTheme> fromJson(const QByteArray& json) = 0;

    virtual QByteArray toJson(ICFTheme* raw_theme) = 0;
};

} // namespace cf::ui::core

Updated on 2026-03-09 at 10:14:01 +0000