terminal/src/cascadia/TerminalSettingsModel/DefaultProfileUtils.h
Carlos Zamora b603929214
Make Global and Profile settings inheritable (#7923)
## Summary of the Pull Request
Introduces `IInheritable` as an interface that helps move cascading settings into the Terminal Settings Model. `GlobalAppSettings` and `Profile` both are now `IInheritable`. `CascadiaSettings` was updated to `CreateChild()` for globals and each profile when we are loading the JSON data.

IInheritable does most of the heavy lifting. It introduces a two new macros and the interface. The macros help implement the fallback functionality for nullable and non-nullable settings.

## References
#7876 - Spec Addendum
#6904 - TSM Spec
#1564 - Settings UI

#7876 - `Copy()` needs to be updated to include _parent
2020-10-27 17:35:09 +00:00

27 lines
1,021 B
C++

/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Abstract:
- This header stores our default namespace guid. This is used in the creation of
default and in-box dynamic profiles. It also provides a helper function for
creating a "default" profile. Prior to GH#754, this was used to create the
cmd, powershell, wsl, pwsh, and azure profiles. Now, this helper is used for
any of the in-box dynamic profile generators.
Author(s):
- Mike Griese - August 2019
-- */
#pragma once
#include "Profile.h"
// !!! LOAD-BEARING
// If you change or delete this GUID, all dynamic profiles
// will become disconnected from user settings.
// {2bde4a90-d05f-401c-9492-e40884ead1d8}
// uuidv5 properties: name format is UTF-16LE bytes
static constexpr GUID TERMINAL_PROFILE_NAMESPACE_GUID = { 0x2bde4a90, 0xd05f, 0x401c, { 0x94, 0x92, 0xe4, 0x8, 0x84, 0xea, 0xd1, 0xd8 } };
winrt::Microsoft::Terminal::Settings::Model::Profile CreateDefaultProfile(const std::wstring_view name);