LeviLamina
Loading...
Searching...
No Matches
Theme.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/common/editor/ThemeSettingsColorKey.h"
7#include "mc/deps/script_core/runtime/scripting/Result_deprecated.h"
8
9// auto generated forward declare list
10// clang-format off
11class HashedString;
12namespace Editor::Settings { struct ThemePalette; }
13namespace Editor::Settings { struct ThemeProps; }
14namespace Scripting { struct Error; }
15namespace cereal { struct ReflectionCtx; }
16namespace mce { class Color; }
17// clang-format on
18
19namespace Editor::Settings {
20
21class Theme {
22public:
23 // member variables
24 // NOLINTBEGIN
31 // NOLINTEND
32
33public:
34 // prevent constructor by default
35 Theme& operator=(Theme const&);
36 Theme(Theme const&);
37 Theme();
38
39public:
40 // member functions
41 // NOLINTBEGIN
42 MCNAPI Theme(
43 ::std::function<void(::Editor::Settings::ThemeProps const&)> fullSyncCallback,
44 ::std::function<void(::std::string const&)> onCurrentThemeChangeCallback,
45 ::std::function<
46 void(::std::string const&, ::std::optional<::std::string> const&, ::std::optional<::std::string> const&)>
47 onNewThemeCreatedCallback,
48 ::std::function<void(::std::string const&, ::Editor::Settings::ThemeSettingsColorKey, ::mce::Color const&)>
49 onThemeColorUpdatedCallback,
50 ::std::function<void(::std::string const&)> onThemeDeletedCallback
51 );
52
53 MCNAPI ::std::unordered_map<::HashedString, ::mce::Color>
54 _cloneThemeColorProps(::std::unordered_map<::HashedString, ::mce::Color> const colorProps);
55
56 MCNAPI ::Scripting::Error _getAttemptingToModifyBuiltInThemeError(::std::string const& themeId) const;
57
58 MCNAPI ::Scripting::Error _getThemeDoesNotExistError(::std::string const& themeId, bool isCustom) const;
59
60 MCNAPI ::Scripting::Result_deprecated<void> addNewTheme(
61 ::std::string const& id,
62 ::std::optional<::std::string> const& name,
63 ::std::optional<::std::string> const& sourceThemeId,
64 bool notifyUpdate
65 );
66
67 MCNAPI bool canThemeBeModified(::std::string const& id) const;
68
69 MCNAPI ::Scripting::Result_deprecated<void> deleteTheme(::std::string const& id, bool notifyUpdate);
70
71#ifdef LL_PLAT_C
72 MCNAPI ::std::unordered_map<::HashedString, ::Editor::Settings::ThemePalette> getAllThemesMap() const;
73#endif
74
75 MCNAPI ::std::optional<::Editor::Settings::ThemePalette> getThemeColors(::std::string const& id) const;
76
77 MCNAPI ::Scripting::Result_deprecated<::std::string> getThemeName(::std::string const& id) const;
78
79#ifdef LL_PLAT_C
80 MCNAPI ::Scripting::Result_deprecated<::Editor::Settings::ThemePalette>
81 getThemePalette(::std::string const& id) const;
82#endif
83
84 MCNAPI ::mce::Color const& resolveColorKey(::Editor::Settings::ThemeSettingsColorKey key) const;
85
86 MCNAPI ::Scripting::Result_deprecated<void> setCurrentTheme(::std::string const& id, bool notifyUpdate);
87
88 MCNAPI ::Scripting::Result_deprecated<void> setThemeName(::std::string const& id, ::std::string const& name);
89
90 MCNAPI void updateSettings(::Editor::Settings::ThemeProps const& props, bool notifyUpdate);
91
92 MCNAPI ::Scripting::Result_deprecated<void> updateThemeColor(
93 ::std::string const& id,
94 ::Editor::Settings::ThemeSettingsColorKey key,
95 ::mce::Color const& newColor,
96 bool notifyUpdate
97 );
98
99 MCNAPI ~Theme();
100 // NOLINTEND
101
102public:
103 // static functions
104 // NOLINTBEGIN
105 MCNAPI static ::std::unordered_map<::HashedString, ::Editor::Settings::ThemePalette> _getDefaultThemesMap();
106
108 // NOLINTEND
109
110public:
111 // constructor thunks
112 // NOLINTBEGIN
113 MCNAPI void* $ctor(
114 ::std::function<void(::Editor::Settings::ThemeProps const&)> fullSyncCallback,
115 ::std::function<void(::std::string const&)> onCurrentThemeChangeCallback,
116 ::std::function<
117 void(::std::string const&, ::std::optional<::std::string> const&, ::std::optional<::std::string> const&)>
118 onNewThemeCreatedCallback,
119 ::std::function<void(::std::string const&, ::Editor::Settings::ThemeSettingsColorKey, ::mce::Color const&)>
120 onThemeColorUpdatedCallback,
121 ::std::function<void(::std::string const&)> onThemeDeletedCallback
122 );
123 // NOLINTEND
124
125public:
126 // destructor thunk
127 // NOLINTBEGIN
128 MCNAPI void $dtor();
129 // NOLINTEND
130};
131
132} // namespace Editor::Settings
MCAPI ::Scripting::Result_deprecated< void > setThemeName(::std::string const &id, ::std::string const &name)
static MCAPI ::std::unordered_map<::HashedString, ::Editor::Settings::ThemePalette > _getDefaultThemesMap()
MCAPI ::Scripting::Result_deprecated< void > updateThemeColor(::std::string const &id, ::Editor::Settings::ThemeSettingsColorKey key, ::mce::Color const &newColor, bool notifyUpdate)
MCAPI ::Scripting::Result_deprecated< void > addNewTheme(::std::string const &id, ::std::optional<::std::string > const &name, ::std::optional<::std::string > const &sourceThemeId, bool notifyUpdate)
MCAPI ::Scripting::Result_deprecated<::std::string > getThemeName(::std::string const &id) const
MCAPI::Scripting::Error _getThemeDoesNotExistError(::std::string const &themeId, bool isCustom) const
MCAPI void * $ctor(::std::function< void(::Editor::Settings::ThemeProps const &)> fullSyncCallback, ::std::function< void(::std::string const &)> onCurrentThemeChangeCallback, ::std::function< void(::std::string const &, ::std::optional<::std::string > const &, ::std::optional<::std::string > const &)> onNewThemeCreatedCallback, ::std::function< void(::std::string const &, ::Editor::Settings::ThemeSettingsColorKey, ::mce::Color const &)> onThemeColorUpdatedCallback, ::std::function< void(::std::string const &)> onThemeDeletedCallback)
MCAPI ::Scripting::Result_deprecated< void > setCurrentTheme(::std::string const &id, bool notifyUpdate)
MCAPI::Scripting::Error _getAttemptingToModifyBuiltInThemeError(::std::string const &themeId) const
MCAPI bool canThemeBeModified(::std::string const &id) const
MCAPI ::std::optional<::Editor::Settings::ThemePalette > getThemeColors(::std::string const &id) const
MCAPI ::Scripting::Result_deprecated< void > deleteTheme(::std::string const &id, bool notifyUpdate)
MCAPI void updateSettings(::Editor::Settings::ThemeProps const &props, bool notifyUpdate)
MCAPI::mce::Color const & resolveColorKey(::Editor::Settings::ThemeSettingsColorKey key) const
static MCAPI void bindType(::cereal::ReflectionCtx &ctx)
MCAPI Theme(::std::function< void(::Editor::Settings::ThemeProps const &)> fullSyncCallback, ::std::function< void(::std::string const &)> onCurrentThemeChangeCallback, ::std::function< void(::std::string const &, ::std::optional<::std::string > const &, ::std::optional<::std::string > const &)> onNewThemeCreatedCallback, ::std::function< void(::std::string const &, ::Editor::Settings::ThemeSettingsColorKey, ::mce::Color const &)> onThemeColorUpdatedCallback, ::std::function< void(::std::string const &)> onThemeDeletedCallback)
MCAPI ::std::unordered_map<::HashedString, ::mce::Color > _cloneThemeColorProps(::std::unordered_map<::HashedString, ::mce::Color > const colorProps)
Definition HashedString.h:5
Definition Color.h:13
Definition ThemePalette.h:13
Definition ThemeProps.h:13
Definition Error.h:10
Definition ReflectionCtx.h:11
Definition ctx.h:5
Definition Alias.h:14